Cosmetics in MO-CMA-ES
This commit is contained in:
parent
cde1d3618a
commit
78e68dd624
@ -1,36 +1,20 @@
|
|||||||
package eva2.server.go.strategies;
|
package eva2.server.go.strategies;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
|
import eva2.gui.GenericObjectEditor;
|
||||||
import eva2.server.go.InterfacePopulationChangedEventListener;
|
import eva2.server.go.InterfacePopulationChangedEventListener;
|
||||||
import eva2.server.go.individuals.AbstractEAIndividual;
|
import eva2.server.go.individuals.AbstractEAIndividual;
|
||||||
import eva2.server.go.individuals.InterfaceESIndividual;
|
|
||||||
import eva2.server.go.operators.archiving.AbstractArchiving;
|
|
||||||
import eva2.server.go.operators.archiving.ArchivingNSGAII;
|
import eva2.server.go.operators.archiving.ArchivingNSGAII;
|
||||||
import eva2.server.go.operators.archiving.ArchivingNSGAIISMeasure;
|
import eva2.server.go.operators.archiving.ArchivingNSGAIISMeasure;
|
||||||
import eva2.server.go.operators.mutation.InterfaceMutationGenerational;
|
|
||||||
import eva2.server.go.operators.mutation.MutateESCovarianceMatrixAdaptionPlus;
|
import eva2.server.go.operators.mutation.MutateESCovarianceMatrixAdaptionPlus;
|
||||||
import eva2.server.go.operators.selection.InterfaceSelection;
|
|
||||||
import eva2.server.go.operators.selection.SelectBestIndividuals;
|
|
||||||
import eva2.server.go.operators.selection.SelectMONSGAIICrowedTournament;
|
|
||||||
import eva2.server.go.operators.selection.SelectMONonDominated;
|
|
||||||
import eva2.server.go.populations.InterfaceSolutionSet;
|
import eva2.server.go.populations.InterfaceSolutionSet;
|
||||||
import eva2.server.go.populations.Population;
|
import eva2.server.go.populations.Population;
|
||||||
import eva2.server.go.populations.SolutionSet;
|
import eva2.server.go.populations.SolutionSet;
|
||||||
import eva2.server.go.problems.AbstractOptimizationProblem;
|
import eva2.server.go.problems.AbstractOptimizationProblem;
|
||||||
import eva2.server.go.problems.InterfaceOptimizationProblem;
|
import eva2.server.go.problems.InterfaceOptimizationProblem;
|
||||||
|
|
||||||
import eva2.tools.math.Mathematics;
|
|
||||||
import eva2.tools.math.RNG;
|
|
||||||
import eva2.tools.math.Jama.EigenvalueDecomposition;
|
|
||||||
import eva2.tools.math.Jama.Matrix;
|
|
||||||
|
|
||||||
public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
||||||
|
|
||||||
class CounterClass {
|
class CounterClass {
|
||||||
@ -42,7 +26,7 @@ public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
|||||||
public boolean seen = false;
|
public boolean seen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String m_Identifier = "NelderMeadSimplex";
|
private String m_Identifier = "MOCMAES";
|
||||||
|
|
||||||
private Population m_Population;
|
private Population m_Population;
|
||||||
private AbstractOptimizationProblem m_Problem;
|
private AbstractOptimizationProblem m_Problem;
|
||||||
@ -60,19 +44,22 @@ public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
|||||||
m_Problem = (AbstractOptimizationProblem) a.m_Problem.clone();
|
m_Problem = (AbstractOptimizationProblem) a.m_Problem.clone();
|
||||||
setPopulation((Population) a.m_Population.clone());
|
setPopulation((Population) a.m_Population.clone());
|
||||||
m_lambda = a.m_lambda;
|
m_lambda = a.m_lambda;
|
||||||
m_Identifier = a.m_Identifier;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MultiObjectiveCMAES clone() {
|
public MultiObjectiveCMAES clone() {
|
||||||
return new MultiObjectiveCMAES(this);
|
return new MultiObjectiveCMAES(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
public void hideHideable() {
|
||||||
|
GenericObjectEditor.setHideProperty(this.getClass(), "population", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void SetIdentifier(String name) {
|
public void SetIdentifier(String name) {
|
||||||
m_Identifier = name;
|
m_Identifier = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public void SetProblem(InterfaceOptimizationProblem problem) {
|
public void SetProblem(InterfaceOptimizationProblem problem) {
|
||||||
m_Problem = (AbstractOptimizationProblem) problem;
|
m_Problem = (AbstractOptimizationProblem) problem;
|
||||||
}
|
}
|
||||||
@ -87,38 +74,41 @@ public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
|||||||
this.m_Listener = ea;
|
this.m_Listener = ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public void freeWilly() {
|
public void freeWilly() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public InterfaceSolutionSet getAllSolutions() {
|
public InterfaceSolutionSet getAllSolutions() {
|
||||||
Population pop = getPopulation();
|
Population pop = getPopulation();
|
||||||
return new SolutionSet(pop, pop);
|
return new SolutionSet(pop, pop);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public String getIdentifier() {
|
public String getIdentifier() {
|
||||||
|
|
||||||
return m_Identifier;
|
return m_Identifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "(1+" + m_lambda + ") MO-CMA-ES";
|
return "(1+" + m_lambda + ") MO-CMA-ES";
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
public static String globalInfo() {
|
||||||
|
return "A multi-objective CMA-ES variant after Igel, Hansen and Roth 2007 (EC 15(1),1-28).";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Population getPopulation() {
|
public Population getPopulation() {
|
||||||
return m_Population;
|
return m_Population;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public InterfaceOptimizationProblem getProblem() {
|
public InterfaceOptimizationProblem getProblem() {
|
||||||
return m_Problem;
|
return m_Problem;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public String getStringRepresentation() {
|
public String getStringRepresentation() {
|
||||||
StringBuilder strB = new StringBuilder(200);
|
StringBuilder strB = new StringBuilder(200);
|
||||||
strB.append("(1+" + m_lambda + ") MO-CMA-ES:\nOptimization Problem: ");
|
strB.append("(1+" + m_lambda + ") MO-CMA-ES:\nOptimization Problem: ");
|
||||||
@ -128,7 +118,7 @@ public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
|||||||
return strB.toString();
|
return strB.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
// initByPopulation(m_Population, true);
|
// initByPopulation(m_Population, true);
|
||||||
this.m_Population.setTargetSize(m_lambdamo);
|
this.m_Population.setTargetSize(m_lambdamo);
|
||||||
@ -139,7 +129,7 @@ public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public void initByPopulation(Population pop, boolean reset) {
|
public void initByPopulation(Population pop, boolean reset) {
|
||||||
setPopulation(pop);
|
setPopulation(pop);
|
||||||
if (reset) {
|
if (reset) {
|
||||||
@ -159,7 +149,7 @@ public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
|||||||
this.m_Problem.evaluate(population);
|
this.m_Problem.evaluate(population);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public void optimize() {
|
public void optimize() {
|
||||||
|
|
||||||
HashMap<Long, CounterClass> SuccessCounterMap = new HashMap<Long, CounterClass>();
|
HashMap<Long, CounterClass> SuccessCounterMap = new HashMap<Long, CounterClass>();
|
||||||
@ -291,13 +281,13 @@ public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public boolean removePopulationChangedEventListener(
|
public boolean removePopulationChangedEventListener(
|
||||||
InterfacePopulationChangedEventListener ea) {
|
InterfacePopulationChangedEventListener ea) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public void setPopulation(Population pop) {
|
public void setPopulation(Population pop) {
|
||||||
m_Population = pop;
|
m_Population = pop;
|
||||||
m_Population.setNotifyEvalInterval(1);
|
m_Population.setNotifyEvalInterval(1);
|
||||||
@ -318,7 +308,6 @@ public class MultiObjectiveCMAES implements InterfaceOptimizer, Serializable {
|
|||||||
public int getLambda() {
|
public int getLambda() {
|
||||||
return m_lambda;
|
return m_lambda;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLambda(int mLambda) {
|
public void setLambda(int mLambda) {
|
||||||
m_lambda = mLambda;
|
m_lambda = mLambda;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user