#include <EGTPopulation.h>
Collaboration diagram for EGTPopulation< TG >:
Public Types | |
typedef TG | Graph |
typedef EGTVector< Graph * > | Graphs |
typedef Graphs::Iterator | GraphsIterator |
typedef Graphs::ConstIterator | GraphsConstIterator |
typedef EGTPopulation< Graph > | Self |
typedef EGTEvaluation< Graph > | Eval |
Public Methods | |
EGTPopulation () | |
Constructor. | |
EGTPopulation (const Self &) | |
Copy constructor. | |
virtual | ~EGTPopulation () |
Destructor. | |
void | InitPopulation (UInt n=0) |
Initializes this Population with the specified number of Graphs. | |
Float | GetFitnessAvg () const |
Returns the average of fitness values. | |
void | SavePopulation () const |
Saves the data of this Population. | |
bool | LoadPopulation () |
Loads the data of this Population. | |
void | Display (std::ostream &) const |
Outputs the data of this Population. | |
void | AssignGraphID () |
Assigns ID number to each Graph. | |
Graph * | GetGraph (UInt) |
Returns the Graph with the ID number. | |
const Graph * | GetGraph (UInt) const |
Returns the Graph with the ID number (const version). | |
Graph * | GetBestGraph () const |
Returns the Graph with the highest fitness value. | |
EGTVector< const Graph * > | GetGraphs () const |
Returns the array of Graphs. | |
void | AddGraph (Graph *pg) |
Adds the specified Graph to this Population. | |
UInt | GetNumGraphs () const |
Returns the number of Graphs included in this Population. | |
Protected Methods | |
void | CheckIndex (UInt uNum, char *filename, UInt uLine) const |
Checks whether the Graph with the specified ID number exists. If not exists, throws an exception. |
It is assumed that <TG> is a subclass of EGTGraph.
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructor.
|
|
Copy constructor.
|
|
Destructor.
|
|
Adds the specified Graph to this Population.
|
|
Assigns ID number to each Graph.
|
|
Checks whether the Graph with the specified ID number exists. If not exists, throws an exception.
|
|
Outputs the data of this Population.
|
|
Returns the Graph with the highest fitness value.
|
|
Returns the average of fitness values.
|
|
Returns the Graph with the ID number (const version).
|
|
Returns the Graph with the ID number.
|
|
Returns the array of Graphs.
|
|
Returns the number of Graphs included in this Population.
|
|
Initializes this Population with the specified number of Graphs.
|
|
Loads the data of this Population. The number of Graphs to be loaded is defined in the Environment.
|
|
Saves the data of this Population. Each individual is saved to a distinct file. |