示例#1
0
    public override void plan(BuildingGS initialGS, BuildingGS targetGS, Func <Stack <Work>, bool> callback)
    {
        PriorityQueue <QPriority, QGameState> queue = new PriorityQueue <QPriority, QGameState>();

        StartCoroutine(LTPEngine.BuildPlan(initialGS, targetGS, queue, base.processResult));
        StartCoroutine(base.waitForFinish(callback));
    }
    public void accordionLTP(BuildingGS initialGS,
                             BuildingGS targetGS,
                             Func <Stack <Work>, bool> callback,
                             int memoryBound = 20000)
    {
        PriorityQueue <QPriority, QGameState> accordionQ = new AccordionPriorityQueue(memoryBound);

        StartCoroutine(LTPEngine.BuildPlan(initialGS, targetGS, accordionQ, base.processResult));
        StartCoroutine(base.waitForFinish(callback));
    }
示例#3
0
    public void memoryBoundedLTP(BuildingGS initialGS,
                                 BuildingGS targetGS,
                                 Func <Stack <Work>, bool> callback,
                                 int memoryBound = 100000)
    {
        /**
         * Find a path from the initialGS to the targetGS. The resultant path (translted into an ordered list of Work)
         * will be pumped into the provided callback once it's ready.
         */
        PriorityQueue <QPriority, QGameState> memoryBoundedQ = new MemoryBoundedPriorityQueue(memoryBound);

        StartCoroutine(LTPEngine.BuildPlan(initialGS, targetGS, memoryBoundedQ, base.processResult));
        StartCoroutine(base.waitForFinish(callback));
    }
    public void ID_LTP(BuildingGS initialGS,
                       BuildingGS targetGS,
                       Func <Stack <Work>, bool> callback,
                       int initialDepth = 100)
    {
        /**
         * Find a path from the initialGS to the targetGS. The resultant path (translted into an ordered list of Work)
         * will be pumped into the provided callback once it's ready.
         */

        // First, save these incase pathfinding fails and we need to recur with larger depth
        this.initialGS = initialGS;
        this.targetGS  = targetGS;
        this.callback  = callback;

        this.ID_Queue = new IDPriorityQueue(initialDepth);
        StartCoroutine(LTPEngine.BuildPlan(initialGS, targetGS, ID_Queue, id_processResult));
        StartCoroutine(base.waitForFinish(callback));
    }