Exemple #1
0
 public int CompareTo(AStar.IState other)
 {
     var state = other as State;
     if (state == null)
         return -1;
     return (int)(state.GridData - GridData);
 }
Exemple #2
0
 public IEnumerable<Tuple<AStar.IState, AStar.IAction, double>> Expand(AStar.IState state)
 {
     var list = new List<Tuple<AStar.IState, AStar.IAction, double>>();
     var st = state as State;
     if (st != null)
     {
         foreach (var x in Action.Actions)
         {
             State nst;
             if (st.PerformAction(x, out nst))
                 list.Add(new Tuple<AStar.IState, AStar.IAction, double>(nst, x, 1));
         }
     }
     return list;
 }
Exemple #3
0
 public bool IsGoal(AStar.IState state, AStar.IState goal)
 {
     if (state.CompareTo(goal) == 0)
         return true;
     return false;
 }