Exemple #1
0
 /// <summary>
 /// Determines whether the strategy calls for exploring or exploiting, based on the current iteration number.
 /// </summary>
 /// <param name="context">The context of the search.</param>
 /// <param name="currentIteration">The number of the current iteration of the search.</param>
 /// <returns>Boolean, indicating if the search should explore. True indicates explore, False indicates exploit.</returns>
 public bool Policy(SearchContext <D, P, A, S, Sol> context, int currentIteration)
 {
     return(_rng.NextDouble() <= ChanceToExplore);
 }
 /// <summary>
 /// Returns the solution to the search.
 /// </summary>
 /// <param name="context">The context of the search.</param>
 /// <param name="node">The final node of the search.</param>
 /// <returns>A solution to the search.</returns>
 public Sol Solution(SearchContext <D, P, A, S, Sol> context, N node)
 {
     return((Sol)node.State);
 }