Ejemplo n.º 1
0
 /// <summary>
 /// Initialize some learning and technical variables and ready the bot for learning.
 /// Has to be called before Learn()
 /// </summary>
 /// <param name="control"></param>
 /// <param name="player">The player that the network will be playing</param>
 public override void Setup(GameControlBase control, GameControlBase.Players player)
 {
     base.Setup(control, player);
     rand = new Random();
     if (IsMultidimensionalOutput) // If the input is only the state
     {
         Dimensions = new List <int> {
             control.FeatureNum, 110, 50, control.ActionNum
         }
     }
     ;
     else // If the input is the state and action
     {
         Dimensions = new List <int> {
             control.FeatureNum + control.ActionNum, 110, 50, 1
         }
     };
     if (NeuralNet == null) // If the neural network wasn't loaded in another way
     {
         NeuralNet = new NetworkVectors(Dimensions);
     }
     OldNeuralNet = (NetworkVectors)NeuralNet.Clone();
     Control      = control;
     BotTurn      = player;
     ReplayMem    = new List <Transition>();
     Epsilon      = 1;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize some learning and technical variables and ready the bot for learning.
        /// Has to be called before Learn()
        /// </summary>
        /// <param name="control"></param>
        /// <param name="player">The player that the network will be playing</param>
        public override void Setup(GameControlBase control, GameControlBase.Players player)
        {
            base.Setup(control, player);
            Control = control;
            if (Q_Table == null)
            {
                Q_Table = new double[control.StateNum, control.ActionNum];
            }
            BotTurn = player;

            ActionNum = control.ActionNum;
            StateNum  = control.StateNum;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Get the <c>LearningBot</c> ready to <c>Learn()</c>
 /// </summary>
 /// <param name="player">The turn the <c>LearningBot</c> will take</param>
 public virtual void Setup(GameControlBase control, GameControlBase.Players player)
 {
     IsSetup = true;
 }