Exemplo n.º 1
0
        protected virtual void addToClosedList(State state)
        {
            StateInformation f = gValues[state];

            f.isClosed     = true;
            gValues[state] = f;
            if (maxGVal < f.gValue)
            {
                maxGVal = f.gValue;
            }
        }
Exemplo n.º 2
0
 protected virtual void addToOpenList(State s, int gValue, State pred)
 {
     if (!gValues.ContainsKey(s))
     {
         gValues.Add(s, new StateInformation(gValue));
         predecessor.Add(s, pred);
         openNodes.insert(gValue, s);
         return;
     }
     if (gValues[s].gValue > gValue)
     {
         StateInformation f = gValues[s];
         f.gValue       = gValue;
         gValues[s]     = f;
         predecessor[s] = pred;
         openNodes.insert(gValue, s);
         return;
     }
 }