public override void Learn(GridWorld world) { float[] currentState = world.GetState(); float currentReward = CurrentReward(); learningAgent.Learn(currentState, currentReward); }
public override WorldAction Process(GridWorld world) { Reward(-1); float[] state = world.GetState(); int index = learningAgent.Process(state); return(IndexToAction(index)); }
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); }
public virtual void Learn(GridWorld world) { }
public virtual WorldAction Process(GridWorld world) { return(0); }