#include <EGTGraph.h>
Collaboration diagram for EGTGraph< TSG, TF >:
Public Types | |
typedef TSG | SubGraph |
typedef EGTVector< TSG * > | SubGraphs |
typedef SubGraphs::Iterator | SubGraphsIterator |
typedef SubGraphs::ConstIterator | SubGraphsConstIterator |
typedef TF | Fitness |
typedef SubGraph::Node | Node |
typedef EGTVector< Node * > | Nodes |
typedef Nodes::Iterator | NodesIterator |
typedef Nodes::ConstIterator | NodesConstIterator |
typedef EGTGraph< TSG, TF > | Self |
Public Methods | |
EGTGraph () | |
Default constructor. | |
EGTGraph (const Self &) | |
Copy constructor. | |
virtual | ~EGTGraph () |
Destructor. | |
virtual bool | InitGraph () |
Initializes this Graph. | |
virtual bool | InitGraph (const SubGraph &) |
Initializes this Graph by using the SubGraph. | |
virtual bool | InitGraph (const SubGraph &, const SubGraph &, UInt ope=0) |
Initializes this Graph by using the two SubGraphs. | |
virtual bool | LoadGraph (const char *pFileName) |
Loads the data of this Graph. | |
virtual void | SaveGraph (std::ostream &) const |
Saves the data of this Graph. | |
virtual void | Display (std::ostream &) const |
Outputs the data of this Graph. | |
virtual void | DisplayDot (std::ostream &) const |
Outputs the data of this Graph in Dot file format. | |
SubGraph * | CreateComplementarySubGraph (UInt uNum, UInt uMax=0) const |
Generates the complement of the SubGraph. | |
SubGraph * | GetSubGraph (UInt) |
Returns the SubGraph with the ID number. | |
const SubGraph * | GetSubGraph (UInt) const |
Returns the SubGraph with the ID number. | |
const SubGraph * | GetSubGraph (const SubGraph &, UInt *) const |
Returns a compatible SubGraph with the SubGraph. | |
UInt | GetNumSubGraphs () const |
Returns the number of SubGraphs. | |
bool | GetEvaluated () const |
Checks the flag indicating whether this Graph has been already evaluated. | |
void | SetEvaluated (bool ret) |
Sets the flag indicating whether this Graph has been already evaluated. | |
UInt | GetGraphID () const |
Returns the ID number of this Graph. | |
void | SetGraphID (UInt ret) |
Sets the ID number of this Graph. | |
UInt | GetNumNodes () const |
Returns the number of nodes included in this Graph. | |
const Node * | GetNode (UInt uNodeID) const |
Returns the Node with the specified Node ID number (const version). | |
Node * | GetNode (UInt uNodeID) |
Returns the Node with the specified Node ID number. | |
Float | GetFitness () const |
Returns the fitness value of this Graph. | |
void | DisplayFitness (std::ostream &, bool) const |
Outputs the data of this Graph. | |
UInt | GetOperator () const |
void | SetOperator (UInt n) |
UInt | GetMother () const |
void | SetMother (UInt n) |
UInt | GetFather () const |
void | SetFather (UInt n) |
void | SetOrigin (UInt n) |
Static Public Attributes | |
Node * | m_tCreator = 0 |
Protected Types | |
enum | { POWERSET_LIMIT = 6 } |
Protected Methods | |
void | CreateSubGraphs () const |
Generates a set of SubGraphs. | |
void | CreateSubGraphsPowerSet () const |
Generates all the possible SubGraphs. | |
void | CreateSubGraphsRandomly () const |
Generates a specified number of SubGraphs randomly. | |
SubGraph * | CreateSubGraph () const |
Generates a SubGraph. | |
SubGraph * | CreateSubGraphConstraint () const |
Generates a specified number of connected SubGraphs randomly. | |
bool | IsConnected (Nodes nodes) const |
Checks whether each node in the specified array is connected to every other node. | |
Nodes | GetCandidates () const |
Returns the array of Nodes available for constructing SubGraphs. | |
void | CreatePowerSet (UInt) const |
Generates the power set of the set of integer from 0 to "to"-1. @@. | |
void | ClearSubGraphs () |
Deletes all the SubGraphs held in this Graph. | |
void | AssignNodeID () |
Assigns Node ID number to each Node. | |
bool | IsSubGraphRegistered (const SubGraph &) const |
Checks whether the newly generated SubGraph has been already registered. | |
Protected Attributes | |
UInt | m_uGraphID |
Graph ID number. | |
Nodes | m_tNodes |
Array of Nodes. | |
Fitness | m_tFitness |
Fitness of this Graph. | |
bool | m_bEvaluated |
Flag indicating whether this Graph has been already evaluated. | |
SubGraphs | m_tSubGraphs |
Array of SubGraphs. | |
Static Protected Attributes | |
EGTVector< EGTVector< UInt > > | m_tPowerSet |
Table for creating a list of SubGraphs. | |
bool | m_bConstraint = false |
Flag indicating whether all the SubGraphs held in this Graph are limited to connected ones. @. |
It is assumed that <TSG> is a subclass of EGTSubGraph,
and <TF> is a subclass of EGFitness.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If the number of the Nodes derived from GetCandidate() function is equal to or smaller than this value, all the possible SubGraphs will be generated. |
|
Default constructor.
|
|
Copy constructor.
|
|
Destructor.
|
|
Assigns Node ID number to each Node.
|
|
Deletes all the SubGraphs held in this Graph.
|
|
Generates the complement of the SubGraph.
|
|
Generates the power set of the set of integer from 0 to "to"-1. @@.
|
|
Generates a SubGraph. Generates a SubGraph using a set of randomly-selected Nodes. The set of Nodes is derived from GetCandidates() function.
|
|
Generates a specified number of connected SubGraphs randomly.
|
|
Generates a set of SubGraphs.
Generation algorithm is chosen according to the number of Nodes. |
|
Generates all the possible SubGraphs.
|
|
Generates a specified number of SubGraphs randomly.
|
|
Outputs the data of this Graph.
|
|
Outputs the data of this Graph in Dot file format.
|
|
Outputs the data of this Graph.
|
|
Returns the array of Nodes available for constructing SubGraphs.
|
|
Checks the flag indicating whether this Graph has been already evaluated.
|
|
|
|
Returns the fitness value of this Graph.
|
|
Returns the ID number of this Graph.
|
|
|
|
Returns the Node with the specified Node ID number.
|
|
Returns the Node with the specified Node ID number (const version).
|
|
Returns the number of nodes included in this Graph.
|
|
Returns the number of SubGraphs.
|
|
|
|
Returns a compatible SubGraph with the SubGraph.
|
|
Returns the SubGraph with the ID number.
|
|
Returns the SubGraph with the ID number.
|
|
Initializes this Graph by using the two SubGraphs.
|
|
Initializes this Graph by using the SubGraph.
|
|
Initializes this Graph.
|
|
Checks whether each node in the specified array is connected to every other node.
|
|
Checks whether the newly generated SubGraph has been already registered.
|
|
Loads the data of this Graph.
|
|
Saves the data of this Graph.
|
|
Sets the flag indicating whether this Graph has been already evaluated.
|
|
|
|
Sets the ID number of this Graph.
|
|
|
|
|
|
|
|
Flag indicating whether all the SubGraphs held in this Graph are limited to connected ones. @. @ |
|
Flag indicating whether this Graph has been already evaluated.
|
|
|
|
Fitness of this Graph.
|
|
Array of Nodes.
|
|
Table for creating a list of SubGraphs.
|
|
Array of SubGraphs.
|
|
Graph ID number.
|