コード例 #1
0
 /// <summary>
 /// Creates a new instance.
 /// </summary>
 /// <param name="playout">The strategy used to play out a game in simulation.</param>
 /// <param name="evaluation">The evaluation strategy for determining the value of samples.</param>
 /// <param name="gameLogic">The game specific logic required for searching through SabberStoneStates and SabberStoneActions.</param>
 public SabberStoneSideInformationStrategy(IPlayoutStrategy <List <SabberStoneAction>, SabberStoneState, SabberStoneAction, object, SabberStoneAction> playout, IStateEvaluation <List <SabberStoneAction>, SabberStoneState, SabberStoneAction, object, SabberStoneAction, TreeSearchNode <SabberStoneState, SabberStoneAction> > evaluation, IGameLogic <List <SabberStoneAction>, SabberStoneState, SabberStoneAction, object, SabberStoneAction, SabberStoneAction> gameLogic)
 {
     PlayoutBot = new RandomBot();
     Playout    = playout;
     Evaluation = evaluation;
     GameLogic  = gameLogic;
 }
コード例 #2
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="explorationStrategy">The exploration strategy.</param>
 /// <param name="playoutStrategy">The playout strategy.</param>
 /// <param name="samplingStrategy">The sampling strategy.</param>
 /// <param name="solutionStrategy">The solution strategy.</param>
 /// <param name="policyGlobal">The global policy.</param>
 public NMCTSBuilder(IExplorationStrategy <D, P, A, S, Sol> explorationStrategy, IPlayoutStrategy <D, P, A, S, Sol> playoutStrategy, ISamplingStrategy <P, A> samplingStrategy, ISolutionStrategy <D, P, A, S, Sol, TreeSearchNode <P, A> > solutionStrategy, double policyGlobal)
 {
     ExplorationStrategy = explorationStrategy;
     PlayoutStrategy     = playoutStrategy;
     SamplingStrategy    = samplingStrategy;
     SolutionStrategy    = solutionStrategy;
     PolicyGlobal        = policyGlobal;
 }
コード例 #3
0
 public void Setup(IGameLogic <object, TicTacToeState, TicTacToeMove, object, TicTacToeMove, TicTacToeMove> gameLogic,
                   IPlayoutStrategy <object, TicTacToeState, TicTacToeMove, object, TicTacToeMove> playoutStrategy,
                   IStateEvaluation <object, TicTacToeState, TicTacToeMove, object, TicTacToeMove, TreeSearchNode <TicTacToeState, TicTacToeMove> > evaluation)
 {
     GameLogic          = gameLogic;
     PlayoutStrategy    = playoutStrategy;
     EvaluationStrategy = evaluation;
 }
コード例 #4
0
 /// <summary>
 /// Creates a new instance of a Linear Side Information search.
 /// </summary>
 /// <param name="sideInformationStrategy">The strategy used to create the side information.</param>
 /// <param name="samplingStrategy">A strategy to sample actions during the Generation process.</param>
 /// <param name="playout">The strategy used to play out a game in simulation.</param>
 /// <param name="evaluation">The evaluation strategy for determining the value of samples.</param>
 /// <param name="gameLogic">The game specific logic required for searching.</param>
 /// <param name="budgetEstimationStrategy">The strategy used to determine the number of samples to be used in the different phases.</param>
 public LSI(ISideInformationStrategy <D, P, A, S, A, T> sideInformationStrategy, ILSISamplingStrategy <P, A, T> samplingStrategy, IPlayoutStrategy <D, P, A, S, A> playout, IStateEvaluation <D, P, A, S, A, N> evaluation, IGameLogic <D, P, A, S, A, A> gameLogic, IBudgetEstimationStrategy <D, P, A, S, A> budgetEstimationStrategy)
 {
     SideInformationStrategy = sideInformationStrategy;
     SamplingStrategy        = samplingStrategy;
     Playout    = playout;
     Evaluation = evaluation;
     GameLogic  = gameLogic;
     BudgetEstimationStrategy = budgetEstimationStrategy;
 }
