Skip to main content

Table 2 The algorithm for slave threads

From: Building a web-based tool to support clinical decisions in the control of Chlamydia trachomatis and Neisseria gonorrhoeae infections

Procedure slave( groups, screenings, treatments, combinations, budget )

FOR I = 1 TO combinations _size

   Get screening1, screening2 from combinations[I] and screenings;

   Get treatment1, treatment2 from combinations[I] and treatments;

   FOR J = 1 TO groups_size

      Update combinations[I] by adding the number of cured people in groups[J] given screening1, screening2, treatment1, and treatment2.

      Update combinations[I] by adding the cost for curing people in groups[J] given screening1, screening2, treatment1, and treatment2.

   Run knapsack algorithm to get the local optimal results for this type of combinations under budget.

   Return the local optimal results to the master thread.

End procedure slave.