![]() |
vrpRouting
0.3
|
The TabuList class defines the tabu list to be used in optimization. More...
#include "tabu_list.h"
Public Types | |
typedef std::deque< Move >::const_iterator | const_iterator |
iterator type that does not allows modification More... | |
typedef std::deque< Move >::iterator | iterator |
iterator type that allows modification More... | |
Public Member Functions | |
void | add (const Move &m) |
Make a move "tabu" by adding it to the tabu list. More... | |
void | add_infeasible (const std::string &candidate) |
Adds a move candidate to the infeasible list. More... | |
void | add_seen (const std::string &candidate) |
Adds a move candidate to the seen list. More... | |
const_iterator | begin () const |
Constant iterator pointing to the first element of the tabu list. More... | |
void | clear () |
removes all moves from the tabu list More... | |
const_iterator | end () const |
Constant iteratori pointing to the last element of the tabu list. More... | |
bool | has_infeasible (const std::string &candidate) |
Checks to see if a move candidate is infeasible (in the infeasible list) More... | |
bool | has_move (const problem::Vehicle_pickDeliver &, const problem::Vehicle_pickDeliver &, const problem::Order &from_order, double obj1, double obj2) const |
Checks to see if a "move" move is "tabu" (in the tabu list) More... | |
bool | has_seen (const std::string &candidate) |
Checks to see if a move candidate has already been done before (in the seen list) More... | |
bool | has_swap (const problem::Vehicle_pickDeliver &, const problem::Vehicle_pickDeliver &, const problem::Order &, const problem::Order &, double obj1, double obj2) const |
Checks to see if a "swap" move is "tabu" (in the tabu list) More... | |
bool | is_empty () const |
returns true if the tabu list is empty More... | |
size_t | max_length () const |
returns the maximum length (tabu_length) of the tabu list More... | |
void | set_max_length (size_t length) |
sets the maximum length (tabu_length) of the tabu list More... | |
size_t | size () const |
returns the current length (number of moves) in the tabu list More... | |
Private Member Functions | |
bool | has (const Move &) const |
Checks to see if a (general) move is "tabu" (in the tabu list) More... | |
Private Attributes | |
std::set< std::string > | m_infeasible_list |
the infeasible list More... | |
size_t | m_max_length |
the maximum length (tabu_length) of the tabu list More... | |
std::set< std::string > | m_seen_list |
the seen list More... | |
std::deque< Move > | m_tabu_list |
the tabu list More... | |
Friends | |
std::ostream & | operator<< (std::ostream &, const TabuList &) |
priting function More... | |
The TabuList class defines the tabu list to be used in optimization.
Definition at line 45 of file tabu_list.h.
typedef std::deque<Move>::const_iterator vrprouting::optimizers::tabu::TabuList::const_iterator |
iterator type that does not allows modification
Definition at line 51 of file tabu_list.h.
typedef std::deque<Move>::iterator vrprouting::optimizers::tabu::TabuList::iterator |
iterator type that allows modification
Definition at line 48 of file tabu_list.h.
void vrprouting::optimizers::tabu::TabuList::add | ( | const Move & | m | ) |
Make a move "tabu" by adding it to the tabu list.
[in] | m | the move |
Definition at line 42 of file tabu_list.cpp.
References has(), m_tabu_list, max_length(), and size().
Referenced by vrprouting::optimizers::tabu::Optimize::single_pair_insertion(), and vrprouting::optimizers::tabu::Optimize::swap_between_routes().
void vrprouting::optimizers::tabu::TabuList::add_infeasible | ( | const std::string & | candidate | ) |
Adds a move candidate to the infeasible list.
Definition at line 154 of file tabu_list.cpp.
References m_infeasible_list.
Referenced by vrprouting::optimizers::tabu::Optimize::single_pair_insertion(), and vrprouting::optimizers::tabu::Optimize::swap_between_routes().
void vrprouting::optimizers::tabu::TabuList::add_seen | ( | const std::string & | candidate | ) |
Adds a move candidate to the seen list.
Definition at line 162 of file tabu_list.cpp.
References m_seen_list.
Referenced by vrprouting::optimizers::tabu::Optimize::single_pair_insertion(), and vrprouting::optimizers::tabu::Optimize::swap_between_routes().
|
inline |
Constant iterator pointing to the first element of the tabu list.
Definition at line 86 of file tabu_list.h.
References m_tabu_list.
void vrprouting::optimizers::tabu::TabuList::clear | ( | ) |
removes all moves from the tabu list
Definition at line 50 of file tabu_list.cpp.
References m_tabu_list.
Referenced by vrprouting::optimizers::tabu::Optimize::move_2_real().
|
inline |
Constant iteratori pointing to the last element of the tabu list.
Definition at line 89 of file tabu_list.h.
References m_tabu_list.
|
private |
Checks to see if a (general) move is "tabu" (in the tabu list)
[in] | m | move searched for |
Definition at line 59 of file tabu_list.cpp.
References m_tabu_list.
Referenced by add(), has_move(), and has_swap().
bool vrprouting::optimizers::tabu::TabuList::has_infeasible | ( | const std::string & | candidate | ) |
Checks to see if a move candidate is infeasible (in the infeasible list)
Definition at line 150 of file tabu_list.cpp.
References m_infeasible_list.
Referenced by vrprouting::optimizers::tabu::Optimize::single_pair_insertion(), and vrprouting::optimizers::tabu::Optimize::swap_between_routes().
bool vrprouting::optimizers::tabu::TabuList::has_move | ( | const problem::Vehicle_pickDeliver & | from_vehicle, |
const problem::Vehicle_pickDeliver & | to_vehicle, | ||
const problem::Order & | order, | ||
double | obj1, | ||
double | obj2 | ||
) | const |
Checks to see if a "move" move is "tabu" (in the tabu list)
[in] | from_vehicle | First vehicle of the move |
[in] | to_vehicle | Second vehicle of the move |
[in] | order | order involved on the move |
[in] | obj1 | |
[in] | obj2 |
Definition at line 73 of file tabu_list.cpp.
References has().
Referenced by vrprouting::optimizers::tabu::Optimize::single_pair_insertion().
bool vrprouting::optimizers::tabu::TabuList::has_seen | ( | const std::string & | candidate | ) |
Checks to see if a move candidate has already been done before (in the seen list)
Definition at line 158 of file tabu_list.cpp.
References m_seen_list.
Referenced by vrprouting::optimizers::tabu::Optimize::single_pair_insertion(), and vrprouting::optimizers::tabu::Optimize::swap_between_routes().
bool vrprouting::optimizers::tabu::TabuList::has_swap | ( | const problem::Vehicle_pickDeliver & | from_vehicle, |
const problem::Vehicle_pickDeliver & | to_vehicle, | ||
const problem::Order & | from_order, | ||
const problem::Order & | to_order, | ||
double | obj1, | ||
double | obj2 | ||
) | const |
Checks to see if a "swap" move is "tabu" (in the tabu list)
[in] | from_vehicle | First vehicle of the move |
[in] | to_vehicle | Second vehicle of the move |
[in] | from_order | involved on the swap move |
[in] | to_order | involved on the swap move |
[in] | obj1 | |
[in] | obj2 |
Definition at line 91 of file tabu_list.cpp.
References has().
Referenced by vrprouting::optimizers::tabu::Optimize::swap_between_routes().
bool vrprouting::optimizers::tabu::TabuList::is_empty | ( | ) | const |
returns true if the tabu list is empty
Definition at line 108 of file tabu_list.cpp.
References m_tabu_list.
size_t vrprouting::optimizers::tabu::TabuList::max_length | ( | ) | const |
returns the maximum length (tabu_length) of the tabu list
Definition at line 124 of file tabu_list.cpp.
References m_max_length.
Referenced by add().
void vrprouting::optimizers::tabu::TabuList::set_max_length | ( | size_t | length | ) |
sets the maximum length (tabu_length) of the tabu list
[in] | length |
Definition at line 131 of file tabu_list.cpp.
References m_max_length.
Referenced by vrprouting::optimizers::tabu::Optimize::set_tabu_list_length().
size_t vrprouting::optimizers::tabu::TabuList::size | ( | ) | const |
returns the current length (number of moves) in the tabu list
Definition at line 116 of file tabu_list.cpp.
References m_tabu_list.
Referenced by add(), and vrprouting::optimizers::tabu::operator<<().
|
friend |
priting function
[in,out] | log | where the print takes place |
[in] | list | The tabu list to be printed |
Definition at line 140 of file tabu_list.cpp.
|
private |
the infeasible list
Definition at line 114 of file tabu_list.h.
Referenced by add_infeasible(), and has_infeasible().
|
private |
the maximum length (tabu_length) of the tabu list
Definition at line 108 of file tabu_list.h.
Referenced by max_length(), and set_max_length().
|
private |
|
private |
the tabu list
Definition at line 111 of file tabu_list.h.
Referenced by add(), begin(), clear(), end(), has(), is_empty(), and size().