PGROUTING
3.2
|
#include "optimize.h"
Public Member Functions | |
Optimize (const Solution &solution) | |
Optimize (const Solution &solution, size_t times) | |
Vehicle::Cost | cost () const |
std::string | cost_str () const |
int | cvTot () const |
void | decrease_truck () |
double | duration () const |
Initials_code | get_kind () const |
std::vector< General_vehicle_orders_t > | get_postgres_result () const |
void | inter_swap (size_t times) |
bool | is_feasable () const |
bool | operator< (const Solution &s_rhs) const |
std::string | tau (const std::string &title="Tau") const |
double | total_service_time () const |
double | total_travel_time () const |
int | twvTot () const |
double | wait_time () const |
Static Public Member Functions | |
static Pgr_messages & | msg () |
The problem's message. More... | |
Public Attributes | |
Solution | best_solution |
Protected Attributes | |
double | EPSILON |
std::deque< Vehicle_pickDeliver > | fleet |
Fleet | trucks |
Private Member Functions | |
bool | decrease_truck (size_t) |
void | delete_empty_truck () |
bool | inter_swap () |
bool | move_order (Order order, Vehicle_pickDeliver &from_truck, Vehicle_pickDeliver &to_truck) |
moves an order to an non empty vehicle More... | |
bool | move_reduce_cost (Vehicle_pickDeliver &from, Vehicle_pickDeliver &to) |
void | save_if_best () |
void | sort_by_duration () |
void | sort_by_size () |
bool | swap_worse (Vehicle_pickDeliver &from, Vehicle_pickDeliver &to) |
Static Private Attributes | |
static Pgr_pickDeliver * | problem |
this solution belongs to this problem More... | |
Definition at line 41 of file optimize.h.
|
explicit |
Definition at line 41 of file optimize.cpp.
References decrease_truck(), pgrouting::vrp::Solution::fleet, inter_swap(), and pgassert.
pgrouting::vrp::Optimize::Optimize | ( | const Solution & | solution, |
size_t | times | ||
) |
Definition at line 50 of file optimize.cpp.
References best_solution, pgrouting::vrp::Solution::fleet, inter_swap(), pgrouting::Pgr_messages::log, pgrouting::vrp::Solution::msg(), sort_by_size(), and pgrouting::vrp::Solution::tau().
|
inherited |
Definition at line 130 of file solution.cpp.
References pgrouting::vrp::Solution::fleet.
Referenced by pgrouting::vrp::Solution::cost_str(), and pgrouting::vrp::Solution::operator<().
|
inherited |
Definition at line 149 of file solution.cpp.
References pgrouting::vrp::Solution::cost().
Referenced by save_if_best(), and pgrouting::vrp::Solution::tau().
|
inherited |
void pgrouting::vrp::Optimize::decrease_truck | ( | ) |
Definition at line 446 of file optimize.cpp.
References delete_empty_truck(), pgrouting::vrp::Solution::fleet, and save_if_best().
Referenced by inter_swap(), and Optimize().
|
private |
Definition at line 460 of file optimize.cpp.
References pgrouting::vrp::Solution::fleet, pgrouting::vrp::Solution::is_feasable(), and pgassert.
|
private |
Definition at line 288 of file optimize.cpp.
References pgrouting::vrp::Solution::fleet, and save_if_best().
Referenced by decrease_truck(), and inter_swap().
|
inherited |
Definition at line 76 of file solution.cpp.
References pgrouting::vrp::Solution::fleet.
Referenced by move_reduce_cost(), save_if_best(), and swap_worse().
|
inherited |
Definition at line 237 of file solution.cpp.
References pgrouting::vrp::Pgr_pickDeliver::get_kind(), and pgrouting::vrp::Solution::problem.
Referenced by move_order(), move_reduce_cost(), and swap_worse().
|
inherited |
|
private |
Definition at line 94 of file optimize.cpp.
References delete_empty_truck(), pgrouting::vrp::Solution::fleet, pgrouting::Pgr_messages::log, move_reduce_cost(), pgrouting::vrp::Solution::msg(), swap_worse(), and pgrouting::vrp::Solution::tau().
Referenced by inter_swap(), and Optimize().
void pgrouting::vrp::Optimize::inter_swap | ( | size_t | times | ) |
Definition at line 66 of file optimize.cpp.
References decrease_truck(), pgrouting::vrp::Solution::fleet, inter_swap(), pgrouting::Pgr_messages::log, pgrouting::vrp::Solution::msg(), sort_by_size(), and pgrouting::vrp::Solution::tau().
|
inherited |
Definition at line 67 of file solution.cpp.
References pgrouting::vrp::Solution::fleet.
Referenced by decrease_truck(), and pgrouting::vrp::Initial_solution::do_while_foo().
|
private |
moves an order to an non empty vehicle
order: order to be moved from_truck: here is the order to truck: truck to put the order
to check if the order was inserted: to_truck.has_order(order)
Definition at line 393 of file optimize.cpp.
References pgrouting::vrp::Vehicle::empty(), pgrouting::vrp::Vehicle_pickDeliver::erase(), pgrouting::vrp::Solution::get_kind(), pgrouting::vrp::Vehicle_pickDeliver::has_order(), pgrouting::vrp::Vehicle_pickDeliver::insert(), pgrouting::vrp::Vehicle::is_phony(), pgrouting::vrp::OneDepot, pgassert, pgrouting::vrp::Vehicle_pickDeliver::semiLIFO(), and pgrouting::vrp::Vehicle::size().
Referenced by swap_worse().
|
private |
Definition at line 311 of file optimize.cpp.
References best_solution, pgrouting::vrp::Solution::duration(), pgrouting::vrp::Solution::get_kind(), pgrouting::vrp::OneDepot, pgrouting::vrp::Vehicle_pickDeliver::orders_in_vehicle(), pgassert, and save_if_best().
Referenced by inter_swap().
|
staticinherited |
The problem's message.
Definition at line 60 of file solution.cpp.
References pgrouting::vrp::Pgr_pickDeliver::msg, and pgrouting::vrp::Solution::problem.
Referenced by pgrouting::vrp::Initial_solution::do_while_foo(), inter_swap(), pgrouting::vrp::Initial_solution::one_truck_all_orders(), Optimize(), save_if_best(), and pgrouting::vrp::Solution::Solution().
|
inherited |
|
private |
Definition at line 491 of file optimize.cpp.
References best_solution, pgrouting::vrp::Solution::cost_str(), pgrouting::vrp::Solution::duration(), pgrouting::vrp::Solution::fleet, pgrouting::Pgr_messages::log, pgrouting::vrp::Solution::msg(), and pgrouting::vrp::Solution::tau().
Referenced by decrease_truck(), delete_empty_truck(), and move_reduce_cost().
|
private |
Definition at line 279 of file optimize.cpp.
References pgrouting::vrp::Solution::fleet.
Referenced by sort_by_size().
|
private |
Definition at line 268 of file optimize.cpp.
References pgrouting::vrp::Solution::fleet, and sort_by_duration().
Referenced by inter_swap(), and Optimize().
|
private |
Definition at line 133 of file optimize.cpp.
References best_solution, pgrouting::vrp::Solution::duration(), pgrouting::vrp::Solution::get_kind(), pgrouting::vrp::Vehicle_pickDeliver::has_order(), move_order(), pgrouting::vrp::OneDepot, pgrouting::vrp::Vehicle_pickDeliver::orders(), pgrouting::vrp::Vehicle_pickDeliver::orders_in_vehicle(), and pgassert.
Referenced by inter_swap().
|
inherited |
Definition at line 164 of file solution.cpp.
References pgrouting::vrp::Solution::cost_str(), and pgrouting::vrp::Solution::fleet.
Referenced by inter_swap(), pgrouting::vrp::operator<<(), Optimize(), and save_if_best().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Solution pgrouting::vrp::Optimize::best_solution |
Definition at line 52 of file optimize.h.
Referenced by move_reduce_cost(), Optimize(), save_if_best(), and swap_worse().
|
protectedinherited |
Definition at line 48 of file solution.h.
Referenced by pgrouting::vrp::Solution::operator=().
|
protectedinherited |
Definition at line 49 of file solution.h.
Referenced by pgrouting::vrp::Solution::cost(), pgrouting::vrp::Solution::cvTot(), decrease_truck(), delete_empty_truck(), pgrouting::vrp::Initial_solution::do_while_foo(), pgrouting::vrp::Solution::duration(), pgrouting::vrp::Solution::get_postgres_result(), inter_swap(), pgrouting::vrp::Solution::is_feasable(), pgrouting::vrp::Initial_solution::one_truck_all_orders(), pgrouting::vrp::operator<<(), pgrouting::vrp::Solution::operator=(), Optimize(), save_if_best(), sort_by_duration(), sort_by_size(), pgrouting::vrp::Solution::tau(), pgrouting::vrp::Solution::total_service_time(), pgrouting::vrp::Solution::total_travel_time(), pgrouting::vrp::Solution::twvTot(), and pgrouting::vrp::Solution::wait_time().
|
staticprivateinherited |
this solution belongs to this problem
Definition at line 114 of file solution.h.
Referenced by pgrouting::vrp::Solution::get_kind(), pgrouting::vrp::Solution::msg(), and pgrouting::vrp::PD_problem::PD_problem().
|
protectedinherited |
Definition at line 52 of file solution.h.
Referenced by pgrouting::vrp::Initial_solution::do_while_foo(), pgrouting::vrp::Initial_solution::one_truck_all_orders(), pgrouting::vrp::Solution::operator=(), and pgrouting::vrp::Solution::Solution().