Class EvolutionListeners
java.lang.Object
net.bmahe.genetics4j.core.evolutionlisteners.EvolutionListeners
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <U extends Comparable<U>>
EvolutionListener<U> Creates a default evolution listener that outputs to System.out without external logging dependencies.static <U extends Comparable<U>>
EvolutionListener<U> ofDefault(int skipN) Creates a default evolution listener with generation skipping.static <U extends Comparable<U>>
EvolutionListener<U> ofDefault(int topN, int skipN) Creates a default evolution listener that shows the top N individuals.static <U extends Comparable<U>>
EvolutionListener<U> Creates a fully configurable default evolution listener.static <U extends Comparable<U>>
EvolutionListener<U> Creates a default evolution listener with custom genotype formatting.static <U extends Comparable<U>>
EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN) static <U extends Comparable<U>>
EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, int skipN) static <U extends Comparable<U>>
EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, int skipN, Comparator<U> comparator) static <U extends Comparable<U>>
EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, int skipN, Comparator<U> comparator, Function<Genotype, String> prettyPrinter) static <U extends Comparable<U>>
EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, Comparator<U> comparator) static <U extends Comparable<U>>
EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, Comparator<U> comparator, Function<Genotype, String> prettyPrinter) static <U extends Comparable<U>>
EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, Function<Genotype, String> prettyPrinter)
-
Constructor Details
-
EvolutionListeners
private EvolutionListeners()
-
-
Method Details
-
ofLogTopN
public static <U extends Comparable<U>> EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN) -
ofLogTopN
public static <U extends Comparable<U>> EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, int skipN) -
ofLogTopN
public static <U extends Comparable<U>> EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, Comparator<U> comparator) -
ofLogTopN
public static <U extends Comparable<U>> EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, Comparator<U> comparator, Function<Genotype, String> prettyPrinter) -
ofLogTopN
public static <U extends Comparable<U>> EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, Function<Genotype, String> prettyPrinter) -
ofLogTopN
public static <U extends Comparable<U>> EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, int skipN, Comparator<U> comparator) -
ofLogTopN
public static <U extends Comparable<U>> EvolutionListener<U> ofLogTopN(org.apache.logging.log4j.Logger logger, int topN, int skipN, Comparator<U> comparator, Function<Genotype, String> prettyPrinter) -
ofDefault
Creates a default evolution listener that outputs to System.out without external logging dependencies. Shows the best individual each generation.- Type Parameters:
U- the fitness type, must be Comparable- Returns:
- a new DefaultEvolutionListener instance
-
ofDefault
Creates a default evolution listener with generation skipping.- Type Parameters:
U- the fitness type, must be Comparable- Parameters:
skipN- the number of generations to skip between outputs (0 = no skipping)- Returns:
- a new DefaultEvolutionListener instance
-
ofDefault
Creates a default evolution listener that shows the top N individuals.- Type Parameters:
U- the fitness type, must be Comparable- Parameters:
topN- the number of top individuals to displayskipN- the number of generations to skip between outputs- Returns:
- a new DefaultEvolutionListener instance
-
ofDefault
public static <U extends Comparable<U>> EvolutionListener<U> ofDefault(int topN, Function<Genotype, String> prettyPrinter) Creates a default evolution listener with custom genotype formatting.- Type Parameters:
U- the fitness type, must be Comparable- Parameters:
topN- the number of top individuals to displayprettyPrinter- function to format genotypes for display- Returns:
- a new DefaultEvolutionListener instance
-
ofDefault
public static <U extends Comparable<U>> EvolutionListener<U> ofDefault(int topN, int skipN, Function<Genotype, String> prettyPrinter) Creates a fully configurable default evolution listener.- Type Parameters:
U- the fitness type, must be Comparable- Parameters:
topN- the number of top individuals to displayskipN- the number of generations to skip between outputsprettyPrinter- function to format genotypes for display- Returns:
- a new DefaultEvolutionListener instance
-