* Function : exploration_randomly_select **************************************************************************/
| 790 | * Function : exploration_randomly_select |
| 791 | **************************************************************************/ |
| 792 | preference* exploration_randomly_select(preference* candidates) |
| 793 | { |
| 794 | unsigned int cand_count = 0; |
| 795 | for (const preference* cand = candidates; cand; cand = cand->next_candidate) |
| 796 | { |
| 797 | ++cand_count; |
| 798 | } |
| 799 | |
| 800 | preference* cand = candidates; |
| 801 | for (uint32_t chosen_num = SoarRandInt(cand_count - 1); chosen_num; --chosen_num) |
| 802 | { |
| 803 | cand = cand->next_candidate; |
| 804 | } |
| 805 | |
| 806 | return cand; |
| 807 | } |
| 808 | |
| 809 | /*************************************************************************** |
| 810 | * Function : exploration_probabilistically_select |
no test coverage detected