Exemple #1
0
        public override void Learn(GridWorld world)
        {
            float[] currentState  = world.GetState();
            float   currentReward = CurrentReward();

            learningAgent.Learn(currentState, currentReward);
        }
Exemple #2
0
        public override WorldAction Process(GridWorld world)
        {
            Reward(-1);
            float[] state = world.GetState();
            int     index = learningAgent.Process(state);

            return(IndexToAction(index));
        }
Exemple #3
0
 public override WorldAction Process(GridWorld world)
 {
     foreach (WorldObject obj in world.objects)
     {
         if (obj == this)
         {
             continue;
         }
         if ((obj.pos.X == this.pos.X) && (obj.pos.Y == this.pos.Y))
         {
             obj.Reward(reachReward);
             return(WorldAction.END);
         }
         //obj.Reward(-1);
     }
     return(WorldAction.None);
 }
Exemple #4
0
 public virtual void Learn(GridWorld world)
 {
 }
Exemple #5
0
 public virtual WorldAction Process(GridWorld world)
 {
     return(0);
 }