public bool IsEqual(State other) { WalkerState otherState = other as WalkerState; if (otherState != null) { return(AreFieldsEqual(otherState.Fields) && IsExitVisible == otherState.IsExitVisible); } return(false); }
public List <AIAction> GetActionsIn(State state) { WalkerState walkerState = state as WalkerState; if (walkerState == null) { return(new List <AIAction>()); } return(actions.ConvertAll <AIAction>(x => x)); }
public double TakeActionInState(State state, AIAction action) { WalkerState walkerState = state as WalkerState; WalkerAction walkerAction = action as WalkerAction; if (walkerAction == null || walkerState == null) { return(0); } return(WalkerAIRules.GetStateActionReward(walkerState, walkerAction)); }
public static double GetStateActionReward(WalkerState walkerState, WalkerAction walkerAction) { float speed = 10; return(Game.GetActionReward(speed * GetVectorOfDirection(walkerAction.direction))); }