예제 #1
0
        public List <buildOrderEntry> createCompressedBuilds(List <BankStatement> freeCashFunction, List <double> approximateChronoTimes, double fastestYet, int globalIterationNum, bool firstChronoSelected)
        {
            List <buildOrderEntry> buildOrderNoEcon = new List <buildOrderEntry>();
            //find best build order based on cash and chrono availability. Pass in building and unit data.
            backwardsApproach thisApproach = new backwardsApproach(pairObjectsLibrary, buildingPairs, freeCashFunction, approximateChronoTimes, fastestYet, globalIterationNum, firstChronoSelected);

            //result may be null if no build was found under 500 seconds. If this occured, return a list with one item with start time of 100000.
            if (thisApproach.bestYet == null)
            {
                buildOrderEntry itemToAdd = new buildOrderEntry("Dummy", 100000);
                buildOrderNoEcon.Add(itemToAdd);
                return(buildOrderNoEcon);
            }
            //else return formated build order
            return(formatBuild(thisApproach, buildOrderNoEcon));
        }
예제 #2
0
        private List <buildOrderEntry> formatBuild(backwardsApproach thisApproach, List <buildOrderEntry> buildOrderNoEcon)
        {
            //need to pull start times of everything in order of occurence
            List <bUUEvent> orderedBuild = new List <bUUEvent>(thisApproach.bestYet.bestBuild.OrderBy(x => x.startTime));

            //build order needs a list of "bUUDataID, minStartTime"
            foreach (bUUEvent thisEvent in orderedBuild)
            {
                buildOrderEntry newOutput = new buildOrderEntry(thisApproach.bestYet.pairObjectLibrary[thisEvent.bUUDataID].name, thisEvent.startTime);
                buildOrderNoEcon.Add(newOutput);
            }

            //update last event duration
            lastEventDuration = orderedBuild[orderedBuild.Count() - 1].endTime - orderedBuild[orderedBuild.Count() - 1].startTime;

            //get chrono usage logs
            chronoWGLog  = thisApproach.bestYet.bestChronoOptionEvaluation.chronoWGLog;
            chronoCELog  = thisApproach.bestYet.bestChronoOptionEvaluation.chronoCELog;
            chronoEcoLog = thisApproach.bestYet.bestChronoOptionEvaluation.chronoEcoLog;

            return(buildOrderNoEcon);
        }