Documentation of 'org.jgap.audit.EvolutionMonitor' Java class
EvolutionMonitor
org.jgap.audit

Class EvolutionMonitor

  • All Implemented Interfaces:
    java.io.Serializable, IEvolutionMonitor


    public class EvolutionMonitor
    extends java.lang.Object
    implements IEvolutionMonitor
    Monitors the evolution progress extensively. Keeps track of the population development for each single generation during the whole evolution process. Monitors chromosomes as well as genes. For each chromosome the originating chromosome is monitored (applies for natural selectors as well as for genetic operators that transform a single chromosome, like MutationOperator). For more complex genetic operators, like CrossoverOperator, all originating chromosomes are monitored (in crossover there are two). For genes an analogue monitoring is supported as for chromosomes. TO ACTIVATE MONITORING: Configuration.setMonitor(new EvolutionMonitor()); Each chromosome and gene itself has a unique ID. This ID is set by method setUniqueID. A unique ID is a String value that, in best case, is unique worldwide. A chromosome's or gene's originator is set by method setUniqueIDTemplate. This method accepts an index, as there could be more than one originator (see below). -------------------------------------------------------------------------- To give a better view, here are the population snapshots that are taken during a single evolution generation (chromosomes are given by *,+,-,.): |-------| |-------| |-------| |-------| |-------| | ** * | | ** | | * | | + | | + | |* * * | => |* * * | => |* * | => |* - | => |* . | | * ** | | ** | | ** | | ** | | -* | |-------| |-------| |-------| |-------| |-------| Update Natural Natural Genetic Genetic Chromosomes Selector 1 Selector i Operator 1 Operator j (Fitness calc.) |-------| |-------| |-------| |-------| |-------| | + | | + | | +** | | +** | | + * | => |* . | => |* . | => |* . | => |* * . | => |* * . | | -* | | -* | |* -* | |* -* | |* - | |-------| |-------| |-------| |-------| |-------| Bulk Fitness Update Add new Re-add Natural Function Chromosomes Chromosomes Fittest Selector k (optional) Chromosome (Post-Sel.) |-------| | + * | => |* * . | |* - | |-------| End of cycle For each single evolution cycle, these population states are kept separately. -------------------------------------------------------------------------- For each chromosome the originating chromosomes are tracked. Here are examples: Natural Selection, e.g. WeightedRouletteSelector: Chromosome 4715 has originator Chromosome 4711 (different ID because of cloning) Genetic Operation, e.g. MutationOperator: Chromosome 5512 has originator Chromosome 1139 Genetic Operation, e.g. CrossoverOperator: Chromosome 7119 has originator Chromosomes 807 and 5703 Chromosome 7120 has originator Chromosomes 807 and 5703 => two resulting Chromosomes have the same originators! Genetic, Operation, e.g. YourOperator: There can be as many originating Chromosomes as your operator regards -------------------------------------------------------------------------- For each gene the originating genes are tracked. Examples: Natural Selection, e.g. WeightedRouletteSelector: All Genes in Chromosome 4711 have the same originating genes as Chromosome 4711's originating Chromosome's genes. => Chromosome is selected only, not modified, thus the Genes stick to the Chromosome they belong to. Genes unique ID of template is not set. Genetic Operation, e.g. MutationOperator: Each mutated Gene originates from exactly one other Gene Genetic Operation, e.g. CrossoverOperator: Each crossed over Gene A has one originating Gene B. In turn, Gene B has one originating Gene A, as their alleles are swapped. All uncrossed Genes have the same originator as the Chromosome they belong to, thus their unique ID of template is not set. Genetic, Operation, e.g. YourOperator: A Gene could virtually have any number of originators.
    Since:
    3.5
    See Also:
    Serialized Form
    • Field Detail

      • CONTEXT_UPDATE_CHROMOSOMES1

        public static final int CONTEXT_UPDATE_CHROMOSOMES1
        See Also:
        Constant Field Values
      • CONTEXT_OFFSET_NATURAL_SELECTOR1

        public static final int CONTEXT_OFFSET_NATURAL_SELECTOR1
        See Also:
        Constant Field Values
      • CONTEXT_OFFSET_AFTER_OPERATE

        public static final int CONTEXT_OFFSET_AFTER_OPERATE
        See Also:
        Constant Field Values
      • CONTEXT_AFTER_BULK_EVALUATION

        public static final int CONTEXT_AFTER_BULK_EVALUATION
        See Also:
        Constant Field Values
      • CONTEXT_UPDATE_CHROMOSOMES2

        public static final int CONTEXT_UPDATE_CHROMOSOMES2
        See Also:
        Constant Field Values
      • CONTEXT_OFFSET_NATURAL_SELECTOR2

        public static final int CONTEXT_OFFSET_NATURAL_SELECTOR2
        See Also:
        Constant Field Values
    • Constructor Detail

      • EvolutionMonitor

        public EvolutionMonitor()
    • Method Detail

      • nextCycle

        public boolean nextCycle(Population a_pop,
                                 java.util.List<java.lang.String> a_messages)
        Called after another evolution cycle has been executed.
        Specified by:
        nextCycle in interface IEvolutionMonitor
        Parameters:
        a_pop - the currently evolved population
        a_messages - the monitor can append messages to indicate why it asks evolution to stop
        Returns:
        true: continue with the evolution; false: stop evolution
        Since:
        3.4.4
      • start

        public void start(Configuration a_config)
        Called just before the evolution starts.
        Specified by:
        start in interface IEvolutionMonitor
        Parameters:
        a_config - the configuration used
        Since:
        3.5
      • event

        public void event(java.lang.String a_monitorEvent,
                          int a_evolutionNo,
                          java.lang.Object[] a_information)
        Called whenever it's worth monitoring.
        Specified by:
        event in interface IEvolutionMonitor
        Parameters:
        a_monitorEvent - see constants at top of class IEvolutionMonitor
        a_evolutionNo - the index of the evolution round (1, 2, ...)
        a_information - event-specific information
        Since:
        3.5

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.