removed the bool flag that has to be set in order to print any output
This commit is contained in:
parent
e3dab9cfeb
commit
ee17d01f53
@ -71,7 +71,7 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
private boolean printEdgeRate = false;
|
private boolean printEdgeRate = false;
|
||||||
private boolean printTimestamps = false;
|
private boolean printTimestamps = false;
|
||||||
private boolean printMetrics = false;
|
private boolean printMetrics = false;
|
||||||
private boolean printExtraOutput = false;
|
// private boolean printExtraOutput = false;
|
||||||
|
|
||||||
public BOA() {
|
public BOA() {
|
||||||
|
|
||||||
@ -88,16 +88,16 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
this.learningSetRatio = learningSetRatio;
|
this.learningSetRatio = learningSetRatio;
|
||||||
this.resampleRatio = resampleRatio;
|
this.resampleRatio = resampleRatio;
|
||||||
this.netFolder = outputFolder;
|
this.netFolder = outputFolder;
|
||||||
this.printExtraOutput = printExtraOutput;
|
// this.printExtraOutput = printExtraOutput;
|
||||||
this.upperProbLimit = upperProbLimit;
|
this.upperProbLimit = upperProbLimit;
|
||||||
this.lowerProbLimit = lowerProbLimit;
|
this.lowerProbLimit = lowerProbLimit;
|
||||||
this.printEdgeRate = printEdgeRate;
|
this.printEdgeRate = printEdgeRate;
|
||||||
this.printNetworks = printNetworks;
|
this.printNetworks = printNetworks;
|
||||||
this.printMetrics = printMetrics;
|
this.printMetrics = printMetrics;
|
||||||
this.printTimestamps = printTimestamps;
|
this.printTimestamps = printTimestamps;
|
||||||
if (printEdgeRate || printNetworks || printMetrics || printTimestamps) {
|
// if (printEdgeRate || printNetworks || printMetrics || printTimestamps) {
|
||||||
this.printExtraOutput = true;
|
// this.printExtraOutput = true;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public BOA(BOA b) {
|
public BOA(BOA b) {
|
||||||
@ -125,7 +125,7 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.scoringMethod = b.scoringMethod;
|
this.scoringMethod = b.scoringMethod;
|
||||||
this.printExtraOutput = b.printExtraOutput;
|
// this.printExtraOutput = b.printExtraOutput;
|
||||||
this.printNetworks = b.printNetworks;
|
this.printNetworks = b.printNetworks;
|
||||||
this.printMetrics = b.printMetrics;
|
this.printMetrics = b.printMetrics;
|
||||||
this.printEdgeRate = b.printEdgeRate;
|
this.printEdgeRate = b.printEdgeRate;
|
||||||
@ -145,16 +145,16 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void hideHideable() {
|
public void hideHideable() {
|
||||||
GenericObjectEditor
|
// GenericObjectEditor
|
||||||
.setHideProperty(this.getClass(), "population", true);
|
// .setHideProperty(this.getClass(), "population", true);
|
||||||
GenericObjectEditor.setHideProperty(getClass(), "printNetworks",
|
// GenericObjectEditor.setHideProperty(getClass(), "printNetworks",
|
||||||
!printExtraOutput);
|
// !printExtraOutput);
|
||||||
GenericObjectEditor.setHideProperty(getClass(), "printEdgeRate",
|
// GenericObjectEditor.setHideProperty(getClass(), "printEdgeRate",
|
||||||
!printExtraOutput);
|
// !printExtraOutput);
|
||||||
GenericObjectEditor.setHideProperty(getClass(), "printMetrics",
|
// GenericObjectEditor.setHideProperty(getClass(), "printMetrics",
|
||||||
!printExtraOutput);
|
// !printExtraOutput);
|
||||||
GenericObjectEditor.setHideProperty(getClass(), "printTimestamps",
|
// GenericObjectEditor.setHideProperty(getClass(), "printTimestamps",
|
||||||
!printExtraOutput);
|
// !printExtraOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addPopulationChangedEventListener(
|
public void addPopulationChangedEventListener(
|
||||||
@ -215,11 +215,11 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
*/
|
*/
|
||||||
private void defaultInit() {
|
private void defaultInit() {
|
||||||
this.count = 0;
|
this.count = 0;
|
||||||
if (printExtraOutput) {
|
// if (printExtraOutput) {
|
||||||
if (printTimestamps) {
|
if (printTimestamps) {
|
||||||
printTimeStamp();
|
printTimeStamp();
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
if (population == null) {
|
if (population == null) {
|
||||||
this.population = new Population(this.PopSize);
|
this.population = new Population(this.PopSize);
|
||||||
} else {
|
} else {
|
||||||
@ -539,7 +539,8 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
calcLearningSetSize(), this.fitCrit);
|
calcLearningSetSize(), this.fitCrit);
|
||||||
// generate the network with these individuals
|
// generate the network with these individuals
|
||||||
constructNetwork(best);
|
constructNetwork(best);
|
||||||
if(this.printExtraOutput && this.printEdgeRate){
|
// if(this.printExtraOutput && this.printEdgeRate){
|
||||||
|
if(this.printEdgeRate){
|
||||||
this.edgeRate = this.network.adaptEdgeRate(this.edgeRate);
|
this.edgeRate = this.network.adaptEdgeRate(this.edgeRate);
|
||||||
}
|
}
|
||||||
// sample new individuals from the network
|
// sample new individuals from the network
|
||||||
@ -555,7 +556,7 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
this.firePropertyChangedEvent(Population.nextGenerationPerformed);
|
this.firePropertyChangedEvent(Population.nextGenerationPerformed);
|
||||||
this.problem.evaluatePopulationEnd(this.population);
|
this.problem.evaluatePopulationEnd(this.population);
|
||||||
// print output if desired
|
// print output if desired
|
||||||
if (this.printExtraOutput) {
|
// if (this.printExtraOutput) {
|
||||||
if (printNetworks) {
|
if (printNetworks) {
|
||||||
printNetworkToFile("" + this.count);
|
printNetworkToFile("" + this.count);
|
||||||
}
|
}
|
||||||
@ -568,7 +569,7 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
if (printTimestamps) {
|
if (printTimestamps) {
|
||||||
printTimeStamp();
|
printTimeStamp();
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -711,25 +712,25 @@ public class BOA implements InterfaceOptimizer, java.io.Serializable {
|
|||||||
return new String[] { "learningRatio", "resamplingRatio" };
|
return new String[] { "learningRatio", "resamplingRatio" };
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPrintExtraOutput() {
|
// public boolean isPrintExtraOutput() {
|
||||||
return this.printExtraOutput;
|
// return this.printExtraOutput;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void setPrintExtraOutput(boolean b) {
|
// public void setPrintExtraOutput(boolean b) {
|
||||||
this.printExtraOutput = b;
|
// this.printExtraOutput = b;
|
||||||
GenericObjectEditor.setHideProperty(getClass(), "printNetworks",
|
// GenericObjectEditor.setHideProperty(getClass(), "printNetworks",
|
||||||
!printExtraOutput);
|
// !printExtraOutput);
|
||||||
GenericObjectEditor.setHideProperty(getClass(), "printEdgeRate",
|
// GenericObjectEditor.setHideProperty(getClass(), "printEdgeRate",
|
||||||
!printExtraOutput);
|
// !printExtraOutput);
|
||||||
GenericObjectEditor.setHideProperty(getClass(), "printMetrics",
|
// GenericObjectEditor.setHideProperty(getClass(), "printMetrics",
|
||||||
!printExtraOutput);
|
// !printExtraOutput);
|
||||||
GenericObjectEditor.setHideProperty(getClass(), "printTimestamps",
|
// GenericObjectEditor.setHideProperty(getClass(), "printTimestamps",
|
||||||
!printExtraOutput);
|
// !printExtraOutput);
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String printExtraOutputTipText() {
|
// public String printExtraOutputTipText() {
|
||||||
return "do you want to print extra output files";
|
// return "do you want to print extra output files";
|
||||||
}
|
// }
|
||||||
|
|
||||||
public boolean isPrintNetworks() {
|
public boolean isPrintNetworks() {
|
||||||
return this.printNetworks;
|
return this.printNetworks;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user