38 std::vector<General_vehicle_orders_t>
40 std::vector<General_vehicle_orders_t> result;
43 for (
const auto truck :
fleet) {
44 std::vector<General_vehicle_orders_t> data =
45 truck.get_postgres_result(i);
46 result.insert(result.end(), data.begin(), data.end());
57 for (
const auto v :
fleet) {
58 if (v.is_feasable())
continue;
67 for (
const auto v :
fleet) {
68 total += v.duration();
76 for (
const auto v :
fleet) {
85 for (
const auto v :
fleet) {
86 total += v.total_wait_time();
94 for (
const auto v :
fleet) {
95 total += v.total_travel_time();
103 for (
const auto v :
fleet) {
104 total += v.total_service_time();
112 for (
const auto v :
fleet) {
120 double total_duration(0);
121 double total_wait_time(0);
124 for (
const auto v :
fleet) {
125 total_duration += v.duration();
126 total_wait_time += v.total_wait_time();
127 total_twv += v.twvTot();
128 total_cv += v.cvTot();
130 return std::make_tuple(
131 total_twv, total_cv, fleet.size(),
132 total_wait_time, total_duration);
140 std::ostringstream log;
142 log <<
"(twv, cv, fleet, wait, duration) = (" 143 << std::get<0>(s_cost) <<
", " 144 << std::get<1>(s_cost) <<
", " 145 << std::get<2>(s_cost) <<
", " 146 << std::get<3>(s_cost) <<
", " 147 << std::get<4>(s_cost) <<
")";
155 std::ostringstream log;
157 log <<
"\n" << title <<
": " << std::endl;
158 for (
const auto v :
fleet) {
159 log <<
"\n" << v.tau();
170 return lhs.
idx() < rhs.idx();
176 for (
const auto vehicle : solution.
fleet) {
180 log <<
"\n SOLUTION:\n\n " 194 if (std::get<0>(lhs) < std::get<0>(rhs))
196 if (std::get<0>(lhs) > std::get<0>(rhs))
202 if (std::get<1>(lhs) < std::get<1>(rhs))
204 if (std::get<1>(lhs) > std::get<1>(rhs))
210 if (std::get<2>(lhs) < std::get<2>(rhs))
212 if (std::get<2>(lhs) > std::get<2>(rhs))
218 if (std::get<3>(lhs) < std::get<3>(rhs))
220 if (std::get<3>(lhs) > std::get<3>(rhs))
226 if (std::get<4>(lhs) < std::get<4>(rhs))
228 if (std::get<4>(lhs) > std::get<4>(rhs))
238 for (
const auto &t :
trucks) {
239 msg.
log << t.tau() <<
"\n";
bool operator<(const Solution &s_rhs) const
static Pgr_pickDeliver * problem
Vehicle::Cost cost() const
std::ostringstream log
Stores the hint information.
std::deque< Vehicle_pickDeliver > fleet
std::vector< General_vehicle_orders_t > get_postgres_result() const
std::string tau(const std::string &title="Tau") const
friend std::ostream & operator<<(std::ostream &log, const Solution &solution)
Book keeping class for swapping orders between vehicles.
double total_travel_time() const
std::string cost_str() const
double total_service_time() const
std::tuple< int, int, size_t, double, double > Cost