Synchronization with MK branch.
This commit is contained in:
parent
69f4b3e1cf
commit
43b2d031a1
@ -160,7 +160,7 @@ public class OptimizerFactory {
|
|||||||
de.addPopulationChangedEventListener(listener);
|
de.addPopulationChangedEventListener(listener);
|
||||||
de.init();
|
de.init();
|
||||||
|
|
||||||
listener.registerPopulationStateChanged(de.getPopulation(), "");
|
if (listener!=null) listener.registerPopulationStateChanged(de.getPopulation(), "");
|
||||||
|
|
||||||
return de;
|
return de;
|
||||||
}
|
}
|
||||||
@ -388,7 +388,7 @@ public class OptimizerFactory {
|
|||||||
hc.SetProblem(problem);
|
hc.SetProblem(problem);
|
||||||
hc.init();
|
hc.init();
|
||||||
|
|
||||||
listener.registerPopulationStateChanged(hc.getPopulation(), "");
|
if (listener != null) listener.registerPopulationStateChanged(hc.getPopulation(), "");
|
||||||
|
|
||||||
return hc;
|
return hc;
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ public class OptimizerFactory {
|
|||||||
mc.SetProblem(problem);
|
mc.SetProblem(problem);
|
||||||
mc.init();
|
mc.init();
|
||||||
|
|
||||||
listener.registerPopulationStateChanged(mc.getPopulation(), "");
|
if (listener != null) listener.registerPopulationStateChanged(mc.getPopulation(), "");
|
||||||
|
|
||||||
return mc;
|
return mc;
|
||||||
}
|
}
|
||||||
@ -465,7 +465,7 @@ public class OptimizerFactory {
|
|||||||
pso.addPopulationChangedEventListener(listener);
|
pso.addPopulationChangedEventListener(listener);
|
||||||
pso.init();
|
pso.init();
|
||||||
|
|
||||||
listener.registerPopulationStateChanged(pso.getPopulation(), "");
|
if (listener != null) listener.registerPopulationStateChanged(pso.getPopulation(), "");
|
||||||
|
|
||||||
return pso;
|
return pso;
|
||||||
}
|
}
|
||||||
@ -506,7 +506,7 @@ public class OptimizerFactory {
|
|||||||
sa.addPopulationChangedEventListener(listener);
|
sa.addPopulationChangedEventListener(listener);
|
||||||
sa.init();
|
sa.init();
|
||||||
|
|
||||||
listener.registerPopulationStateChanged(sa.getPopulation(), "");
|
if (listener!=null) listener.registerPopulationStateChanged(sa.getPopulation(), "");
|
||||||
|
|
||||||
return sa;
|
return sa;
|
||||||
}
|
}
|
||||||
|
@ -430,6 +430,7 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
|
|||||||
String name = oldProps[i].getDisplayName();
|
String name = oldProps[i].getDisplayName();
|
||||||
if (name.compareTo(string)==0) return i;
|
if (name.compareTo(string)==0) return i;
|
||||||
}
|
}
|
||||||
|
System.err.println("Error, property not found: " + string);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,6 @@ public class ExternalRuntimeProblem extends AbstractOptimizationProblem implemen
|
|||||||
|
|
||||||
x = getXVector(individual);
|
x = getXVector(individual);
|
||||||
|
|
||||||
//TODO call external runtime
|
|
||||||
double[] fit = eval(x);
|
double[] fit = eval(x);
|
||||||
individual.SetFitness(fit);
|
individual.SetFitness(fit);
|
||||||
|
|
||||||
|
@ -1066,7 +1066,9 @@ public class Mathematics {
|
|||||||
double d = 0.;
|
double d = 0.;
|
||||||
for (int i=0; i<x.length; i++) {
|
for (int i=0; i<x.length; i++) {
|
||||||
double dimLen = range[i][1]-range[i][0];
|
double dimLen = range[i][1]-range[i][0];
|
||||||
if (dimLen <= 0.) EVAERROR.errorMsgOnce("Error in reflectBounds: empty range! (possibly multiple errors)");
|
if (dimLen <= 0.) {
|
||||||
|
EVAERROR.errorMsgOnce("Error in reflectBounds: empty range! (possibly multiple errors)");
|
||||||
|
} else {
|
||||||
if (x[i]<range[i][0]) {
|
if (x[i]<range[i][0]) {
|
||||||
viols++;
|
viols++;
|
||||||
d = range[i][0]-x[i];
|
d = range[i][0]-x[i];
|
||||||
@ -1079,6 +1081,7 @@ public class Mathematics {
|
|||||||
x[i]=range[i][1]-d;
|
x[i]=range[i][1]-d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return viols;
|
return viols;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user