示例#1
0
    public void Fill(ref CloseContainer Close, Dictionary <DefaultState, ARAstarNode> Visited, ref DefaultState stateReached, PlanningDomainBase domain, ref DefaultState current, ref KeyValuePair <DefaultState, ARAstarNode> goalPair, float inflationFactor)
    {
        //DefaultState s = goalPair.Key;
        //Close.Insert(goalPair.Value);
        plan.Clear();
        DefaultState s;

        if (Visited.ContainsKey(goalPair.Key))
        {
            s = stateReached = goalPair.Key;
        }
        else
        {
            s = stateReached;
        }
        DefaultAction a;
        bool          done = false;

        /*foreach(ARAstarNode planNode in plan.Values)
         * {
         *      Close.Insert(planNode);
         * }
         * plan.Clear();
         *
         * // TODO : check if we still need this function
         * Close.UpdateReferences(inflationFactor, domain);*/
        do
        {
            if (domain.equals(s, current, false))
            {
                done = true;
            }
            if (Visited.ContainsKey(s))
            {
                plan[s] = Visited[s];
                s       = Visited[s].previousState;
            }
            else
            {
                break;
            }
        } while (!done);
        //updatePlanReference(domain);
    }
示例#2
0
 /// <summary>
 /// Initializes the containers.
 /// </summary>
 void InitializedArrays()
 {
     if (Close == null)
     {
         Close = new CloseContainer();
     }
     if (Open == null)
     {
         Open = new OpenContainer(this, usingHeap);
     }
     if (Incons == null)
     {
         Incons = new Incons();
     }
     if (Visited == null)
     {
         Visited = new VisitedContainer(selectedPlanningDomain);
     }
 }
示例#3
0
    public void Fill(ref CloseContainer Close, Dictionary<DefaultState, ARAstarNode> Visited, ref DefaultState stateReached, PlanningDomainBase domain, ref DefaultState current, ref KeyValuePair<DefaultState, ARAstarNode> goalPair, float inflationFactor)
    {
        //DefaultState s = goalPair.Key;
        //Close.Insert(goalPair.Value);
        plan.Clear();
        DefaultState s;
        if(Visited.ContainsKey(goalPair.Key))
            s = stateReached = goalPair.Key;
        else
            s = stateReached;
        DefaultAction a;
        bool done = false;
        /*foreach(ARAstarNode planNode in plan.Values)
        {
            Close.Insert(planNode);
        }
        plan.Clear();

        // TODO : check if we still need this function
        Close.UpdateReferences(inflationFactor, domain);*/
        do {
            if (domain.equals (s, current, false))
                    done = true;
            if(Visited.ContainsKey(s)){
                plan[s] = Visited[s];
                s = Visited[s].previousState;
            }
            else{
                break;
            }

        } while (!done);
        //updatePlanReference(domain);
    }