eoVRPEdgeCrossover Class Reference

Implementation of the classic Edge Crossover from the TSP. More...

#include <eoVRPQuadCrossover.h>

Inheritance diagram for eoVRPEdgeCrossover:

eoQuadOp< eoVRP > eoOp< EOType > eoBF< eoVRP &, eoVRP &, bool > eoFunctorBase List of all members.

Public Member Functions

 eoVRPEdgeCrossover ()
 Deafult constructor.
std::string className () const
 Returns a string containing the name of the class.
bool operator() (eoVRP &_genotype1, eoVRP &_genotype2)
 Both parameters are the parents and the (future) children of the crossover.

Private Member Functions

bool EdgeCrossover (eoVRP &_genotype1, eoVRP &_genotype2, eoVRP &_child)
 Actually performs the edge crossover.
void remove_entry (unsigned _vertex, std::vector< std::set< unsigned > > &_map)
 Removes a vertex from all his neighbours.
void add_vertex (unsigned _vertex, std::vector< bool > &_visited, std::vector< std::set< unsigned > > &_map, eoVRP &_child)
 Adds a vertex to a child and erases it from the list of available vertices.

Detailed Description

Implementation of the classic Edge Crossover from the TSP.

Definition at line 240 of file eoVRPQuadCrossover.h.


Member Function Documentation

std::string eoVRPEdgeCrossover::className ( void   )  const [inline, virtual]

Returns a string containing the name of the class.

Used to display statistics.

Returns:
The string containing the name of the class.

Reimplemented from eoQuadOp< eoVRP >.

Definition at line 258 of file eoVRPQuadCrossover.h.

bool eoVRPEdgeCrossover::operator() ( eoVRP _genotype1,
eoVRP _genotype2 
) [inline, virtual]

Both parameters are the parents and the (future) children of the crossover.

Parameters:
_genotype1 The first parent.
_genotype2 The second parent.
Returns:
True if any of the parents was modified. False otherwise.

Implements eoBF< eoVRP &, eoVRP &, bool >.

Definition at line 272 of file eoVRPQuadCrossover.h.

References eoVRP::clean(), and EdgeCrossover().

bool eoVRPEdgeCrossover::EdgeCrossover ( eoVRP _genotype1,
eoVRP _genotype2,
eoVRP _child 
) [inline, private]

Actually performs the edge crossover.

Parameters:
_genotype1 First parent.
_genotype2 Second parent.
_child Child.
Returns:
True if the second parent was modified. False otherwise.

Definition at line 301 of file eoVRPQuadCrossover.h.

References add_vertex(), and eoRng::random().

Referenced by operator()().

void eoVRPEdgeCrossover::remove_entry ( unsigned  _vertex,
std::vector< std::set< unsigned > > &  _map 
) [inline, private]

Removes a vertex from all his neighbours.

Parameters:
_vertex The vertex being erased.
_map The structure containing the neighbourhood relationship.

Definition at line 380 of file eoVRPQuadCrossover.h.

Referenced by add_vertex().

void eoVRPEdgeCrossover::add_vertex ( unsigned  _vertex,
std::vector< bool > &  _visited,
std::vector< std::set< unsigned > > &  _map,
eoVRP _child 
) [inline, private]

Adds a vertex to a child and erases it from the list of available vertices.

Parameters:
_vertex The vertex being added to the child.
_visited The vector of visited vertices.
_map The structure containing the neighbourhood relationship.
_child The child where we add the vertex.

Definition at line 398 of file eoVRPQuadCrossover.h.

References remove_entry().

Referenced by EdgeCrossover().


The documentation for this class was generated from the following file:
Generated on Fri Dec 7 16:57:19 2007 for CVRP-TW by  doxygen 1.4.7