Documentation of 'ec.coevolve.CompetitiveEvaluator' Java class
CompetitiveEvaluator
ec.coevolve

Class CompetitiveEvaluator

  • All Implemented Interfaces:
    Setup, Singleton, java.io.Serializable


    public class CompetitiveEvaluator
    extends Evaluator
    CompetitiveEvaluator.java

    CompetitiveEvaluator is a Evaluator which performs competitive fitness evaluations. Competitive fitness is where individuals' fitness is determined by testing them against other members of the same subpopulation. Competitive fitness topologies differ from co-evolution topologies in that co-evolution is a term I generally reserve for multiple sbupopulations which breed separately but compete against other subpopulations during evaluation time. Individuals are evaluated regardless of whether or not they've been evaluated in the past.

    Your Problem is responsible for setting up the fitness appropriately. CompetitiveEvaluator expects to use Problems which adhere to the GroupedProblemForm interface, which defines a new evaluate(...) function, plus a preprocess(...) and postprocess(...) function.

    This competitive fitness evaluator is single-threaded -- maybe we'll hack in multithreading later. And it only has two individuals competing during any fitness evaluation. The order of individuals in the subpopulation will be changed during the evaluation process. There are seven evaluation topologies presently supported:

    Single Elimination Tournament
    All members of the population are paired up and evaluated. In each pair, the "winner" is the individual which winds up with the superior fitness. If neither fitness is superior, then the "winner" is picked at random. Then all the winners are paired up and evaluated, and so on, just like in a single elimination tournament. It is important that the population size be a power of two, else some individuals will not have the same number of "wins" as others and may lose the tournament as a result.
    Round Robin
    Every member of the population are paired up and evaluated with all other members of the population, not not including the member itself (we might add in self-play as a future later if people ask for it, it's easy to hack in).
    K-Random-Opponents-One-Way
    Each individual's fitness is calculated based on K competitions against random opponents. For details, see "A Comparison of Two Competitive Fitness Functions" by Liviu Panait and Sean Luke in the Proceedings of GECCO 2002.
    K-Random-Opponents-Two-Way
    Each individual's fitness is calculated based on K competitions against random opponents. The advantage of this method over K-Random-Opponents-One-Way is a reduced number of competitions (when I competes against J, both I's and J's fitnesses are updated, while in the previous method only one of the individuals has its fitness updated). For details, see "A Comparison of Two Competitive Fitness Functions" by Liviu Panait and Sean Luke in the Proceedings of GECCO 2002.

    Parameters

    base.style
    string with possible values:
    (the style of the tournament)
    single-elim-tournament (a single elimination tournament)
    round-robin (a round robin tournament)
    rand-1-way (K-Random-Opponents, each game counts for only one of the players)
    rand-2-way (K-Random-Opponents, each game counts for both players)
    base.group-size
    int
    (how many individuals per group, used in rand-1-way and rand-2-way tournaments)
    group-size >= 1 for rand-1-way or rand-2-way
    base.over-eval
    bool = true or false (default)
    (if the tournament style leads to an individual playing more games than others (as can be the case for rand-2-way), should the extra games be used for his fitness evaluatiuon?)
    See Also:
    Serialized Form
    • Field Detail

      • STYLE_SINGLE_ELIMINATION

        public static final int STYLE_SINGLE_ELIMINATION
        See Also:
        Constant Field Values
      • STYLE_N_RANDOM_COMPETITORS_ONEWAY

        public static final int STYLE_N_RANDOM_COMPETITORS_ONEWAY
        See Also:
        Constant Field Values
      • STYLE_N_RANDOM_COMPETITORS_TWOWAY

        public static final int STYLE_N_RANDOM_COMPETITORS_TWOWAY
        See Also:
        Constant Field Values
      • style

        public int style
      • groupSize

        public int groupSize
      • allowOverEvaluation

        public boolean allowOverEvaluation
    • Constructor Detail

      • CompetitiveEvaluator

        public CompetitiveEvaluator()
    • Method Detail

      • setup

        public void setup(EvolutionState state,
                          Parameter base)
        Description copied from interface: Setup
        Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.
        Specified by:
        setup in interface Setup
        Overrides:
        setup in class Evaluator
      • runComplete

        public boolean runComplete(EvolutionState state)
        Description copied from class: Evaluator
        Returns true if an ideal individual has been found or some other run result has shortcircuited the run so that it should end prematurely right now.
        Specified by:
        runComplete in class Evaluator
      • evaluatePopulation

        public void evaluatePopulation(EvolutionState state)
        An evaluator that performs coevolutionary evaluation. Like SimpleEvaluator, it applies evolution pipelines, one per thread, to various subchunks of a new population.
        Specified by:
        evaluatePopulation in class Evaluator
      • evalRoundRobinPopChunk

        public void evalRoundRobinPopChunk(EvolutionState state,
                                           int from,
                                           int numinds,
                                           int threadnum,
                                           Individual[] individuals,
                                           int subpop,
                                           GroupedProblemForm prob)
        A private helper function for evalutatePopulation which evaluates a chunk of individuals in a subpopulation for a given thread. Although this method is declared public (for the benefit of a private helper class in this file), you should not call it.
        Parameters:
        state -
        numinds -
        from -
        threadnum -
        prob -

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.