示例#1
0
        public Evaluator3(WorldAccessor worldAccessor, TrainingRoom room, BotTrackingStorage log, ExperimentInitArgs_Activation activation, HyperNEAT_Args hyperneatArgs = null, double maxEvalTime = 15, double?initialRandomVelocity = null)
        {
            _worldAccessor         = worldAccessor;
            _room                  = room;
            _log                   = log;
            _activation            = activation;
            _hyperneatArgs         = hyperneatArgs;
            _maxEvalTime           = maxEvalTime;
            _initialRandomVelocity = initialRandomVelocity;

            // Set distances based on room size (or take as params?, or just a percent param?)
            double roomWidth = Math1D.Min
                               (
                room.AABB.Item2.X - room.AABB.Item1.X,
                room.AABB.Item2.Y - room.AABB.Item1.Y,
                room.AABB.Item2.Z - room.AABB.Item1.Z
                               );

            // Want radius, not diameter
            _roomRadius = roomWidth / 2;

            _maxDistance2 = _roomRadius * MULT_MAXDIST2;
            _maxDistance  = _roomRadius * MULT_MAXDIST;
            _minDistance  = _roomRadius * MULT_MINDIST;
        }
示例#2
0
        public Evaluator_WeaponSpin(WorldAccessor worldAccessor, TrainingRoom room, BotTrackingStorage log, ExperimentInitArgs_Activation activation, double weaponSpeed_Min, double weaponSpeed_Max, HyperNEAT_Args hyperneatArgs = null, double maxEvalTime = 15)
        {
            _worldAccessor = worldAccessor;
            _room          = room;
            _log           = log;
            _activation    = activation;
            _hyperneatArgs = hyperneatArgs;
            _maxEvalTime   = maxEvalTime;

            // Set distances based on room size (or take as params?, or just a percent param?)
            double roomWidth = Math1D.Min
                               (
                room.AABB.Item2.X - room.AABB.Item1.X,
                room.AABB.Item2.Y - room.AABB.Item1.Y,
                room.AABB.Item2.Z - room.AABB.Item1.Z
                               );

            // Want radius, not diameter
            _roomRadius = roomWidth / 2;

            _maxDistance2 = _roomRadius * MULT_MAXDIST2;
            _maxDistance  = _roomRadius * MULT_MAXDIST;

            // Weapon Speed
            _weaponSpeed_Min  = weaponSpeed_Min;
            _weaponSpeed_Max  = weaponSpeed_Max;
            _weaponSpeed_Max2 = _weaponSpeed_Max + ((_weaponSpeed_Max - _weaponSpeed_Min) / 2);
        }
示例#3
0
        public static FitnessInfo FinishEvaluation(ref bool isEvaluating, double runningTime, double error, double maxEvalTime, BotTrackingStorage log, TrainingRoom room, BotTrackingEntry[] snapshots)
        {
            isEvaluating = false;

            double fitness = runningTime - error;

            if (fitness < 0)
            {
                fitness = 0;
            }

            fitness *= 1000 / maxEvalTime;     // scale the score to be 1000

            FitnessInfo retVal = new FitnessInfo(fitness, fitness);

            log.AddEntry(new BotTrackingRun(room.Center, room.AABB.Item1, room.AABB.Item2, retVal, snapshots));

            return(retVal);
        }