|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.openai.ai.ga.world.World
World contains all the information necessary to simulate a complete genetic algorithm implementation. This includes:
One iteration performs the following operations:
Constructor Summary | |
World(java.lang.String name)
Reset generation count and create an empty Population and no
selection algorithms. |
|
World(java.lang.String name,
ArraySelectionAlgorithm parentSelection,
SelectionAlgorithm mutationSelection,
SelectionAlgorithm survivalSelection)
Reset generation count and create an empty population and specified selection algorithms. |
|
World(java.lang.String name,
Population initialPopulation)
Reset generation count, use the specified Population , and
initialize no selection algorithms. |
|
World(java.lang.String name,
Population initialPopulation,
ArraySelectionAlgorithm parentSelection,
SelectionAlgorithm mutationSelection,
SelectionAlgorithm survivalSelection)
Reset generation count and create an empty population and specified selection algorithms. |
Method Summary | |
Environment |
getEnvironment()
Returns the Environment assigned to this World. |
SelectionAlgorithm |
getMutationSelectionAlgorithm()
Returns the current mutation selection algorithm. |
java.lang.String |
getName()
Returns the name of this World. |
ArraySelectionAlgorithm |
getParentSelectionAlgorithm()
Returns the current parent selection algorithm. |
Population |
getPopulation()
Returns the Population assigned to this World. |
SelectionAlgorithm |
getSurvivalSelectionAlgorithm()
Returns the current survival selection algorithm. |
void |
iterate()
Iterates this World through one generation. |
void |
setEnvironment(Environment newEnvironment)
Sets the Environment used in this World. |
void |
setMutationSelectionAlgorithm(SelectionAlgorithm mutationSelection)
Sets the mutation selection algorithm to the given algorithm. |
void |
setParentSelectionAlgorithm(ArraySelectionAlgorithm parentSelection)
Sets the parent selection algorithm to the given algorithm. |
void |
setPopulation(Population newPopulation)
Sets the Population used in this World. |
void |
setSurvivalSelectionAlgorithm(SelectionAlgorithm survivalSelection)
Sets the survival selection algorithm to the given algorithm. |
java.lang.String |
toString()
Returns a string showing the current status of this World. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public World(java.lang.String name)
Population
and no
selection algorithms. Gives the world a name.
name
- a String
for the name of this Worldpublic World(java.lang.String name, Population initialPopulation)
Population
, and
initialize no selection algorithms.
name
- a String
for the name of this WorldinitialPopulation
- the inital Population
for this Worldpublic World(java.lang.String name, ArraySelectionAlgorithm parentSelection, SelectionAlgorithm mutationSelection, SelectionAlgorithm survivalSelection)
name
- a String
for the name of this WorldparentSelection
- an ArraySelectionAlgorithm
to be used for parent selection.mutationSelection
- a SelectionAlgorithm
to be used for mutation selection.survivalSelection
- a SelectionAlgorithm
to be used for survival selection.public World(java.lang.String name, Population initialPopulation, ArraySelectionAlgorithm parentSelection, SelectionAlgorithm mutationSelection, SelectionAlgorithm survivalSelection)
name
- a String
for the name of this WorldinitialPopulation
- the inital Population
for this WorldparentSelection
- an ArraySelectionAlgorithm
to be used for parent selection.mutationSelection
- a SelectionAlgorithm
to be used for mutation selection.survivalSelection
- a SelectionAlgorithm
to be used for survival selection.Method Detail |
public java.lang.String getName()
String
containing the name of this Worldpublic java.lang.String toString()
toString
in class java.lang.Object
String
showing the status of this Worldpublic Environment getEnvironment()
Environment
assigned to this Worldpublic void setEnvironment(Environment newEnvironment)
newEnvironment
- the Environment
to use in this Worldpublic Population getPopulation()
Population
assigned to this Worldpublic void setPopulation(Population newPopulation)
newPopulation
- the Population
to use in this Worldpublic void iterate()
public void setParentSelectionAlgorithm(ArraySelectionAlgorithm parentSelection)
parentSelection
- a ArraySelectionAlgorithm
to set topublic ArraySelectionAlgorithm getParentSelectionAlgorithm()
ArraySelectionAlgorithm
public void setMutationSelectionAlgorithm(SelectionAlgorithm mutationSelection)
mutationSelection
- a SelectionAlgorithm
to set topublic SelectionAlgorithm getMutationSelectionAlgorithm()
SelectionAlgorithm
public void setSurvivalSelectionAlgorithm(SelectionAlgorithm survivalSelection)
survivalSelection
- a SelectionAlgorithm
to set topublic SelectionAlgorithm getSurvivalSelectionAlgorithm()
SelectionAlgorithm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |