METSlib 0.5
mets::swap_elements Class Reference

A mets::mana_move that swaps two elements in a mets::permutation_problem. More...

#include <model.hh>

Inheritance diagram for mets::swap_elements:
Inheritance graph
Collaboration diagram for mets::swap_elements:
Collaboration graph

Public Member Functions

 swap_elements (int from, int to)
 A move that swaps from and to.
 
gol_type evaluate (const mets::feasible_solution &s) const
 Virtual method that applies the move on a point.
 
void apply (mets::feasible_solution &s) const
 Virtual method that applies the move on a point.
 
clonableclone () const
 Clones this move (so that the tabu list can store it)
 
size_t hash () const
 An hash function used by the tabu list (the hash value is used to insert the move in an hash set).
 
bool operator== (const mets::mana_move &o) const
 Comparison operator used to tell if this move is equal to a move in the simple tabu list move set.
 
void change (int from, int to)
 Modify this swap move.
 
- Public Member Functions inherited from mets::mana_move
virtual mana_moveopposite_of () const
 Create and return a new move that is the reverse of this one.
 

Protected Attributes

int p1
 the first element to swap
 
int p2
 the second element to swap
 

Friends

template<typename>
class swap_neighborhood
 

Detailed Description

A mets::mana_move that swaps two elements in a mets::permutation_problem.

Each instance swaps two specific objects.

See also
mets::permutation_problem, mets::mana_move

Member Function Documentation

◆ apply()

void mets::swap_elements::apply ( mets::feasible_solution & s) const
inlinevirtual

Virtual method that applies the move on a point.

Implements mets::move.

◆ clone()

clonable * mets::swap_elements::clone ( ) const
inlinevirtual

Clones this move (so that the tabu list can store it)

Implements mets::clonable.

◆ evaluate()

gol_type mets::swap_elements::evaluate ( const mets::feasible_solution & s) const
inlinevirtual

Virtual method that applies the move on a point.

Implements mets::move.

◆ hash()

size_t mets::swap_elements::hash ( ) const
inlinevirtual

An hash function used by the tabu list (the hash value is used to insert the move in an hash set).

Implements mets::hashable.

◆ operator==()

bool mets::swap_elements::operator== ( const mets::mana_move & o) const
inlinevirtual

Comparison operator used to tell if this move is equal to a move in the simple tabu list move set.

Implements mets::mana_move.


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

Return to METSlib home page