コード例 #5
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="selectionStrategy">The selection strategy.</param>
 /// <param name="expansionStrategy">The expansion strategy.</param>
 /// <param name="backPropagationStrategy">The back propagation strategy.</param>
 /// <param name="finalNodeSelectionStrategy">The final node selection strategy.</param>
 /// <param name="evaluationStrategy">The state evaluation strategy.</param>
 /// <param name="solutionStrategy">The solution strategy.</param>
 /// <param name="playoutStrategy">The playout strategy.</param>
 /// <param name="time">The amount of time allowed for the search.</param>
 /// <param name="iterations">The amount of iterations allowed for the search.</param>
 public FlatMCS(ITreeSelection <D, P, A, S, Sol> selectionStrategy,
                ITreeExpansion <D, P, A, S, Sol> expansionStrategy,
                ITreeBackPropagation <D, P, A, S, Sol> backPropagationStrategy,
                ITreeFinalNodeSelection <D, P, A, S, Sol> finalNodeSelectionStrategy,
                IStateEvaluation <D, P, A, S, Sol, TreeSearchNode <P, A> > evaluationStrategy,
                ISolutionStrategy <D, P, A, S, Sol, TreeSearchNode <P, A> > solutionStrategy,
                IPlayoutStrategy <D, P, A, S, Sol> playoutStrategy, long time, int iterations) : base(
         selectionStrategy, expansionStrategy, backPropagationStrategy, finalNodeSelectionStrategy,
         evaluationStrategy, solutionStrategy, time, iterations)
 {
     PlayoutStrategy = playoutStrategy;
 }
コード例 #6
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="selectionStrategy">The selection strategy.</param>
 /// <param name="expansionStrategy">The expansion strategy.</param>
 /// <param name="backPropagationStrategy">The back propagation strategy.</param>
 /// <param name="finalNodeSelectionStrategy">The final node selection strategy.</param>
 /// <param name="evaluationStrategy">The state evaluation strategy.</param>
 /// <param name="explorationStrategy">The exploration strategy.</param>
 /// <param name="solutionStrategy">The solution strategy.</param>
 /// <param name="samplingStrategy">The sampling strategy.</param>
 /// <param name="playoutStrategy">The playout strategy.</param>
 /// <param name="time">The amount of time allowed for the search.</param>
 /// <param name="iterations">The amount of iterations allowed for the search.</param>
 /// <param name="globalPolicy">The global policy.</param>
 public NMCTS(ITreeSelection <D, P, A, S, Sol> selectionStrategy,
              ITreeExpansion <D, P, A, S, Sol> expansionStrategy,
              ITreeBackPropagation <D, P, A, S, Sol> backPropagationStrategy,
              ITreeFinalNodeSelection <D, P, A, S, Sol> finalNodeSelectionStrategy,
              IStateEvaluation <D, P, A, S, Sol, TreeSearchNode <P, A> > evaluationStrategy,
              IExplorationStrategy <D, P, A, S, Sol> explorationStrategy,
              ISolutionStrategy <D, P, A, S, Sol, TreeSearchNode <P, A> > solutionStrategy,
              ISamplingStrategy <P, A> samplingStrategy,
              IPlayoutStrategy <D, P, A, S, Sol> playoutStrategy, long time, int iterations, double globalPolicy) :
     base(selectionStrategy, expansionStrategy, backPropagationStrategy, finalNodeSelectionStrategy,
          evaluationStrategy, solutionStrategy, time, iterations)
 {
     ExplorationStrategy = explorationStrategy;
     SamplingStrategy    = samplingStrategy;
     PlayoutStrategy     = playoutStrategy;
     PolicyGlobal        = globalPolicy;
 }
コード例 #7
0
 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="playoutStrategy">The playout strategy.</param>
 /// <param name="solutionStrategy">The solution strategy.</param>
 public FlatMCSBuilder(IPlayoutStrategy <D, P, A, S, Sol> playoutStrategy, ISolutionStrategy <D, P, A, S, Sol, TreeSearchNode <P, A> > solutionStrategy)
 {
     PlayoutStrategy  = playoutStrategy;
     SolutionStrategy = solutionStrategy;
 }