/// <summary>
        /// Create a new instance of <see cref="INeatExperiment{T}"/>.
        /// </summary>
        /// <param name="configElem">Experiment config in json form.</param>
        /// <returns>A new instance of <see cref="INeatExperiment{T}"/>.</returns>
        public INeatExperiment <double> CreateExperiment(JsonElement configElem)
        {
            // Create an evaluation scheme object for the Single Pole Balancing task.
            var evalScheme = new CartDoublePoleEvaluationScheme();

            // Create a NeatExperiment object with the evaluation scheme,
            // and assign some default settings (these can be overridden by config).
            var experiment = new NeatExperiment <double>(evalScheme, this.Id)
            {
                IsAcyclic           = false,
                CyclesPerActivation = 1,
                ActivationFnName    = ActivationFunctionId.LogisticSteep.ToString()
            };

            // Read standard neat experiment json config and use it configure the experiment.
            NeatExperimentJsonReader <double> .Read(experiment, configElem);

            return(experiment);
        }
Example #2
0
        /// <summary>
        /// Create a new instance of <see cref="INeatExperiment{T}"/>.
        /// </summary>
        /// <param name="jsonConfig">Experiment config in json format.</param>
        /// <returns>A new instance of <see cref="INeatExperiment{T}"/>.</returns>
        public INeatExperiment <double> CreateExperiment(string jsonConfig)
        {
            // Parse the json config string.
            JObject configJobj = JsonUtils.Parse(jsonConfig);

            // Create an evaluation scheme object for the Single Pole Balancing task.
            var evalScheme = new CartDoublePoleEvaluationScheme();

            // Create a NeatExperiment object with the evaluation scheme.
            var experiment = NeatExperiment <double> .CreateAcyclic(
                "Cart and Pole Balancing (Double Pole)",
                evalScheme,
                __DefaultActivationFunctionName.ToString());

            // Read standard neat experiment json config and use it configure the experiment.
            if (configJobj != null)
            {
                NeatExperimentJsonReader <double> .Read(experiment, configJobj);
            }

            return(experiment);
        }