Exemplo n.º 1
0
        private void PrepareIteration()
        {
            Fingerprints = new Dictionary <double, RunItem <PositionData, ActionData, CheckPointType> >();
            CheckPoints  = new List <LocalCheckPoint>();

            RunnerPool.Clear();
            RunnerPool.AddRange(Pool.RequestRunItems(PreSolutions.Select(ps => ps.Position)));

            RunnerPool.Each(rI => rI.OnTargetReached = (item) => EndPositionDiscovered(item.Position));
        }
Exemplo n.º 2
0
        private void Prepare()
        {
            random = new Random(2016);
            ComputationInfo.Progress = 0;
            BestResult = null;
            RunnerPool.Clear();
            CheckPoints.Clear();
            CategoryEvaluationLogic.Reset();
            LastGeneration = new List <PreSolution <PositionData, ActionData, CheckPointType> >();
            PreSolutions   = new List <PreSolution <PositionData, ActionData, CheckPointType> >();
            var startPos = MandatoryActionExecuter.ExecuteMandatoryActions(new GWPosition <PositionData, ActionData>(Input.CreateStartPosition(), 0, null));

            PreSolutions.AddRange(startPos.Select(pos => new PreSolution <PositionData, ActionData, CheckPointType>(pos)));
            ProgressEstimator.Init(PreSolutions.First().Position.Data);
        }