Exemplo n.º 1
0
 private State(List <List <String> > configuaration, Heruistic heruistic, float currentCost, String lastMove, State parent)
 {
     this.heruistic      = heruistic;
     this.configuaration = configuaration;
     this.currentCost    = currentCost;
     this.lastMove       = lastMove;
     this.parent         = parent;
 }
Exemplo n.º 2
0
 public State(List <String> inputValues, String heruistic = "none", State goalState = null)
 {
     setConfiguration(inputValues);
     if (String.Equals(heruistic.ToLower(), "manhatten"))
     {
         this.heruistic = new Manhatten(goalState);
     }
     else if (String.Equals(heruistic.ToLower(), "misplaced"))
     {
         this.heruistic = new Misplaced(goalState);
     }
     else if (String.Equals(heruistic.ToLower(), "none"))
     {
         // used to create the goal state only
         this.heruistic = null;
     }
     else
     {
         throw new Exception("invalid heruist");
     }
     this.currentCost = 0;
     this.lastMove    = null;
     this.parent      = null;
 }