@Test (expected = Output.OutputExitException.class) public void testSetup3() { state.parameters.remove(BASE.push(HypervolumeStatistics.P_REFERENCE_POINT)); final HypervolumeStatistics instance = new HypervolumeStatistics(); instance.setup(state, BASE); }
@Override public void setup(final EvolutionState state, final Parameter base) { super.setup(state,base); if (state.parameters.exists(base.push(P_DO_MESSAGE),null)) state.output.warning("Messages are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_MESSAGE)); if (state.parameters.exists(base.push(P_DO_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_DESCRIPTION)); if (state.parameters.exists(base.push(P_DO_PER_GENERATION_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_PER_GENERATION_DESCRIPTION)); referencePoint = state.parameters.getDoubles(base.push(P_REFERENCE_POINT), null, Double.NEGATIVE_INFINITY); if (referencePoint == null) state.output.fatal("Missing required parameter.", base.push(P_REFERENCE_POINT)); if (doGeneration && referencePoint.length > 3) state.output.warnOnce(String.format("You calculating hypervolume on %d objectives at every generation. Note that hypervolume calculation can very costly for more than a few objectives.", referencePoint.length), base.push(P_REFERENCE_POINT)); }
HypervolumeStatistics extends SimpleStatistics { @Override public void setup(final EvolutionState state, final Parameter base) { super.setup(state,base); if (state.parameters.exists(base.push(P_DO_MESSAGE),null)) state.output.warning("Messages are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_MESSAGE)); if (state.parameters.exists(base.push(P_DO_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_DESCRIPTION)); if (state.parameters.exists(base.push(P_DO_PER_GENERATION_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_PER_GENERATION_DESCRIPTION)); referencePoint = state.parameters.getDoubles(base.push(P_REFERENCE_POINT), null, Double.NEGATIVE_INFINITY); if (referencePoint == null) state.output.fatal("Missing required parameter.", base.push(P_REFERENCE_POINT)); if (doGeneration && referencePoint.length > 3) state.output.warnOnce(String.format("You calculating hypervolume on %d objectives at every generation. Note that hypervolume calculation can very costly for more than a few objectives.", referencePoint.length), base.push(P_REFERENCE_POINT)); } }
HypervolumeStatistics extends SimpleStatistics { @Override public void setup(final EvolutionState state, final Parameter base) { super.setup(state,base); if (state.parameters.exists(base.push(P_DO_MESSAGE),null)) state.output.warning("Messages are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_MESSAGE)); if (state.parameters.exists(base.push(P_DO_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_DESCRIPTION)); if (state.parameters.exists(base.push(P_DO_PER_GENERATION_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_PER_GENERATION_DESCRIPTION)); referencePoint = state.parameters.getDoubles(base.push(P_REFERENCE_POINT), null, Double.NEGATIVE_INFINITY); if (referencePoint == null) state.output.fatal("Missing required parameter.", base.push(P_REFERENCE_POINT)); if (doGeneration && referencePoint.length > 3) state.output.warnOnce(String.format("You calculating hypervolume on %d objectives at every generation. Note that hypervolume calculation can very costly for more than a few objectives.", referencePoint.length), base.push(P_REFERENCE_POINT)); }  }
HypervolumeStatistics extends SimpleStatistics { @Override public void setup(final EvolutionState state, final Parameter base) { super.setup(state,base); if (state.parameters.exists(base.push(P_DO_MESSAGE),null)) state.output.warning("Messages are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_MESSAGE)); if (state.parameters.exists(base.push(P_DO_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_DESCRIPTION)); if (state.parameters.exists(base.push(P_DO_PER_GENERATION_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_PER_GENERATION_DESCRIPTION)); referencePoint = state.parameters.getDoubles(base.push(P_REFERENCE_POINT), null, Double.NEGATIVE_INFINITY); if (referencePoint == null) state.output.fatal("Missing required parameter.", base.push(P_REFERENCE_POINT)); if (doGeneration && referencePoint.length > 3) state.output.warnOnce(String.format("You calculating hypervolume on %d objectives at every generation. Note that hypervolume calculation can very costly for more than a few objectives.", referencePoint.length), base.push(P_REFERENCE_POINT)); }  double[] getReferencePoint(); @Override void setup(final EvolutionState state, final Parameter base); @Override void postEvaluationStatistics(final EvolutionState state); double hypervolume(final ArrayList<Individual> paretoFront); static double hypervolume(final ArrayList<Individual> paretoFront, final double[] referencePoint); double inclusiveHypervolume(final Individual ind); static double inclusiveHypervolume(final Individual ind, final double[] referencePoint); @Override void finalStatistics(final EvolutionState state, final int result); }
HypervolumeStatistics extends SimpleStatistics { @Override public void setup(final EvolutionState state, final Parameter base) { super.setup(state,base); if (state.parameters.exists(base.push(P_DO_MESSAGE),null)) state.output.warning("Messages are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_MESSAGE)); if (state.parameters.exists(base.push(P_DO_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_DESCRIPTION)); if (state.parameters.exists(base.push(P_DO_PER_GENERATION_DESCRIPTION),null)) state.output.warning("Descriptions are not printed out by " + this.getClass().getSimpleName(), base.push(P_DO_PER_GENERATION_DESCRIPTION)); referencePoint = state.parameters.getDoubles(base.push(P_REFERENCE_POINT), null, Double.NEGATIVE_INFINITY); if (referencePoint == null) state.output.fatal("Missing required parameter.", base.push(P_REFERENCE_POINT)); if (doGeneration && referencePoint.length > 3) state.output.warnOnce(String.format("You calculating hypervolume on %d objectives at every generation. Note that hypervolume calculation can very costly for more than a few objectives.", referencePoint.length), base.push(P_REFERENCE_POINT)); }  double[] getReferencePoint(); @Override void setup(final EvolutionState state, final Parameter base); @Override void postEvaluationStatistics(final EvolutionState state); double hypervolume(final ArrayList<Individual> paretoFront); static double hypervolume(final ArrayList<Individual> paretoFront, final double[] referencePoint); double inclusiveHypervolume(final Individual ind); static double inclusiveHypervolume(final Individual ind, final double[] referencePoint); @Override void finalStatistics(final EvolutionState state, final int result); final static String P_REFERENCE_POINT; }