コード例 #1
0
 /// <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);
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #4
0
 public GPProgramBranchFactoryRPB(GPProgramBranchRPB RPB, GPModelerServer Config)
     : base(RPB, Config)
 {
 }
コード例 #5
0
 public GPProgramBranchFactoryADF(GPProgramBranchADF ADF, GPModelerServer Config)
     : base(ADF, Config)
 {
     m_BranchADF = ADF;
 }
コード例 #6
0
 public GPGeneratePopulationRamped(GPModelerServer Config, short InputDimension)
     : base(Config, InputDimension)
 {
 }
コード例 #7
0
 public GPProgramBranchFactoryADR(GPProgramBranchADR ADR, GPModelerServer Config)
     : base(ADR, Config)
 {
     m_BranchADR = ADR;
 }
コード例 #8
0
 public GPProgramBranchFactory(GPProgramBranch Branch, GPModelerServer Config)
 {
     m_Branch = Branch;
     m_Config = Config;
 }
コード例 #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>();
 }
コード例 #10
0
 /// <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;
 }
コード例 #11
0
 public GPProgramBranchFactoryADL(GPProgramBranchADL ADL, GPModelerServer Config)
     : base(ADL, Config)
 {
     m_BranchADL = ADL;
 }