Interregional Transfer demo code: Correcting printing of parameter settings to happen only once

This commit is contained in:
joseph.lizier 2014-08-07 02:15:14 +00:00
parent 8efe295a62
commit 22883aa575
1 changed files with 6 additions and 6 deletions

View File

@ -209,7 +209,7 @@ public abstract class InterregionalChannelMeasure {
channelCalc = (ChannelCalculatorMultiVariate)
Class.forName(calculatorClass).newInstance();
channelCalc.setDebug(debug);
setPropertiesOnCalculator();
setPropertiesOnCalculator(true);
rg = new RandomGenerator();
rg.setSeed(seed);
subsetsForEachRegion1 = null;
@ -307,11 +307,11 @@ public abstract class InterregionalChannelMeasure {
*
* @throws Exception
*/
protected void setPropertiesOnCalculator()
protected void setPropertiesOnCalculator(boolean forcePrintProperties)
throws Exception {
boolean oldDebug = debug;
channelCalc.setDebug(true);
channelCalc.setDebug(debug || forcePrintProperties);
for (Object keyObject : calculatorProperties.keySet()) {
channelCalc.setProperty((String) keyObject,
calculatorProperties.getProperty((String) keyObject));
@ -341,7 +341,7 @@ public abstract class InterregionalChannelMeasure {
*/
public ChannelMeasurementDistribution computeMean() throws Exception {
// Set up the calculator
setPropertiesOnCalculator();
setPropertiesOnCalculator(false);
checkSubsetsAreGenerated();
@ -440,7 +440,7 @@ public abstract class InterregionalChannelMeasure {
int reorderingsForSignificance = reorderings.length;
// Set up the calculator
setPropertiesOnCalculator();
setPropertiesOnCalculator(false);
checkSubsetsAreGenerated();
@ -561,7 +561,7 @@ public abstract class InterregionalChannelMeasure {
*/
public LocalChannelMeasurementDistribution computeLocals(double cutoff, boolean cutoffIsSignificance) throws Exception {
// Set up the calculator
setPropertiesOnCalculator();
setPropertiesOnCalculator(false);
checkSubsetsAreGenerated();