org.jgap.eval
Class PopulationHistory
- java.lang.Object
-
- org.jgap.eval.PopulationHistory
-
- All Implemented Interfaces:
- java.io.Serializable
public class PopulationHistory extends java.lang.Object implements java.io.SerializableContainer for holding a given number of populations. Serves as a history object for later evaluation.- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PopulationHistory(int a_maxSize)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddPopulation(Population a_population)Adds a population to the history.booleanequals(java.lang.Object a_other)PopulationgetPopulation(int a_count)java.util.ListgetPopulations()voidremoveAllPopulations()voidsetPopulations(java.util.List a_populations)Sets the list of populations to the list provided.intsize()
-
-
-
Constructor Detail
-
PopulationHistory
public PopulationHistory(int a_maxSize)
Constructor.- Parameters:
a_maxSize- the maximum number of Population objects to hold, or zero if there is no limit.- Since:
- 2.0
-
-
Method Detail
-
getPopulation
public Population getPopulation(int a_count)
-
addPopulation
public void addPopulation(Population a_population)
Adds a population to the history. If the maximum size of this container is exceeded, then the population added earliest is removed.- Parameters:
a_population- the population to be added- Since:
- 2.0
-
removeAllPopulations
public void removeAllPopulations()
- Since:
- 2.0
-
size
public int size()
-
getPopulations
public java.util.List getPopulations()
-
setPopulations
public void setPopulations(java.util.List a_populations)
Sets the list of populations to the list provided.- Parameters:
a_populations- list of populations to be set- Since:
- 2.0
-
equals
public boolean equals(java.lang.Object a_other)
- Overrides:
equalsin classjava.lang.Object- Parameters:
a_other- other object to compare to- Returns:
- true other object seen as equal
- Since:
- 3.5
-
-
DMelt 3.0 © DataMelt by jWork.ORG