wodka.ga
Class GeneticAlgorithm
java.lang.Object
wodka.ga.GeneticAlgorithm
- All Implemented Interfaces:
- CategorizedInfoModel, wwan.commons.param.Configurable, wwan.commons.param.Informative, RacerListener, java.io.Serializable, StreamPersistable
- public class GeneticAlgorithm
- extends java.lang.Object
- implements StreamPersistable, RacerListener, wwan.commons.param.Configurable, CategorizedInfoModel
Implementation of the genetic algorithm.
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
GeneticAlgorithm
public GeneticAlgorithm()
evaluateOneGeneration
public void evaluateOneGeneration()
throws WodkaException
- Throws:
WodkaException
isCalcTimeoutOptimized
public boolean isCalcTimeoutOptimized()
setCalcTimeoutOptimized
public void setCalcTimeoutOptimized(boolean calcTimeoutOptimized)
getPopCount
public int getPopCount()
getPrevMaxFit
public int getPrevMaxFit()
getPrevMaxFitSoda
public double getPrevMaxFitSoda()
getFitFunc
public FitnessFunction getFitFunc()
setFitFunc
public void setFitFunc(FitnessFunction fitFunc)
getPopulation
public Population getPopulation()
getPopHist
public PopulationHistory getPopHist()
getRacer
public Racer getRacer()
setRacer
public void setRacer(Racer racer)
setHandler
public void setHandler(ExceptionHandler handler)
getGenoDesc
public GenotypeDesc getGenoDesc()
setGenoDesc
public void setGenoDesc(GenotypeDesc gDesc)
throws WodkaException
- Throws:
WodkaException
setMutationRate
public void setMutationRate(double mutationRate)
getMutationRate
public double getMutationRate()
getSelPolicy
public SelectionPolicy getSelPolicy()
setSelPolicy
public void setSelPolicy(SelectionPolicy policy)
finishedAllRace
public void finishedAllRace()
- Specified by:
finishedAllRace in interface RacerListener
finishedRace
public void finishedRace(int racerFitness,
int identifier)
- Specified by:
finishedRace in interface RacerListener
createNextPopulation
public void createNextPopulation()
toStream
public void toStream(java.io.DataOutputStream outStream)
throws java.io.IOException
- Specified by:
toStream in interface StreamPersistable
- Throws:
java.io.IOException
fromStream
public void fromStream(java.io.DataInputStream inStream,
int version)
throws java.io.IOException
- Specified by:
fromStream in interface StreamPersistable
- Throws:
java.io.IOException
getVersion
public int getVersion()
- Specified by:
getVersion in interface StreamPersistable
stop
public void stop()
isChanged
public boolean isChanged()
setChanged
public void setChanged(boolean changed)
getLabel
public java.lang.String getLabel()
- Specified by:
getLabel in interface wwan.commons.param.Informative
setLabel
public void setLabel(java.lang.String name)
getParameterDescription
public wwan.commons.param.ListParamDesc getParameterDescription()
throws wwan.commons.param.ParamException
- Specified by:
getParameterDescription in interface wwan.commons.param.Configurable
- Throws:
wwan.commons.param.ParamException
setFieldsFromParameterList
public void setFieldsFromParameterList(wwan.commons.param.ListParam listParam)
throws wwan.commons.param.ParamException
- Specified by:
setFieldsFromParameterList in interface wwan.commons.param.Configurable
- Throws:
wwan.commons.param.ParamException
setParameterListFromFields
public void setParameterListFromFields(wwan.commons.param.ListParam param)
throws wwan.commons.param.ParamException
- Specified by:
setParameterListFromFields in interface wwan.commons.param.Configurable
- Throws:
wwan.commons.param.ParamException
getInfo
public java.lang.String getInfo()
- Specified by:
getInfo in interface wwan.commons.param.Informative
checkParameterList
public void checkParameterList(wwan.commons.param.ListParam listParam)
throws wwan.commons.param.ParamException
- Specified by:
checkParameterList in interface wwan.commons.param.Configurable
- Throws:
wwan.commons.param.ParamException
setPopHist
public void setPopHist(PopulationHistory popHist)
setPopCount
public void setPopCount(int popCount)
setPopulation
public void setPopulation(Population population)
setTerrManager
public void setTerrManager(TerrainManager terrManager)
getTerrManager
public TerrainManager getTerrManager()
resetTimeoutOptimization
public void resetTimeoutOptimization()
categoryCount
public int categoryCount()
- Specified by:
categoryCount in interface CategorizedInfoModel
getCategoryInfo
public java.lang.String getCategoryInfo(int index)
- Specified by:
getCategoryInfo in interface CategorizedInfoModel
getCategoryName
public java.lang.String getCategoryName(int index)
- Specified by:
getCategoryName in interface CategorizedInfoModel
toString
public java.lang.String toString()