MCPcopy Create free account
hub / github.com/SoarGroup/Soar / exploration_randomly_select

Function exploration_randomly_select

Core/SoarKernel/src/exploration.cpp:792–807  ·  view source on GitHub ↗

* Function : exploration_randomly_select **************************************************************************/

Source from the content-addressed store, hash-verified

790 * Function : exploration_randomly_select
791 **************************************************************************/
792preference* 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

Calls 1

SoarRandIntFunction · 0.85

Tested by

no test coverage detected