|
GeneThello Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgap.BulkFitnessFunction
net.sf.genethello.ga.GFitnessFunction
public class GFitnessFunction
Fitness function for evaluating othello individuals in genetic algorithm.
| Field Summary | |
|---|---|
static int |
CHROMOSOME
Order of field 'chromosome' in insert/update population table. |
static int |
CURRENT
Order of field 'current' in insert/update population table. |
static int |
DRAW
Order of field 'draw' in insert/update population table. |
static int |
ELO
Order of field 'elo' in insert/update population table. |
static int |
GENERATION
Order of field 'generation' in insert/update population table. |
static int |
LOSE
Order of field 'lose' in insert/update population table. |
static int |
WIN
Order of field 'win' in insert/update population table. |
| Constructor Summary | |
|---|---|
GFitnessFunction(ChromosomeCreator chromosomeCreator,
boolean verbose,
boolean nosleep,
boolean network)
Creates new instance of fitness function. |
|
| Method Summary | |
|---|---|
void |
evaluate(org.jgap.Population arg0)
Performs a full cycle of othello tournament for all individuals versus all other individuals, twice for each couple playing black and white alternately, and sets the fitness value. |
void |
setGeneration(int gen)
Sets current generation. |
protected void |
tournament(org.jgap.IChromosome a_ic,
org.jgap.IChromosome b_ic,
java.sql.Connection connection)
Performs a match between two othello individuals, then updates the ELO rating. |
| Methods inherited from class org.jgap.BulkFitnessFunction |
|---|
clone |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int WIN
public static final int LOSE
public static final int DRAW
public static final int ELO
public static final int GENERATION
public static final int CHROMOSOME
public static final int CURRENT
| Constructor Detail |
|---|
public GFitnessFunction(ChromosomeCreator chromosomeCreator,
boolean verbose,
boolean nosleep,
boolean network)
chromosomeCreator - chromosome creatorverbose - print verbose information or notnosleep - use full CPU power or notnetwork - use network or not| Method Detail |
|---|
public void setGeneration(int gen)
gen - generation
protected void tournament(org.jgap.IChromosome a_ic,
org.jgap.IChromosome b_ic,
java.sql.Connection connection)
a_ic - chromosome for black playerb_ic - chromosome for white playerconnection - database connectionpublic void evaluate(org.jgap.Population arg0)
evaluate in class org.jgap.BulkFitnessFunctionarg0 - population of othello individuals
|
GeneThello Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||