METSlib 0.5
Public Member Functions | Protected Attributes | List of all members
mets::invert_subsequence Class Reference

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

#include <model.hh>

Inheritance diagram for mets::invert_subsequence:
Inheritance graph
Collaboration diagram for mets::invert_subsequence:
Collaboration graph

Public Member Functions

 invert_subsequence (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. More...
 
void apply (mets::feasible_solution &s) const
 Virtual method that applies the move on a point. More...
 
clonableclone () const
 
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). More...
 
bool operator== (const mets::mana_move &o) const
 Comparison operator used to tell if this move is equal to a move in the tabu list. More...
 
void change (int from, int to)
 
- 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. More...
 
virtual bool operator== (const mana_move &other) const =0
 Tell if this move equals another w.r.t. the tabu list management (for mets::simple_tabu_list) More...
 
virtual gol_type evaluate (const feasible_solution &sol) const =0
 Evaluate the cost after the move. More...
 
virtual void apply (feasible_solution &sol) const =0
 Operates this move on sol. More...
 
virtual clonableclone () const =0
 
virtual size_t hash () const =0
 

Protected Attributes

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

Detailed Description

A mets::mana_move that swaps a subsequence of elements in a mets::permutation_problem.

See also
mets::permutation_problem, mets::mana_move

Member Function Documentation

◆ apply()

void mets::invert_subsequence::apply ( mets::feasible_solution s) const
inlinevirtual

Virtual method that applies the move on a point.

Implements mets::move.

◆ clone()

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

Implements mets::clonable.

◆ evaluate()

mets::gol_type mets::invert_subsequence::evaluate ( const mets::feasible_solution s) const
inlinevirtual

Virtual method that applies the move on a point.

Implements mets::move.

◆ hash()

size_t mets::invert_subsequence::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::invert_subsequence::operator== ( const mets::mana_move o) const
inlinevirtual

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

Implements mets::mana_move.


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

Return to METSlib home page