public ESOptimization(double[] minValues,double[] maxValues,int populationSize,int individualSize,int initType,int maxGenerations,int generationsWithoutImprovement,int selectionType,double tournamentFraction,boolean keepBest,int mutationType,double defaultSigma,double crossoverProb,boolean showConvergencePlot,boolean showPopulationPlot,RandomGenerator random,LoggingHandler logging,Operator executingOperator){
  this.logging=logging;
  this.random=random;
  this.showConvergencePlot=showConvergencePlot;
  this.populationSize=populationSize;
  this.individualSize=individualSize;
  this.min=minValues;
  this.max=maxValues;
  this.valueTypes=new OptimizationValueType[individualSize];
  this.executingOperator=executingOperator;
  for (int i=0; i < this.valueTypes.length; i++) {
    this.valueTypes[i]=OptimizationValueType.VALUE_TYPE_DOUBLE;
  }
  this.initType=initType;
  this.maxGenerations=maxGenerations;
  this.generationsWithoutImprovement=generationsWithoutImprovement < 1 ? this.maxGenerations : generationsWithoutImprovement;
  popOps=new LinkedList<>();
switch (selectionType) {
case UNIFORM_SELECTION:
    popOps.add(new UniformSelection(populationSize,keepBest,random));
  break;
case CUT_SELECTION:
popOps.add(new CutSelection(populationSize));
break;
case ROULETTE_WHEEL:
popOps.add(new RouletteWheel(populationSize,keepBest,random));
break;
case STOCHASTIC_UNIVERSAL:
popOps.add(new StochasticUniversalSampling(populationSize,keepBest,random));
break;
case BOLTZMANN_SELECTION:
popOps.add(new BoltzmannSelection(populationSize,1.0d,this.maxGenerations,true,keepBest,random));
break;
case RANK_SELECTION:
popOps.add(new RankSelection(populationSize,keepBest,random));
break;
case TOURNAMENT_SELECTION:
popOps.add(new TournamentSelection(populationSize,tournamentFraction,keepBest,random));
break;
case NON_DOMINATED_SORTING_SELECTION:
popOps.add(new NonDominatedSortingSelection(populationSize));
if (showPopulationPlot) {
this.populationPlotter=new PopulationPlotter();
popOps.add(this.populationPlotter);
}
break;
}
popOps.add(new Crossover(crossoverProb,random));
switch (mutationType) {
case GAUSSIAN_MUTATION:
double[] sigma=new double[this.min.length];
if (!Double.isNaN(defaultSigma)) {
for (int s=0; s < sigma.length; s++) {
sigma[s]=defaultSigma;
}
}
 else {
for (int s=0; s < sigma.length; s++) {
sigma[s]=(this.max[s] - this.min[s]) / 100.0d;
}
}
GaussianMutation gm=new GaussianMutation(sigma,this.min,this.max,this.valueTypes,random);
popOps.add(gm);
popOps.add(new VarianceAdaption(gm,individualSize,this.logging));
this.mutation=gm;
break;
case SWITCHING_MUTATION:
this.mutation=new SwitchingMutation(1.0d / individualSize,this.min,this.max,this.valueTypes,random);
popOps.add(this.mutation);
break;
case SPARSITY_MUTATION:
this.mutation=new SparsityMutation(1.0d / individualSize,this.min,this.max,this.valueTypes,random);
popOps.add(this.mutation);
break;
default :
break;
}
}

public ESOptimization ( double [ ] minValues , double [ ] maxValues , int populationSize , int individualSize , int initType , int maxGenerations , int generationsWithoutImprovement , int selectionType , double tournamentFraction , boolean keepBest , int mutationType , double defaultSigma , double crossoverProb , boolean showConvergencePlot , boolean showPopulationPlot , RandomGenerator random , LoggingHandler logging , Operator executingOperator ) { this . logging = logging ; this . random = random ; this . showConvergencePlot = showConvergencePlot ; this . populationSize = populationSize ; this . individualSize = individualSize ; this . min = minValues ; this . max = maxValues ; this . valueTypes = new OptimizationValueType [ individualSize ] ; this . executingOperator = executingOperator ; for ( int i = 0 ; i < this . valueTypes . length ; i ++ ) { this . valueTypes [ i ] = OptimizationValueType . VALUE_TYPE_DOUBLE ; } this . initType = initType ; this . maxGenerations = maxGenerations ; this . generationsWithoutImprovement = generationsWithoutImprovement < 1 ? this . maxGenerations : generationsWithoutImprovement ; popOps = new LinkedList < > ( ) ; switch ( selectionType ) { case UNIFORM_SELECTION : popOps . add ( new UniformSelection ( populationSize , keepBest , random ) ) ; break ; case CUT_SELECTION : popOps . add ( new CutSelection ( populationSize ) ) ; break ; case ROULETTE_WHEEL : popOps . add ( new RouletteWheel ( populationSize , keepBest , random ) ) ; break ; case STOCHASTIC_UNIVERSAL : popOps . add ( new StochasticUniversalSampling ( populationSize , keepBest , random ) ) ; break ; case BOLTZMANN_SELECTION : popOps . add ( new BoltzmannSelection ( populationSize , 1.0d , this . maxGenerations , true , keepBest , random ) ) ; break ; case RANK_SELECTION : popOps . add ( new RankSelection ( populationSize , keepBest , random ) ) ; break ; case TOURNAMENT_SELECTION : popOps . add ( new TournamentSelection ( populationSize , tournamentFraction , keepBest , random ) ) ; break ; case NON_DOMINATED_SORTING_SELECTION : popOps . add ( new NonDominatedSortingSelection ( populationSize ) ) ; if ( showPopulationPlot ) { this . populationPlotter = new PopulationPlotter ( ) ; popOps . add ( this . populationPlotter ) ; } break ; } popOps . add ( new Crossover ( crossoverProb , random ) ) ; switch ( mutationType ) { case GAUSSIAN_MUTATION : double [ ] sigma = new double [ this . min . length ] ; if ( ! Double . isNaN ( defaultSigma ) ) { for ( int s = 0 ; s < sigma . length ; s ++ ) { sigma [ s ] = defaultSigma ; } } else { for ( int s = 0 ; s < sigma . length ; s ++ ) { sigma [ s ] = ( this . max [ s ] - this . min [ s ] ) / 100.0d ; } } GaussianMutation gm = new GaussianMutation ( sigma , this . min , this . max , this . valueTypes , random ) ; popOps . add ( gm ) ; popOps . add ( new VarianceAdaption ( gm , individualSize , this . logging ) ) ; this . mutation = gm ; break ; case SWITCHING_MUTATION : this . mutation = new SwitchingMutation ( 1.0d / individualSize , this . min , this . max , this . valueTypes , random ) ; popOps . add ( this . mutation ) ; break ; case SPARSITY_MUTATION : this . mutation = new SparsityMutation ( 1.0d / individualSize , this . min , this . max , this . valueTypes , random ) ; popOps . add ( this . mutation ) ; break ; default : break ; } }
creates a new evolutionary svm optimization .
