Per dimension borders for AbstractMultiObjectiveOptimizationProblem

This commit is contained in:
Holger Franken 2010-08-18 12:56:20 +00:00
parent 397c40c35e
commit e9dec6cdde

View File

@ -85,8 +85,8 @@ public abstract class AbstractMultiObjectiveOptimizationProblem extends Abstract
transient protected Population m_ParetoFront = new Population(); transient protected Population m_ParetoFront = new Population();
public ArrayList m_AreaConst4Parallelization = new ArrayList(); public ArrayList m_AreaConst4Parallelization = new ArrayList();
protected int m_OutputDimension = 2; protected int m_OutputDimension = 2;
double m_borderLow = 0; double m_defaultBorderLow = 0;
double m_borderHigh = 5; double m_defaultBorderHigh = 5;
transient protected double[][] m_Border; transient protected double[][] m_Border;
transient protected Plot m_Plot; transient protected Plot m_Plot;
@ -95,9 +95,9 @@ public abstract class AbstractMultiObjectiveOptimizationProblem extends Abstract
public AbstractMultiObjectiveOptimizationProblem(double borderHigh) { public AbstractMultiObjectiveOptimizationProblem(double borderHigh) {
super(); super();
m_borderHigh=borderHigh; m_defaultBorderHigh=borderHigh;
this.m_Template = new ESIndividualDoubleData(); this.m_Template = new ESIndividualDoubleData();
initBorder(); makeBorder();
if (this.m_Show) this.initProblemFrame(); if (this.m_Show) this.initProblemFrame();
} }
@ -136,21 +136,25 @@ public abstract class AbstractMultiObjectiveOptimizationProblem extends Abstract
* problem frame (i'll provide a default implementation here. * problem frame (i'll provide a default implementation here.
*/ */
public void initProblem() { public void initProblem() {
initBorder(); makeBorder();
this.m_ParetoFront = new Population(); this.m_ParetoFront = new Population();
if (this.m_Show) this.initProblemFrame(); if (this.m_Show) this.initProblemFrame();
} }
protected void initBorder() { protected void makeBorder() {
initBorder(m_borderLow, m_borderHigh); if (this.m_Border == null) this.m_Border = new double[m_OutputDimension][2];
for (int i = 0; i < this.m_Border.length; i++) {
this.m_Border[i][0] = getLowerBorder(i);
this.m_Border[i][1] = getUpperBorder(i);
}
} }
protected void initBorder(double lower, double upper) { protected double getUpperBorder(int i) {
if (this.m_Border == null) this.m_Border = new double[2][2]; return m_defaultBorderHigh;
for (int i = 0; i < this.m_Border.length; i++) {
this.m_Border[i][0] = lower;
this.m_Border[i][1] = upper;
} }
protected double getLowerBorder(int i) {
return m_defaultBorderLow;
} }
/** This method checks whether the problem has truely evaluated /** This method checks whether the problem has truely evaluated