Esempio n. 1
0
        override protected WorldState CreateSearchRoot(int minDepth = -1, int minCost = -1, MDDNode mddNode = null)
        {
            var root = new WorldStateForPartialExpansion(this.instance.agents, minDepth, minCost, mddNode);

            root.sic = (int)SumIndividualCosts.h(root, this.instance);
            return(root);
        }
Esempio n. 2
0
        /// <summary>
        /// Copy constructor
        /// </summary>
        /// <param name="cpy"></param>
        public WorldStateForPartialExpansion(WorldStateForPartialExpansion cpy)
            : base(cpy)
        {
            alreadyExpanded = false; // Creating a new unexpanded node from cpy

            // For intermediate nodes created during expansion (fully expanded nodes have these fields recalculated when they're expanded)
            remainingDeltaF    = cpy.remainingDeltaF;
            singleAgentDeltaFs = cpy.singleAgentDeltaFs; // For the UpdateRemainingDeltaF call on temporary nodes.
                                                         // Notice that after an agent is moved its row won't be up-to-date.
            fLookup = cpy.fLookup;                       // For the hasChildrenForCurrentDeltaF call on temporary nodes.
                                                         // Notice that after an agent is moved, all rows up to and including the one of the agent that moved
                                                         // won't be up-to-date.
            maxDeltaF = cpy.maxDeltaF;                   // Not necessarily achievable after some of the agents moved.
            // The above is OK because we won't be using data for agents that already moved.
        }