|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ec.Evaluator | +--ec.coevolve.CompetitiveEvaluator
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 five evaluation topologies presently supported:
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) pseudo-round-robin (population is split into groups with group-size individuals, and there is a round robin tournament for each such group) rand-1-way (K-Random-Opponents, each game counts for only one of the players) rand-2-ways (K-Random-Opponents, each game counts for both players) |
base.group-size int |
(how many individuals per group, used in pseudo-round-robin, rand-1-way and rand-2-ways tournaments) group-size >= 2 for pseudo-round-robin group-size >= 1 for rand-1-way or rand-2-ways |
base.over-eval bool = true or false (default) |
(if the tournament style leads to an individual playing more games than others, should the extra games be used for his fitness evaluatiuon?) |
base.repeat-play int >= 1 (default) |
(the number of games played between two individuals when they are compared, used for noisy competitions) |
Field Summary | |
boolean |
allowOverEvaluation
|
static java.lang.String |
competeStyle
|
int |
groupSize
|
int |
nGames
|
static java.lang.String |
overEval
|
static java.lang.String |
P_N_GAMES
How many times to repeat the play against one opponent. |
static java.lang.String |
size
|
int |
style
|
static int |
STYLE_N_RANDOM_COMPETITORS_ONEWAY
|
static int |
STYLE_N_RANDOM_COMPETITORS_TWOWAY
|
static int |
STYLE_PSEUDO_ROUND_ROBIN
|
static int |
STYLE_ROUND_ROBIN
|
static int |
STYLE_SINGLE_ELIMINATION
|
Fields inherited from class ec.Evaluator |
p_problem, P_PROBLEM |
Constructor Summary | |
CompetitiveEvaluator()
|
Method Summary | |
void |
evalNRandomOneWay(EvolutionState state,
Individual[] individuals,
GroupedProblemForm prob)
|
void |
evalNRandomTwoWay(EvolutionState state,
Individual[] individuals,
GroupedProblemForm prob)
|
void |
evalPseudoRoundRobin(EvolutionState state,
Individual[] individuals,
GroupedProblemForm prob)
|
void |
evalRoundRobin(EvolutionState state,
Individual[] individuals,
GroupedProblemForm prob)
|
void |
evalSingleElimination(EvolutionState state,
Individual[] individuals,
GroupedProblemForm prob)
|
void |
evaluatePopulation(EvolutionState state)
Evaluates the fitness of an entire population. |
void |
randomizeOrder(EvolutionState state,
Individual[] individuals)
|
boolean |
runComplete(EvolutionState state)
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. |
void |
setup(EvolutionState state,
Parameter base)
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int STYLE_SINGLE_ELIMINATION
public static final int STYLE_ROUND_ROBIN
public static final int STYLE_N_RANDOM_COMPETITORS_ONEWAY
public static final int STYLE_N_RANDOM_COMPETITORS_TWOWAY
public static final int STYLE_PSEUDO_ROUND_ROBIN
public static final java.lang.String competeStyle
public int style
public static final java.lang.String size
public int groupSize
public static final java.lang.String overEval
public boolean allowOverEvaluation
public static final java.lang.String P_N_GAMES
public int nGames
Constructor Detail |
public CompetitiveEvaluator()
Method Detail |
public void setup(EvolutionState state, Parameter base)
Setup
setup
in class Evaluator
public boolean runComplete(EvolutionState state)
Evaluator
runComplete
in class Evaluator
public void randomizeOrder(EvolutionState state, Individual[] individuals)
public void evaluatePopulation(EvolutionState state)
Evaluator
evaluatePopulation
in class Evaluator
public void evalSingleElimination(EvolutionState state, Individual[] individuals, GroupedProblemForm prob)
public void evalRoundRobin(EvolutionState state, Individual[] individuals, GroupedProblemForm prob)
public void evalPseudoRoundRobin(EvolutionState state, Individual[] individuals, GroupedProblemForm prob)
public void evalNRandomOneWay(EvolutionState state, Individual[] individuals, GroupedProblemForm prob)
public void evalNRandomTwoWay(EvolutionState state, Individual[] individuals, GroupedProblemForm prob)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |