/// <summary>
 /// Constructor: Create the program factory that will be used by derived classes
 /// to create the individual programs.
 /// </summary>
 /// <param name="Config"></param>
 /// <param name="InputDimension"></param>
 public GPGeneratePopulation(GPModelerServer Config, short InputDimension)
 {
     m_Config = Config;
     //
     // Create a program tree factor that will be used for creating new
     // program trees.
     m_TreeFactory = new GPProgramTreeFactory(Config, InputDimension);
 }
Beispiel #2
0
        public GPProgramTreeFactory(GPModelerServer Config, int InputDimension)
        {
            m_Config         = Config;
            m_InputDimension = InputDimension;

            m_OperatorADF = new GPProgramBranchFactoryADF(null, Config);
            m_OperatorADL = new GPProgramBranchFactoryADL(null, Config);
            m_OperatorADR = new GPProgramBranchFactoryADR(null, Config);
            m_OperatorRPB = new GPProgramBranchFactoryRPB(null, Config);
        }
Beispiel #3
0
        /// <summary>
        /// Default constructor - Prepare the memory for storing results.
        /// </summary>
        /// <param name="Config">Modeling configuration</param>
        /// <param name="TrainingData">Reference to the training data</param>
        /// <param name="Tolerance">Allowable tolerance around a resulting value for exact matching</param>
        /// <param name="UseInputHistory">True, if the InputHistory parameter is in use</param>
        public GPFitness(GPModelerServer Config, GPTrainingData TrainingData, double Tolerance, bool UseInputHistory)
        {
            m_Config          = Config;
            m_TrainingData    = TrainingData;
            m_Tolerance       = Tolerance;
            m_UseInputHistory = UseInputHistory;

            //
            // Create the contained program fitness selection object
            if (Config.Profile.SPEA2MultiObjective)
            {
                m_FitnessSelection = new GPFitnessSPEA2(Config.Profile.PopulationSize);
            }
            else
            {
                m_FitnessSelection = new GPFitnessSingle(Config.Profile.PopulationSize);
            }

            //
            // Given the training data, compute the maximum possible error, we need
            // this for the adaptive parsimony pressure.
            m_MaximumError = ComputeMaximumError(TrainingData);
            ComputeTrainingStats(TrainingData);

            //
            // Create room for the fitness measures
            InitializeStorage(Config.Profile.PopulationSize);

            m_PrevPopulationSize = Config.Profile.PopulationSize;

            //
            // Have to convert the training data version of the historical inputs
            // into the form that programs utilize.
            TransformHistoricalInputs(TrainingData);

            //
            // The input history for the custom fitness functions is a little
            // different than UDFs because there is no time step during fitness computation,
            // so need to do a little dance to handle that.
            PrepareFitnessInputHistory(TrainingData);

            //
            // Create the processing threads, one for each processor
            InitializeProcessingThreads(Environment.ProcessorCount);
        }
 public GPProgramBranchFactoryRPB(GPProgramBranchRPB RPB, GPModelerServer Config)
     : base(RPB, Config)
 {
 }
Beispiel #5
0
 public GPProgramBranchFactoryADF(GPProgramBranchADF ADF, GPModelerServer Config)
     : base(ADF, Config)
 {
     m_BranchADF = ADF;
 }
 public GPGeneratePopulationRamped(GPModelerServer Config, short InputDimension)
     : base(Config, InputDimension)
 {
 }
 public GPProgramBranchFactoryADR(GPProgramBranchADR ADR, GPModelerServer Config)
     : base(ADR, Config)
 {
     m_BranchADR = ADR;
 }
 public GPProgramBranchFactory(GPProgramBranch Branch, GPModelerServer Config)
 {
     m_Branch = Branch;
     m_Config = Config;
 }
Beispiel #9
0
 /// <summary>
 /// Basic constructor, accepts the configuration and prepares the
 /// container for the programs.
 /// </summary>
 /// <param name="Config"></param>
 public GPPopulation(GPModelerServer Config)
 {
     m_Config   = Config;
     m_Programs = new List <GPProgram>();
 }
 /// <summary>
 /// Standard constructor, accepts the GP configuration along with how
 /// many user input parameters are specified.
 /// </summary>
 /// <param name="ModelerConfig"></param>
 /// <param name="InputDimension"></param>
 public GPPopulationFactory(GPModelerServer ModelerConfig, int InputDimension)
 {
     m_ModelerConfig  = ModelerConfig;
     m_InputDimension = InputDimension;
 }
 public GPProgramBranchFactoryADL(GPProgramBranchADL ADL, GPModelerServer Config)
     : base(ADL, Config)
 {
     m_BranchADL = ADL;
 }