Algorithm 2.
| Output: Selected policy | |
| 1 | begin |
| 2 | KA ← randomly selected policy from entire population of policies; |
| 3 | KB ← randomly selected policy from entire population of policies; |
| 4 | if J(KA) > J(KB) then |
| 5 | return KA; |
| 6 | end |
| 7 | else |
| 8 | return KB; |
| 9 | end |
| 10 | end |