|
GeneThello Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.genethello.brain.Chromosome
public class Chromosome
Chromosome to represent individual othello player (brain).
| Field Summary | |
|---|---|
protected int[] |
boundaries
Array of phase boundaries int[phases + 1]. |
protected Feature[][] |
features
Matrix of features Feature[phases][length]. |
protected int |
length
Number of features, usually 6 i.e.: flips, discs, mobility, xquares, corners, pattern. |
protected int[] |
maxBoundaries
Array of maximum phase boundaries int[phases + 1]. |
protected int[] |
minBoundaries
Array of minimum phase boundaries int[phases + 1]. |
protected int |
phases
Phase number in game, usually 3 phases: opening, middle, end. |
| Constructor Summary | |
|---|---|
Chromosome(int phases,
int length)
Creates new instance of chromosome. |
|
| Method Summary | |
|---|---|
int[] |
getBoundaries()
Gets the value of boundaries. |
int |
getBoundaries(int index)
Gets the value of boundaries at specified index. |
Feature |
getFeatures(int p,
int i)
Gets the value of features. |
int |
getLength()
Gets the value of length |
int |
getMaxBoundaries(int index)
Gets the value of maximum boundaries at specified index. |
int |
getMinBoundaries(int index)
Gets the value of minimum boundaries at specified index. |
int |
getPhases()
Gets the value of phases |
void |
setBoundaries(int[] boundaries)
Sets the value of boundaries. |
void |
setBoundaries(int index,
int newBoundaries)
Sets the value of boundaries at specified index. |
void |
setBoundaries(int index,
int newBoundaries,
int min,
int max)
Sets the value of boundaries at specified index. |
void |
setFeatures(int p,
int i,
Feature feature)
Sets the value of features. |
void |
setLength(int length)
Sets the value of length |
void |
setPhases(int phases)
Sets the value of phases |
int |
size()
Gets size of chromosome in total number of weight to be optimized. |
org.jgap.Chromosome |
toJgapChromosome(org.jgap.Configuration conf)
JGAP representation of chromosome. |
java.lang.String |
toString()
String representation of chromosome. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int length
protected int phases
protected Feature[][] features
protected int[] boundaries
protected int[] minBoundaries
protected int[] maxBoundaries
| Constructor Detail |
|---|
public Chromosome(int phases,
int length)
phases - phase number in game, usually 3 phases: opening, middle, endlength - number of features, usually 6 i.e.: flips, discs, mobility, xsquares, corners, pattern| Method Detail |
|---|
public int size()
public int getLength()
public void setLength(int length)
length - new value of lengthpublic int getPhases()
public void setPhases(int phases)
phases - new value of phases
public Feature getFeatures(int p,
int i)
p - phase numberi - index
public void setFeatures(int p,
int i,
Feature feature)
p - phase numberi - indexfeature - feature valuepublic int[] getBoundaries()
public void setBoundaries(int[] boundaries)
boundaries - new value of boundariespublic int getBoundaries(int index)
index -
public int getMinBoundaries(int index)
index -
public int getMaxBoundaries(int index)
index -
public void setBoundaries(int index,
int newBoundaries)
index - newBoundaries - new value of boundaries at specified index
public void setBoundaries(int index,
int newBoundaries,
int min,
int max)
index - newBoundaries - new value of boundaries at specified indexmin - minimum value of boundaries at specified indexmax - maximum value of boundaries at specified indexpublic java.lang.String toString()
toString in class java.lang.Object
public org.jgap.Chromosome toJgapChromosome(org.jgap.Configuration conf)
throws org.jgap.InvalidConfigurationException
conf - configuratoin of chromosome
org.jgap.InvalidConfigurationException
|
GeneThello Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||