コード例 #1
0
        public GeneticAlgorithm newInstance(GeneString[] initial, GeneticInstanceParameters parameters)
        {
            if (!(parameters is RandomRestartInstanceParameters))
                throw new WrongParameterTypeException("A Random Restart Genetics instance can only be constructed using Random Restart Genetics Instance Parameters");

            RandomRestartInstanceParameters rrParameters = (RandomRestartInstanceParameters)parameters;

            return new RandomRestartGenetics(initial, rrParameters);
        }
コード例 #2
0
        public GeneticAlgorithm newInstance(GeneString[] initial, GeneticInstanceParameters parameters)
        {
            if (!(parameters is FuzzyGeneticsInstanceParameters))
                throw new WrongParameterTypeException("Fuzzy Genetics only accepts Fuzzy Genetics Instance Parameters");

            FuzzyGeneticsInstanceParameters fuzzyParameters = (FuzzyGeneticsInstanceParameters)parameters;

            return new FuzzyGenetics(initial, fuzzyParameters);
        }
コード例 #3
0
 public RandomRestartRunParameters(GeneticAlgorithm algorithm, GeneticInstanceParameters algorithmInstanceParameters,
     GeneticRunParameters algorithmRunParameters, int promilleGoalDecreasePerRound, int numRepeatsBeforeRestart, bool verbose)
 {
     this.algorithm = algorithm;
     this.algorithmInstanceParameters = algorithmInstanceParameters;
     this.algorithmRunParameters = algorithmRunParameters;
     this.promilleGoalDecreasePerRound = promilleGoalDecreasePerRound;
     this.numRepeatsBeforeRestart = numRepeatsBeforeRestart;
     this.verbose = verbose;
 }
コード例 #4
0
 public FuzzyGeneticsRunParameters(GeneticAlgorithm algorithm, GeneticInstanceParameters algorithmInstanceParameters,
     GeneticRunParameters algorithmRunParameters, int numberToAverageScoreOver, int waitSinceLastImprovement, bool verbose)
 {
     this.algorithm = algorithm;
     this.algorithmInstanceParameters = algorithmInstanceParameters;
     this.algorithmRunParameters = algorithmRunParameters;
     this.numberToAverageScoreOver = numberToAverageScoreOver;
     this.waitSinceLastImprovement = waitSinceLastImprovement;
     this.verbose = verbose;
 }
コード例 #5
0
        public GeneticAlgorithm newInstance(GeneString[] initial, GeneticInstanceParameters parameters)
        {
            if (!(parameters is BasicGeneticInstanceParameters))
                throw new WrongParameterTypeException("A Basic Genetics instance can only be constructed using Basic Genetics Instance Parameters");

            BasicGeneticInstanceParameters bParameters = (BasicGeneticInstanceParameters)parameters;

            return new BasicGenetics(initial, bParameters);
        }
コード例 #6
0
 public GeneticAlgorithm newInstance(GeneticInstanceParameters parameters)
 {
     return newInstance(null, parameters);
 }