- Main Page
- Namespaces
- Classes
- Files

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# eoVRPMutation Class Reference

Implementation of variations of the four mutation operators for the VRP-TW defined by Tavares et al. More...

`#include <eoVRPMutation.h>`

Inheritance diagram for eoVRPMutation:

List of all members.

## Public Member Functions
| eoVRPMutation ()
| Default constructor: nothing to do here.
std::string | className () const
| Returns a string containing the name of the class.
bool | operator() (eoVRP &_genotype)
| Functor operator.
## Private Member Functions
bool | swapMutation (eoVRP &_genotype)
| It exhanges the positions of two clients within the individual.
bool | inversionMutation (eoVRP &_genotype)
| It selects two positions in the genotype and inverts the clients between them.
bool | insertionMutation (eoVRP &_genotype)
| It selects and individual, erases it from its original position and inserts it somewhere else.
bool | DisplacementMutation (eoVRP &_genotype)
| It selects a set of clients, erases them from their original position and inserts them somewhere else.

## Detailed Description

Implementation of variations of the four mutation operators for the VRP-TW defined by Tavares et al.

These four operators should be separated in different classes and their probabilities made parameterizable.

Definition at line 52 of file eoVRPMutation.h.

## Member Function Documentation

std::string eoVRPMutation::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 eoMonOp< eoVRP >.

Definition at line 70 of file eoVRPMutation.h.

bool eoVRPMutation::operator() | ( | eoVRP & | _genotype | ) | `[inline, virtual]`

Functor operator.

Applies one of the four mutation operators available, each of them with a predefined (hard-coded) probability. These operators should be separated in different classes and their probabilities made parameterizable to do it in a more "paradisEO" way.

Parameters:

  | _genotype | The genotype being mutated (it will be probably modified).

Returns:
  True if the individual has been modified. False otherwise.

Implements eoUF< eoVRP &, bool >.

Definition at line 86 of file eoVRPMutation.h.

References eoVRP::cleanRoutes(), DisplacementMutation(), insertionMutation(), inversionMutation(), swapMutation(), and eoRng::uniform().

bool eoVRPMutation::swapMutation | ( | eoVRP & | _genotype | ) | `[inline, private]`

It exhanges the positions of two clients within the individual.

Clients may or may not be in the same route.

Parameters:

  | _genotype | The genotype being mutated (it will be probably modified).

Returns:
  True if the individual has been modified. False otherwise.

Definition at line 119 of file eoVRPMutation.h.

References eoRng::random().

Referenced by operator()().

bool eoVRPMutation::inversionMutation | ( | eoVRP & | _genotype | ) | `[inline, private]`

It selects two positions in the genotype and inverts the clients between them.

Clients may or may not be in the same route.

Parameters:

  | _genotype | The genotype being mutated (it will be probably modified).

Returns:
  True if the individual has been modified. False otherwise.

Definition at line 142 of file eoVRPMutation.h.

References eoRng::random().

Referenced by operator()().

bool eoVRPMutation::insertionMutation | ( | eoVRP & | _genotype | ) | `[inline, private]`

It selects and individual, erases it from its original position and inserts it somewhere else.

The insertion may or may not be within the same route.

Parameters:

  | _genotype | The genotype being mutated (it will be probably modified).

Returns:
  True if the individual has been modified. False otherwise.

Definition at line 170 of file eoVRPMutation.h.

References eoRng::random().

Referenced by operator()().

bool eoVRPMutation::DisplacementMutation | ( | eoVRP & | _genotype | ) | `[inline, private]`

It selects a set of clients, erases them from their original position and inserts them somewhere else.

The selected set of clients may cover different routes.

Parameters:

  | _genotype | The genotype being mutated (it will be probably modified).

Returns:
  True if the individual has been modified. False otherwise.

Definition at line 199 of file eoVRPMutation.h.

References eoRng::random().

Referenced by operator()().

The documentation for this class was generated from the following file:

- eoVRPMutation.h