@Test public void limit() { final Predicate<EvolutionResult<?, Double>> l = Limits.byFitnessConvergence(5, 10, 0.015); int g = 0; while (l.test(result(10 + g, 100 + g, Optimize.MAXIMUM))) { ++g; } Assert.assertEquals(g, 69); }
@Override public boolean test(final EvolutionResult<?, N> result) { final Number fitness = result.bestFitness(); if (fitness != null) { _buffer.accept(fitness.doubleValue()); } return !_buffer.isFull() || _proceed.test( _buffer.doubleMoments(_shortFilterSize), _buffer.doubleMoments(_longFilterSize) ); }
FitnessConvergenceLimit implements Predicate<EvolutionResult<?, N>> { @Override public boolean test(final EvolutionResult<?, N> result) { final Number fitness = result.bestFitness(); if (fitness != null) { _buffer.accept(fitness.doubleValue()); } return !_buffer.isFull() || _proceed.test( _buffer.doubleMoments(_shortFilterSize), _buffer.doubleMoments(_longFilterSize) ); } }
FitnessConvergenceLimit implements Predicate<EvolutionResult<?, N>> { @Override public boolean test(final EvolutionResult<?, N> result) { final Number fitness = result.bestFitness(); if (fitness != null) { _buffer.accept(fitness.doubleValue()); } return !_buffer.isFull() || _proceed.test( _buffer.doubleMoments(_shortFilterSize), _buffer.doubleMoments(_longFilterSize) ); } FitnessConvergenceLimit(
		final int shortFilterSize,
		final int longFilterSize,
		final BiPredicate<DoubleMoments, DoubleMoments> proceed
	); }
FitnessConvergenceLimit implements Predicate<EvolutionResult<?, N>> { @Override public boolean test(final EvolutionResult<?, N> result) { final Number fitness = result.bestFitness(); if (fitness != null) { _buffer.accept(fitness.doubleValue()); } return !_buffer.isFull() || _proceed.test( _buffer.doubleMoments(_shortFilterSize), _buffer.doubleMoments(_longFilterSize) ); } FitnessConvergenceLimit(
		final int shortFilterSize,
		final int longFilterSize,
		final BiPredicate<DoubleMoments, DoubleMoments> proceed
	); @Override boolean test(final EvolutionResult<?, N> result); }
FitnessConvergenceLimit implements Predicate<EvolutionResult<?, N>> { @Override public boolean test(final EvolutionResult<?, N> result) { final Number fitness = result.bestFitness(); if (fitness != null) { _buffer.accept(fitness.doubleValue()); } return !_buffer.isFull() || _proceed.test( _buffer.doubleMoments(_shortFilterSize), _buffer.doubleMoments(_longFilterSize) ); } FitnessConvergenceLimit(
		final int shortFilterSize,
		final int longFilterSize,
		final BiPredicate<DoubleMoments, DoubleMoments> proceed
	); @Override boolean test(final EvolutionResult<?, N> result);  }