Пример #1
0
 public void Clean()
 {
     HasMoved     = false;
     Score        = 0.0;
     ChosenAction = null;
     PreSolutions.Clear();
     MovedToNewArea = false;
 }
Пример #2
0
        public RunItem(GWPosition <PositionData, ActionData> position, Action <RunItem <PositionData, ActionData, CheckPointType> > onTargetReached, ActionHandling <PositionData, ActionData> actionHandling, double[] weights, int multiEvaluationOptions)
        {
            MultiEvaluationOptions = multiEvaluationOptions;
            Id = Program.Random.Next();
            OnTargetReached = onTargetReached;
            ActionHandling  = actionHandling;
            Weights         = weights;
            if (Weights == null)
            {
                Weights = new double[actionHandling.ActionEvaluators.Count()];

                for (int i = 0; i < actionHandling.ActionEvaluators.Count(); i++)
                {
                    Weights[i] = Program.Random.NextDouble();
                }
            }

            PreSolutions.Add(new PreSolution <PositionData, ActionData, CheckPointType>(new GWPosition <PositionData, ActionData>(position.Data.Clone(), position.Depth + 1, position.CategoryPath), null));
        }