Esempio n. 1
0
        private void Initialize_private(string name, ExperimentInitArgs args)
        {
            Name        = name;
            Description = args.Description;

            _inputCount  = args.InputCount;
            _outputCount = args.OutputCount;

            DefaultPopulationSize = args.PopulationSize;

            IsHyperNEAT = args.IsHyperNEAT;
            if (args.IsHyperNEAT)
            {
                _activationSchemeCppn = GetActivationScheme_CPPN();
            }

            _activationDefinition = args.Activation;
            _activationScheme     = GetActivationScheme(args.Activation);

            _complexityRegulationStr = args.Complexity_RegulationStrategy?.ToString();
            _complexityThreshold     = args.Complexity_Threshold;

            _parallelOptions = args.MaxDegreeOfParallelism == null ?
                               new ParallelOptions() :
                               new ParallelOptions {
                MaxDegreeOfParallelism = args.MaxDegreeOfParallelism.Value
            };

            NeatEvolutionAlgorithmParameters             = new NeatEvolutionAlgorithmParameters();
            NeatEvolutionAlgorithmParameters.SpecieCount = args.SpeciesCount;
        }
Esempio n. 2
0
        /// <summary>
        /// This overload takes multiple phenome evaluators that evaluate over many ticks.  There are multiple, because they will
        /// each be loaded with a different neural net and run at the same time
        /// </summary>
        public void Initialize(string name, ExperimentInitArgs args, IPhenomeTickEvaluator <IBlackBox, NeatGenome>[] phenomeEvaluators, RoundRobinManager roundRobinManager, Func <double> worldTick)
        {
            _phenomeEvaluators = phenomeEvaluators;
            _phenometickeval_roundRobinManager = roundRobinManager;
            _phenometickeval_worldTick         = worldTick;

            Initialize_private(name, args);
        }
Esempio n. 3
0
        /// <summary>
        /// This is my implementation that takes in a base args class instead of xml
        /// </summary>
        /// <remarks>
        /// Initialize must be called after the constructor.  After that, NeatEvolutionAlgorithmParameters and NeatGenomeParameters will be
        /// instantiated, and can be tweaked
        ///
        /// Once all the properties are set the way you want, call CreateEvolutionAlgorithm():
        ///
        ///     _experiment = new ExperimentBase_NEAT()     // or something that derives from this base
        ///     _experiment.Initialize(args, evaluator);
        ///
        ///     _experiment.NeatGenomeParameters.??? = ???
        ///     _experiment.NeatEvolutionAlgorithmParameters.??? = ???
        ///
        ///     _ea = _experiment.CreateEvolutionAlgorithm();
        /// </remarks>
        public void Initialize(string name, ExperimentInitArgs args, IPhenomeEvaluator <IBlackBox> phenomeEvaluator)
        {
            _phenomeEvaluator = phenomeEvaluator;

            Initialize_private(name, args);
        }