예제 #1
0
        public FitnessInfo Evaluate(IBlackBox agent)
        {
            double fitness = 0;

            double[] score = new double[4];
            //synchronize the access to game controller
            lock (this)
            {
                //call a keepaway game controller
                fitness = NEATGame.FitnessValue(agent, out score);
            }
            _evalCount++;
            fitness /= scale;
            //termination condition
            if (fitness >= 1)
            {
                _stopConditionSatisfied = true;
            }

            return(new FitnessInfo(fitness, score));
        }
예제 #2
0
        public FitnessInfo Evaluate(IBlackBox agent, out double[] behVector)
        {
            config = KPExperimentConfig.Load("KPExperimentConfig.xml");
            double fitness = 0;

            double[] values = new double[4];
            //synchronize the access to game controller
            lock (this)
            {
                //call a keepaway game controller
                fitness = NEATGame.FitnessValue(agent, out values);
            }
            behVector = values;
            _evalCount++;
            fitness /= scale;
            //termination condition
            if (fitness >= 1)
            {
                _stopConditionSatisfied = true;
            }

            return(new FitnessInfo(fitness, fitness));
        }