![]() |
vrpRouting
0.3
|
#include "solution.h"
Public Member Functions | |
Solution ()=delete | |
constructor More... | |
Solution (const Solution &sol)=default | |
copy constructor More... | |
template<typename P > | |
Solution (P *p_problem) | |
constructor 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 |
Solution & | operator= (const Solution &sol)=default |
copy assignment More... | |
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 |
Friends | |
std::ostream & | operator<< (std::ostream &log, const Solution &solution) |
printing function More... | |
Definition at line 50 of file solution.h.
|
delete |
constructor
|
inlineexplicit |
constructor
Definition at line 57 of file solution.h.
|
default |
copy constructor
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 m_fleet.
Referenced by cost_str(), and operator<().
std::string Solution::cost_str | ( | ) | const |
Definition at line 246 of file solution.cpp.
References cost().
Referenced by tau().
int Solution::cvTot | ( | ) | const |
Total number of capacity constraint violations of the solution.
Definition at line 196 of file solution.cpp.
References vrprouting::problem::Vehicle::cvTot(), and m_fleet.
Referenced by get_postgres_result().
TInterval Solution::duration | ( | ) | const |
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 m_fleet.
Referenced by get_postgres_result(), vrprouting::optimizers::simple::Optimize::save_if_best(), and vrprouting::optimizers::simple::Optimize::swap_worse().
|
inline |
Get the current fleet solution.
Definition at line 107 of file solution.h.
References m_fleet.
Referenced by vrprouting::optimizers::tabu::Optimize::intensify(), and vrprouting::optimizers::tabu::Optimize::Optimize().
std::vector< Solution_rt > Solution::get_postgres_result | ( | ) | const |
get solution like postgres needs it
Definition at line 61 of file solution.cpp.
References cvTot(), duration(), m_fleet, total_service_time(), total_travel_time(), twvTot(), and wait_time().
std::vector< Short_vehicle > Solution::get_stops | ( | ) | const |
get solution like postgres needs it
Definition at line 49 of file solution.cpp.
References Short_vehicle::id, and m_fleet.
bool Solution::is_feasible | ( | ) | const |
is the solution feasible?
The solution is feasible when all vehicles are feasible.
Definition at line 129 of file solution.cpp.
References 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(), vrprouting::initialsol::tabu::Initial_solution::Initial_solution(), vrprouting::initialsol::tabu::Initial_solution::process_given_solution_from_user(), and vrprouting::initialsol::tabu::Initial_solution::process_unassigned().
|
inline |
Definition at line 119 of file solution.h.
References 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(), vrprouting::initialsol::tabu::Initial_solution::process_unassigned(), vrprouting::optimizers::simple::Optimize::save_if_best(), and vrprouting::optimizers::tabu::Optimize::tabu_search().
|
inline |
Get the value of the objective function.
Definition at line 110 of file solution.h.
References 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().
bool Solution::operator< | ( | const Solution & | s_rhs | ) | const |
|
inline |
Definition at line 120 of file solution.h.
References m_orders.
Referenced by vrprouting::optimizers::simple::Optimize::decrease_truck(), vrprouting::optimizers::tabu::Optimize::diversify(), vrprouting::optimizers::tabu::Optimize::move_2_real(), vrprouting::initialsol::tabu::Initial_solution::process_given_solution_from_user(), vrprouting::initialsol::tabu::Initial_solution::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().
std::string Solution::tau | ( | const std::string & | title = "Tau" | ) | const |
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 cost_str(), and m_fleet.
Referenced by vrprouting::optimizers::simple::Optimize::inter_swap(), vrprouting::optimizers::simple::Optimize::Optimize(), and vrprouting::optimizers::tabu::Optimize::Optimize().
TInterval Solution::total_service_time | ( | ) | const |
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 m_fleet, and vrprouting::problem::Vehicle::total_service_time().
Referenced by get_postgres_result().
TInterval Solution::total_travel_time | ( | ) | const |
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 m_fleet, and vrprouting::problem::Vehicle::total_travel_time().
Referenced by get_postgres_result(), and objective().
int Solution::twvTot | ( | ) | const |
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 m_fleet, and vrprouting::problem::Vehicle::twvTot().
Referenced by get_postgres_result().
|
inline |
Definition at line 121 of file solution.h.
References m_trucks.
Referenced by vrprouting::initialsol::simple::Initial_solution::do_while_foo(), vrprouting::initialsol::tabu::Initial_solution::Initial_solution(), vrprouting::initialsol::simple::Initial_solution::one_truck_all_orders(), vrprouting::initialsol::tabu::Initial_solution::process_given_solution_from_user(), and vrprouting::initialsol::tabu::Initial_solution::process_unassigned().
TInterval Solution::wait_time | ( | ) | const |
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 m_fleet, and vrprouting::problem::Vehicle::total_wait_time().
Referenced by get_postgres_result().
|
friend |
printing function
Definition at line 76 of file solution.h.
|
protected |
The current solution.
Definition at line 125 of file solution.h.
Referenced by cost(), 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(), duration(), fleet(), get_postgres_result(), get_stops(), vrprouting::initialsol::tabu::Initial_solution::Initial_solution(), vrprouting::optimizers::tabu::Optimize::intensify(), vrprouting::optimizers::simple::Optimize::inter_swap(), 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(), vrprouting::initialsol::tabu::Initial_solution::process_given_solution_from_user(), vrprouting::initialsol::tabu::Initial_solution::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(), tau(), total_service_time(), total_travel_time(), twvTot(), and wait_time().
|
protected |
Definition at line 130 of file solution.h.
Referenced by msg().
|
protected |
the problem info
Definition at line 128 of file solution.h.
Referenced by vrprouting::initialsol::simple::Initial_solution::do_while_feasible(), and orders().
|
protected |
Definition at line 129 of file solution.h.
Referenced by vehicles().