![]() |
vrpRouting
0.3
|
#include "tabu.h"
Public Member Functions | |
Initial_solution ()=delete | |
Initial solution without information is not valid. More... | |
Initial_solution (TTimestamp, bool, problem::PickDeliver *) | |
Creating a complete initial solution. More... | |
std::tuple< int, int, size_t, TInterval, TInterval, TInterval > | cost () const |
Get all statistics in one cycle. More... | |
std::string | cost_str () const |
int | cvTot () const |
Total number of capacity constraint violations of the solution. More... | |
TInterval | duration () const |
Total duration of the solution. More... | |
const std::deque< Vehicle_pickDeliver > & | fleet () const |
Get the current fleet solution. More... | |
std::vector< Solution_rt > | get_postgres_result () const |
get solution like postgres needs it More... | |
std::vector< Short_vehicle > | get_stops () const |
get solution like postgres needs it More... | |
bool | is_feasible () const |
is the solution feasible? More... | |
Pgr_messages & | msg () |
double | objective () const |
Get the value of the objective function. More... | |
bool | operator< (const Solution &) const |
const Orders & | orders () const |
std::string | tau (const std::string &title="Tau") const |
writing the solution in compact form into a string More... | |
TInterval | total_service_time () const |
Total service time of the solution. More... | |
TInterval | total_travel_time () const |
Total travel time of the solution. More... | |
int | twvTot () const |
Total number of time windows constraint violations of the solution. More... | |
Fleet & | vehicles () |
TInterval | wait_time () const |
Total waiting time of the solution. More... | |
Protected Attributes | |
std::deque< Vehicle_pickDeliver > | m_fleet |
The current solution. More... | |
Pgr_messages | m_msg |
Orders | m_orders |
the problem info More... | |
Fleet | m_trucks |
Private Member Functions | |
void | invariant () const |
class invariant about the orders that have been assigned More... | |
void | process_given_solution_from_user (TTimestamp, bool) |
processes the initial solution given by the user More... | |
void | process_unassigned () |
Adds unassigned orders to phony vehicles. More... | |
Private Attributes | |
Identifiers< size_t > | m_all_orders |
set of all orders More... | |
Identifiers< size_t > | m_assigned |
set of assigned orders More... | |
Identifiers< size_t > | m_unassigned |
set of unassigned orders More... | |
Definition at line 45 of file initialsol/tabu.h.
|
delete |
Initial solution without information is not valid.
vrprouting::initialsol::tabu::Initial_solution::Initial_solution | ( | TTimestamp | execution_date, |
bool | optimize, | ||
problem::PickDeliver * | problem_ptr | ||
) |
Creating a complete initial solution.
[in] | execution_date | used for setting unmovable orders from the past |
[in] | optimize | prepare orders for optimization |
[in] | problem_ptr | the problem pointer |
Get all the orders
From the of used vehicles When there are unassigned orders
Get the remaining empty unused vehicles
add the unassigned orders to phony vehicles
Definition at line 60 of file initialsol/tabu.cpp.
References Identifiers< T >::empty(), vrprouting::problem::Fleet::feasible_orders(), vrprouting::problem::Fleet::get_unused_trucks(), invariant(), vrprouting::problem::Solution::is_feasible(), m_all_orders, vrprouting::problem::Solution::m_fleet, m_unassigned, pgassert, process_given_solution_from_user(), process_unassigned(), and vrprouting::problem::Solution::vehicles().
Get all statistics in one cycle.
idx | variable |
---|---|
0 | twv |
1 | cv |
2 | fleet size |
3 | waiting time |
4 | duration |
5 | travel time |
Definition at line 218 of file solution.cpp.
References vrprouting::problem::Solution::m_fleet.
Referenced by vrprouting::problem::Solution::cost_str(), and vrprouting::problem::Solution::operator<().
|
inherited |
Definition at line 246 of file solution.cpp.
References vrprouting::problem::Solution::cost().
Referenced by vrprouting::problem::Solution::tau().
|
inherited |
Total number of capacity constraint violations of the solution.
Definition at line 196 of file solution.cpp.
References vrprouting::problem::Vehicle::cvTot(), and vrprouting::problem::Solution::m_fleet.
Referenced by vrprouting::problem::Solution::get_postgres_result().
|
inherited |
Total duration of the solution.
The solution duration is the sum of the durations of all vehicles
Definition at line 140 of file solution.cpp.
References vrprouting::problem::Vehicle::duration(), and vrprouting::problem::Solution::m_fleet.
Referenced by vrprouting::problem::Solution::get_postgres_result(), vrprouting::optimizers::simple::Optimize::save_if_best(), and vrprouting::optimizers::simple::Optimize::swap_worse().
|
inlineinherited |
Get the current fleet solution.
Definition at line 107 of file solution.h.
References vrprouting::problem::Solution::m_fleet.
Referenced by vrprouting::optimizers::tabu::Optimize::intensify(), and vrprouting::optimizers::tabu::Optimize::Optimize().
|
inherited |
get solution like postgres needs it
Definition at line 61 of file solution.cpp.
References vrprouting::problem::Solution::cvTot(), vrprouting::problem::Solution::duration(), vrprouting::problem::Solution::m_fleet, vrprouting::problem::Solution::total_service_time(), vrprouting::problem::Solution::total_travel_time(), vrprouting::problem::Solution::twvTot(), and vrprouting::problem::Solution::wait_time().
|
inherited |
get solution like postgres needs it
Definition at line 49 of file solution.cpp.
References Short_vehicle::id, and vrprouting::problem::Solution::m_fleet.
|
private |
class invariant about the orders that have been assigned
Definition at line 50 of file initialsol/tabu.cpp.
References m_all_orders, m_assigned, m_unassigned, and pgassert.
Referenced by Initial_solution(), process_given_solution_from_user(), and process_unassigned().
|
inherited |
is the solution feasible?
The solution is feasible when all vehicles are feasible.
Definition at line 129 of file solution.cpp.
References vrprouting::problem::Solution::m_fleet.
Referenced by vrprouting::optimizers::simple::Optimize::decrease_truck(), vrprouting::initialsol::simple::Initial_solution::do_while_feasible(), vrprouting::initialsol::simple::Initial_solution::do_while_foo(), Initial_solution(), process_given_solution_from_user(), and process_unassigned().
|
inlineinherited |
Definition at line 119 of file solution.h.
References vrprouting::problem::Solution::m_msg.
Referenced by vrprouting::initialsol::simple::Initial_solution::do_while_foo(), vrprouting::optimizers::simple::Optimize::inter_swap(), vrprouting::optimizers::tabu::Optimize::move_2_real(), vrprouting::initialsol::simple::Initial_solution::one_truck_all_orders(), vrprouting::optimizers::simple::Optimize::Optimize(), vrprouting::optimizers::tabu::Optimize::Optimize(), process_unassigned(), vrprouting::optimizers::simple::Optimize::save_if_best(), and vrprouting::optimizers::tabu::Optimize::tabu_search().
|
inlineinherited |
Get the value of the objective function.
Definition at line 110 of file solution.h.
References vrprouting::problem::Solution::total_travel_time().
Referenced by vrprouting::optimizers::tabu::Optimize::move_2_real(), vrprouting::optimizers::tabu::Optimize::single_pair_insertion(), vrprouting::optimizers::tabu::Optimize::swap_between_routes(), and vrprouting::optimizers::tabu::Optimize::tabu_search().
|
inherited |
|
inlineinherited |
Definition at line 120 of file solution.h.
References vrprouting::problem::Solution::m_orders.
Referenced by vrprouting::optimizers::simple::Optimize::decrease_truck(), vrprouting::optimizers::tabu::Optimize::diversify(), vrprouting::optimizers::tabu::Optimize::move_2_real(), process_given_solution_from_user(), process_unassigned(), vrprouting::optimizers::tabu::Optimize::set_tabu_list_length(), vrprouting::optimizers::tabu::Optimize::single_pair_insertion(), and vrprouting::optimizers::tabu::Optimize::swap_between_routes().
|
private |
processes the initial solution given by the user
User's initial solution is considered.
Set the initial solution given by the user
Used vehicles: are the ones that have a solution from the user
The solution fleet are the used vehicles
Definition at line 131 of file initialsol/tabu.cpp.
References vrprouting::problem::Fleet::get_used_trucks(), invariant(), vrprouting::problem::Solution::is_feasible(), m_assigned, vrprouting::problem::Solution::m_fleet, m_unassigned, vrprouting::problem::Solution::orders(), pgassert, vrprouting::problem::Fleet::set_initial_solution(), and vrprouting::problem::Solution::vehicles().
Referenced by Initial_solution().
|
private |
Adds unassigned orders to phony vehicles.
test pre conditions
cycle the unassigned orders
test post conditions
Definition at line 162 of file initialsol/tabu.cpp.
References Identifiers< T >::empty(), vrprouting::Pgr_messages::error, vrprouting::problem::Fleet::get_phony(), invariant(), vrprouting::problem::Solution::is_feasible(), m_all_orders, m_assigned, vrprouting::problem::Solution::m_fleet, m_unassigned, vrprouting::problem::Solution::msg(), vrprouting::problem::Solution::orders(), pgassert, vrprouting::problem::Vehicle_pickDeliver::push_back(), and vrprouting::problem::Solution::vehicles().
Referenced by Initial_solution().
|
inherited |
writing the solution in compact form into a string
[in] | title | Title to Use for the tau |
Definition at line 116 of file solution.cpp.
References vrprouting::problem::Solution::cost_str(), and vrprouting::problem::Solution::m_fleet.
Referenced by vrprouting::optimizers::simple::Optimize::inter_swap(), vrprouting::optimizers::simple::Optimize::Optimize(), and vrprouting::optimizers::tabu::Optimize::Optimize().
|
inherited |
Total service time of the solution.
The total service time of the solution is the sum of the service times of all vehicles
Definition at line 174 of file solution.cpp.
References vrprouting::problem::Solution::m_fleet, and vrprouting::problem::Vehicle::total_service_time().
Referenced by vrprouting::problem::Solution::get_postgres_result().
|
inherited |
Total travel time of the solution.
The total travel time of the solution is the sum of the travel times of all vehicles
Definition at line 162 of file solution.cpp.
References vrprouting::problem::Solution::m_fleet, and vrprouting::problem::Vehicle::total_travel_time().
Referenced by vrprouting::problem::Solution::get_postgres_result(), and vrprouting::problem::Solution::objective().
|
inherited |
Total number of time windows constraint violations of the solution.
The total time window violations of the solution is the sum of the time window violations of all vehicles
Definition at line 185 of file solution.cpp.
References vrprouting::problem::Solution::m_fleet, and vrprouting::problem::Vehicle::twvTot().
Referenced by vrprouting::problem::Solution::get_postgres_result().
|
inlineinherited |
Definition at line 121 of file solution.h.
References vrprouting::problem::Solution::m_trucks.
Referenced by vrprouting::initialsol::simple::Initial_solution::do_while_foo(), Initial_solution(), vrprouting::initialsol::simple::Initial_solution::one_truck_all_orders(), process_given_solution_from_user(), and process_unassigned().
|
inherited |
Total waiting time of the solution.
The total waiting time of the solution is the sum of the waiting time of all vehicles
Definition at line 151 of file solution.cpp.
References vrprouting::problem::Solution::m_fleet, and vrprouting::problem::Vehicle::total_wait_time().
Referenced by vrprouting::problem::Solution::get_postgres_result().
|
private |
set of all orders
Definition at line 66 of file initialsol/tabu.h.
Referenced by Initial_solution(), invariant(), and process_unassigned().
|
private |
set of assigned orders
Definition at line 72 of file initialsol/tabu.h.
Referenced by invariant(), process_given_solution_from_user(), and process_unassigned().
|
protectedinherited |
The current solution.
Definition at line 125 of file solution.h.
Referenced by vrprouting::problem::Solution::cost(), vrprouting::problem::Solution::cvTot(), vrprouting::optimizers::simple::Optimize::decrease_truck(), vrprouting::optimizers::simple::Optimize::delete_empty_truck(), vrprouting::optimizers::tabu::Optimize::diversify(), vrprouting::initialsol::simple::Initial_solution::do_while_foo(), vrprouting::problem::Solution::duration(), vrprouting::problem::Solution::fleet(), vrprouting::problem::Solution::get_postgres_result(), vrprouting::problem::Solution::get_stops(), Initial_solution(), vrprouting::optimizers::tabu::Optimize::intensify(), vrprouting::optimizers::simple::Optimize::inter_swap(), vrprouting::problem::Solution::is_feasible(), vrprouting::optimizers::tabu::Optimize::move_2_real(), vrprouting::initialsol::simple::Initial_solution::one_truck_all_orders(), vrprouting::optimizers::simple::Optimize::Optimize(), vrprouting::optimizers::tabu::Optimize::Optimize(), process_given_solution_from_user(), process_unassigned(), vrprouting::optimizers::simple::Optimize::save_if_best(), vrprouting::optimizers::tabu::Optimize::single_pair_insertion(), vrprouting::optimizers::simple::Optimize::sort_by_duration(), vrprouting::optimizers::simple::Optimize::sort_by_id(), vrprouting::optimizers::simple::Optimize::sort_by_size(), vrprouting::optimizers::tabu::Optimize::sort_by_size(), vrprouting::optimizers::simple::Optimize::sort_for_move(), vrprouting::optimizers::tabu::Optimize::swap_between_routes(), vrprouting::optimizers::tabu::Optimize::tabu_search(), vrprouting::problem::Solution::tau(), vrprouting::problem::Solution::total_service_time(), vrprouting::problem::Solution::total_travel_time(), vrprouting::problem::Solution::twvTot(), and vrprouting::problem::Solution::wait_time().
|
protectedinherited |
Definition at line 130 of file solution.h.
Referenced by vrprouting::problem::Solution::msg().
|
protectedinherited |
the problem info
Definition at line 128 of file solution.h.
Referenced by vrprouting::initialsol::simple::Initial_solution::do_while_feasible(), and vrprouting::problem::Solution::orders().
|
protectedinherited |
Definition at line 129 of file solution.h.
Referenced by vrprouting::problem::Solution::vehicles().
|
private |
set of unassigned orders
Definition at line 69 of file initialsol/tabu.h.
Referenced by Initial_solution(), invariant(), process_given_solution_from_user(), and process_unassigned().