public void start ( final BiConsumer < EvolutionResult < PolygonGene , Double > , EvolutionResult < PolygonGene , Double > > callback ) { final Thread thread = new Thread ( ( ) -> { final MinMax < EvolutionResult < PolygonGene , Double > > best = MinMax . of ( ) ; _engine . stream ( ) . limit ( result -> ! Thread . currentThread ( ) . isInterrupted ( ) ) . peek ( best ) . forEach ( r -> { waiting ( ) ; if ( callback != null ) { callback . accept ( r , best . getMax ( ) ) ; } } ) ; } ) ; thread . start ( ) ; _thread = thread ; }
Starts the evolution worker with the given evolution result callback . The callback may be null .