vrpRouting  0.3
vrprouting::initialsol::tabu::Initial_solution Class Reference

#include "tabu.h"

Inheritance diagram for vrprouting::initialsol::tabu::Initial_solution:
Collaboration diagram for vrprouting::initialsol::tabu::Initial_solution:

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, TIntervalcost () 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_rtget_postgres_result () const
 get solution like postgres needs it More...
 
std::vector< Short_vehicleget_stops () const
 get solution like postgres needs it More...
 
bool is_feasible () const
 is the solution feasible? More...
 
Pgr_messagesmsg ()
 
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...
 

Detailed Description

Definition at line 45 of file initialsol/tabu.h.

Constructor & Destructor Documentation

◆ Initial_solution() [1/2]

vrprouting::initialsol::tabu::Initial_solution::Initial_solution ( )
delete

Initial solution without information is not valid.

◆ Initial_solution() [2/2]

vrprouting::initialsol::tabu::Initial_solution::Initial_solution ( TTimestamp  execution_date,
bool  optimize,
problem::PickDeliver problem_ptr 
)

Creating a complete initial solution.

Parameters
[in]execution_dateused for setting unmovable orders from the past
[in]optimizeprepare orders for optimization
[in]problem_ptrthe problem pointer

Get all the orders

  • when an order is feasible on at least one vehicles is part of the orders set
  • unfeasible orders are ignored

From the of used vehicles When there are unassigned orders

  • mark as unmovable all orders on vehicles where the unassigned orders are not feasible

Get the remaining empty unused vehicles

add the unassigned orders to phony vehicles

Definition at line 60 of file initialsol/tabu.cpp.

63  :
64  Solution(problem_ptr),
65  m_all_orders(),
66  m_unassigned(),
67  m_assigned() {
68  invariant();
69 
77 
78  process_given_solution_from_user(execution_date, optimize);
80 
87  if (!m_unassigned.empty()) {
88  for (auto &v : m_fleet) {
89  bool is_usable(false);
90  for (const auto &o : m_unassigned) {
91  if (v.feasible_orders().has(o)) {
92  /*
93  * found an order to be inserted that fits on the vehicle
94  */
95  is_usable = true;
96  break;
97  }
98  }
99  /*
100  * No order to be inserted fits on the vehicle
101  */
102  if (!is_usable) v.set_unmovable(std::numeric_limits<TTimestamp>::max());
103  }
104  }
105 
109  auto unused = vehicles().get_unused_trucks();
110  m_fleet.insert(m_fleet.end(), unused.begin(), unused.end());
112 
118 
119  invariant();
120  }

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().

Member Function Documentation

◆ cost()

std::tuple< int, int, size_t, TInterval, TInterval, TInterval > Solution::cost ( ) const
inherited

Get all statistics in one cycle.

Returns
totals of
idx variable
0 twv
1 cv
2 fleet size
3 waiting time
4 duration
5 travel time
std::get<idx>

Definition at line 218 of file solution.cpp.

218  {
219  TInterval total_duration(0);
220  TInterval total_wait_time(0);
221  TInterval total_tt(0);
222  int total_twv(0);
223  int total_cv(0);
224  /*
225  * Cycle the fleet
226  */
227  for (const auto& v : m_fleet) {
228  total_duration += v.duration();
229  total_wait_time += v.total_wait_time();
230  total_twv += v.twvTot();
231  total_cv += v.cvTot();
232  total_tt += v.total_travel_time();
233  }
234  /*
235  * build the tuple
236  */
237  return std::make_tuple(
238  total_twv, total_cv, m_fleet.size(),
239  total_wait_time, total_duration,
240  total_tt);
241 }

References vrprouting::problem::Solution::m_fleet.

Referenced by vrprouting::problem::Solution::cost_str(), and vrprouting::problem::Solution::operator<().

◆ cost_str()

std::string Solution::cost_str ( ) const
inherited
Returns
The costs in one string

Definition at line 246 of file solution.cpp.

246  {
247  /*
248  * get the cost
249  */
250  auto s_cost(cost());
251  std::ostringstream log;
252 
253  /*
254  * Build the string
255  */
256  log << std::fixed << std::setprecision(4)
257  << "twv=" << std::get<0>(s_cost)
258  << " cv=" << std::get<1>(s_cost)
259  << " wait=" << std::get<3>(s_cost)
260  << " duration=" << std::get<4>(s_cost)
261  << " tt=" << std::get<5>(s_cost);
262 
263  return log.str();
264 }

References vrprouting::problem::Solution::cost().

Referenced by vrprouting::problem::Solution::tau().

◆ cvTot()

int Solution::cvTot ( ) const
inherited

Total number of capacity constraint violations of the solution.

Returns
Total number of capacity violations The total capacity violations of the solution is the sum of the capacity violations of all vehicles

Definition at line 196 of file solution.cpp.

196  {
197  return std::accumulate(begin(m_fleet), end(m_fleet), 0,
198  [](int i, const Vehicle_pickDeliver& v) {return v.cvTot() + i;});
199 }

References vrprouting::problem::Vehicle::cvTot(), and vrprouting::problem::Solution::m_fleet.

Referenced by vrprouting::problem::Solution::get_postgres_result().

◆ duration()

TInterval Solution::duration ( ) const
inherited

Total duration of the solution.

Returns
the solution's duration

The solution duration is the sum of the durations of all vehicles

Definition at line 140 of file solution.cpp.

140  {
141  return std::accumulate(begin(m_fleet), end(m_fleet), static_cast<TInterval>(0),
142  [](TInterval i, const Vehicle_pickDeliver& v) {return v.duration() + i;});
143 }

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().

◆ fleet()

const std::deque<Vehicle_pickDeliver>& vrprouting::problem::Solution::fleet ( ) const
inlineinherited

Get the current fleet solution.

Definition at line 107 of file solution.h.

107 {return m_fleet;}

References vrprouting::problem::Solution::m_fleet.

Referenced by vrprouting::optimizers::tabu::Optimize::intensify(), and vrprouting::optimizers::tabu::Optimize::Optimize().

◆ get_postgres_result()

std::vector< Solution_rt > Solution::get_postgres_result ( ) const
inherited

get solution like postgres needs it

Returns
container for postgres

Definition at line 61 of file solution.cpp.

61  {
62  std::vector<Solution_rt> result;
63 
64  /* postgres numbering starts with 1 */
65  int i(1);
66 
67  for (auto v : m_fleet) {
68  v.evaluate(0);
69  auto data = v.get_postgres_result(i);
70  /*
71  * Results adjusted for the depot and the first stop
72  * So the vehicle waits on the depot not on the first stop
73  */
74  data[1].arrivalTime = data[1].operationTime;
75  data[0].waitDuration = data[1].waitDuration;
76  data[1].waitDuration = 0;
77  data[0].departureTime = data[0].arrivalTime + data[0].waitDuration;
78 
79 
80  result.insert(result.end(), data.begin(), data.end());
81  ++i;
82  }
83 
84  Solution_rt aggregates = {
85  /*
86  * Vehicle id = -2 indicates its an aggregate row
87  *
88  * (twv, cv, fleet, wait, duration)
89  */
90  -2, // summary row on vehicle_number
91  twvTot(), // on vehicle_id
92  cvTot(), // on vehicle_seq
93  -1, // on order_id
94  -1, // on stop_id
95  -2, // on stop_type (gets increased later by one so it gets -1)
96  -1, // not accounting total loads
97  static_cast<int64_t>(total_travel_time()),
98  -1, // not accounting arrival_travel_time
99  static_cast<int64_t>(wait_time()),
100  -1, // not accounting operation time
101  static_cast<int64_t>(total_service_time()),
102  static_cast<int64_t>(duration()),
103  cvTot(),
104  twvTot()
105  };
106  result.push_back(aggregates);
107 
108  return result;
109 }

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().

◆ get_stops()

std::vector< Short_vehicle > Solution::get_stops ( ) const
inherited

get solution like postgres needs it

Returns
container for postgres

Definition at line 49 of file solution.cpp.

49  {
50  std::vector<Short_vehicle> result;
51  for (auto v : m_fleet) {
52  result.push_back(Short_vehicle{v.id(), v.get_stops()});
53  }
54  return result;
55 }

References Short_vehicle::id, and vrprouting::problem::Solution::m_fleet.

◆ invariant()

void vrprouting::initialsol::tabu::Initial_solution::invariant ( ) const
private

class invariant about the orders that have been assigned

Invariant
assigned UNION unassigned = all_orders
assigned INTERSECTION unassigned = empty

Definition at line 50 of file initialsol/tabu.cpp.

50  {
52  pgassert((m_assigned * m_unassigned).empty());
53 }

References m_all_orders, m_assigned, m_unassigned, and pgassert.

Referenced by Initial_solution(), process_given_solution_from_user(), and process_unassigned().

◆ is_feasible()

bool Solution::is_feasible ( ) const
inherited

is the solution feasible?

The solution is feasible when all vehicles are feasible.

Returns
true when all vehicles in solution are feasible

Definition at line 129 of file solution.cpp.

129  {
130  return std::find_if(m_fleet.begin(), m_fleet.end(),
131  [] (const Vehicle_pickDeliver& v) -> bool {return !v.is_feasible();}) == m_fleet.end();
132 }

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().

◆ msg()

◆ objective()

double vrprouting::problem::Solution::objective ( ) const
inlineinherited

◆ operator<()

bool Solution::operator< ( const Solution s_rhs) const
inherited

Definition at line 267 of file solution.cpp.

267  {
268  auto lhs(cost());
269  auto rhs(s_rhs.cost());
270 
271  /*
272  * time window violations
273  */
274  if (std::get<0>(lhs) < std::get<0>(rhs))
275  return true;
276  if (std::get<0>(lhs) > std::get<0>(rhs))
277  return false;
278 
279  /*
280  * capacity violations
281  */
282  if (std::get<1>(lhs) < std::get<1>(rhs))
283  return true;
284  if (std::get<1>(lhs) > std::get<1>(rhs))
285  return false;
286 
287  /*
288  * fleet size
289  */
290  if (std::get<2>(lhs) < std::get<2>(rhs))
291  return true;
292  if (std::get<2>(lhs) > std::get<2>(rhs))
293  return false;
294 
295  /*
296  * waiting time
297  */
298  if (std::get<3>(lhs) < std::get<3>(rhs))
299  return true;
300  if (std::get<3>(lhs) > std::get<3>(rhs))
301  return false;
302 
303  /*
304  * duration
305  */
306  if (std::get<4>(lhs) < std::get<4>(rhs))
307  return true;
308  if (std::get<4>(lhs) > std::get<4>(rhs))
309  return false;
310 
311  return false;
312 }

References vrprouting::problem::Solution::cost().

◆ orders()

◆ process_given_solution_from_user()

void vrprouting::initialsol::tabu::Initial_solution::process_given_solution_from_user ( TTimestamp  execution_date,
bool  optimize 
)
private

processes the initial solution given by the user

User's initial solution is considered.

Precondition
m_fleet is empty
invariant()
m_fleet has vehicles that have orders
Postcondition
invariant()
is feasible

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.

131  {
132  pgassert(m_fleet.empty());
133  invariant();
134 
138  vehicles().set_initial_solution(orders(), m_assigned, m_unassigned, execution_date, optimize);
139 
143  auto used_v = vehicles().get_used_trucks();
144 
148  m_fleet.insert(m_fleet.end(), used_v.begin(), used_v.end());
149 
151  invariant();
152 }

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().

◆ process_unassigned()

void vrprouting::initialsol::tabu::Initial_solution::process_unassigned ( )
private

Adds unassigned orders to phony vehicles.

Precondition
invariant()
is_feasible()
Postcondition
invariant()
is_feasible()
unassigned is empty

test pre conditions

cycle the unassigned orders

  • get a new phony vehicle
  • Add the order to the phony vehicle
  • update for invariant
  • Add the vehicle to the fleet

test post conditions

Definition at line 162 of file initialsol/tabu.cpp.

162  {
166  invariant();
168 
169  Identifiers<size_t> notused;
170 
171  auto not_assigned = m_unassigned;
172 
176  for (const auto o : not_assigned) {
180  auto phony_v = vehicles().get_phony();
181  if (!phony_v.is_order_feasible(orders()[o])) {
182  phony_v.push_back(orders()[o]);
183  m_unassigned -= o;
184  m_all_orders -= o;
185  msg().error << "\n**Illegal Order** pick.opens() + tt > drop.closes() can not be inserted on any vehicle";
186  continue;
187  }
188 
192  phony_v.push_back(orders()[o]);
193  pgassert(phony_v.is_feasible());
194 
198  m_assigned += o;
199  m_unassigned -= o;
200 
204  m_fleet.push_back(phony_v);
205  invariant();
206  }
207 
213  invariant();
214 }

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().

◆ tau()

std::string Solution::tau ( const std::string &  title = "Tau") const
inherited

writing the solution in compact form into a string

Parameters
[in]titleTitle to Use for the tau
Returns
The solution in one compacted string

Definition at line 116 of file solution.cpp.

116  {
117  std::string str {"\n" + title + ": " + '\n'};
118  for (const auto& v : m_fleet) str += ("\n" + v.tau());
119  str += "\n" + cost_str() + "\n";
120  return str;
121 }

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().

◆ total_service_time()

TInterval Solution::total_service_time ( ) const
inherited

Total service time of the solution.

Returns
the 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.

174  {
175  return std::accumulate(begin(m_fleet), end(m_fleet), static_cast<TInterval>(0),
176  [](TInterval i, const Vehicle_pickDeliver& v) {return v.total_service_time() + i;});
177 }

References vrprouting::problem::Solution::m_fleet, and vrprouting::problem::Vehicle::total_service_time().

Referenced by vrprouting::problem::Solution::get_postgres_result().

◆ total_travel_time()

TInterval Solution::total_travel_time ( ) const
inherited

Total travel time of the solution.

Returns
the total waiting time

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.

162  {
163  return std::accumulate(begin(m_fleet), end(m_fleet), static_cast<TInterval>(0),
164  [](TInterval i, const Vehicle_pickDeliver& v) {return v.total_travel_time() + i;});
165 }

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().

◆ twvTot()

int Solution::twvTot ( ) const
inherited

Total number of time windows constraint violations of the solution.

Returns
the total number of time window violations

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.

185  {
186  return std::accumulate(begin(m_fleet), end(m_fleet), 0,
187  [](int i, const Vehicle_pickDeliver& v) {return v.twvTot() + i;});
188 }

References vrprouting::problem::Solution::m_fleet, and vrprouting::problem::Vehicle::twvTot().

Referenced by vrprouting::problem::Solution::get_postgres_result().

◆ vehicles()

◆ wait_time()

TInterval Solution::wait_time ( ) const
inherited

Total waiting time of the solution.

Returns
the total waiting time

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.

151  {
152  return std::accumulate(begin(m_fleet), end(m_fleet), static_cast<TInterval>(0),
153  [](TInterval i, const Vehicle_pickDeliver& v) {return v.total_wait_time() + i;});
154 }

References vrprouting::problem::Solution::m_fleet, and vrprouting::problem::Vehicle::total_wait_time().

Referenced by vrprouting::problem::Solution::get_postgres_result().

Member Data Documentation

◆ m_all_orders

Identifiers<size_t> vrprouting::initialsol::tabu::Initial_solution::m_all_orders
private

set of all orders

Definition at line 66 of file initialsol/tabu.h.

Referenced by Initial_solution(), invariant(), and process_unassigned().

◆ m_assigned

Identifiers<size_t> vrprouting::initialsol::tabu::Initial_solution::m_assigned
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().

◆ m_fleet

std::deque<Vehicle_pickDeliver> vrprouting::problem::Solution::m_fleet
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().

◆ m_msg

Pgr_messages vrprouting::problem::Solution::m_msg
protectedinherited

Definition at line 130 of file solution.h.

Referenced by vrprouting::problem::Solution::msg().

◆ m_orders

Orders vrprouting::problem::Solution::m_orders
protectedinherited

◆ m_trucks

Fleet vrprouting::problem::Solution::m_trucks
protectedinherited

Definition at line 129 of file solution.h.

Referenced by vrprouting::problem::Solution::vehicles().

◆ m_unassigned

Identifiers<size_t> vrprouting::initialsol::tabu::Initial_solution::m_unassigned
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().


The documentation for this class was generated from the following files:
vrprouting::problem::Solution::orders
const Orders & orders() const
Definition: solution.h:120
vrprouting::problem::Solution::total_service_time
TInterval total_service_time() const
Total service time of the solution.
Definition: solution.cpp:174
vrprouting::problem::Solution::m_fleet
std::deque< Vehicle_pickDeliver > m_fleet
The current solution.
Definition: solution.h:125
vrprouting::problem::Solution::cvTot
int cvTot() const
Total number of capacity constraint violations of the solution.
Definition: solution.cpp:196
vrprouting::problem::Fleet::get_used_trucks
std::vector< Vehicle_pickDeliver > get_used_trucks()
Get all the used vehicles.
Definition: fleet.cpp:64
vrprouting::problem::Solution::total_travel_time
TInterval total_travel_time() const
Total travel time of the solution.
Definition: solution.cpp:162
vrprouting::problem::Fleet::set_initial_solution
void set_initial_solution(const Orders &, Identifiers< size_t > &, Identifiers< size_t > &, TTimestamp, bool)
set the vehicle's user's initial solution
Definition: fleet.cpp:296
vrprouting::problem::Fleet::get_phony
Vehicle_pickDeliver get_phony() const
Get a vehicle from the user's defined vehicles.
Definition: fleet.h:91
Short_vehicle::id
Id id
Definition: short_vehicle.h:42
vrprouting::problem::Solution::vehicles
Fleet & vehicles()
Definition: solution.h:121
vrprouting::problem::Vehicle_pickDeliver::push_back
void push_back(const Order &order)
puts an order at the end of the truck
Definition: vehicle_pickDeliver.cpp:57
vrprouting::Pgr_messages::error
std::ostringstream error
Stores the error information.
Definition: pgr_messages.h:95
vrprouting::problem::Solution::twvTot
int twvTot() const
Total number of time windows constraint violations of the solution.
Definition: solution.cpp:185
pgassert
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:95
vrprouting::problem::Solution::Solution
Solution()=delete
constructor
vrprouting::problem::Solution::wait_time
TInterval wait_time() const
Total waiting time of the solution.
Definition: solution.cpp:151
vrprouting::initialsol::tabu::Initial_solution::m_assigned
Identifiers< size_t > m_assigned
set of assigned orders
Definition: initialsol/tabu.h:72
vrprouting::problem::Solution::duration
TInterval duration() const
Total duration of the solution.
Definition: solution.cpp:140
Short_vehicle
short_vehicle
Definition: short_vehicle.h:41
vrprouting::problem::Fleet::feasible_orders
Identifiers< size_t > feasible_orders() const
Definition: fleet.cpp:97
Identifiers::empty
bool empty() const
Definition: identifiers.hpp:78
Solution_rt
Solution schedule when twv & cw are hard restrictions.
Definition: solution_rt.h:56
vrprouting::initialsol::tabu::Initial_solution::m_unassigned
Identifiers< size_t > m_unassigned
set of unassigned orders
Definition: initialsol/tabu.h:69
vrprouting::problem::Solution::msg
Pgr_messages & msg()
Definition: solution.h:119
vrprouting::problem::Solution::m_msg
Pgr_messages m_msg
Definition: solution.h:130
vrprouting::initialsol::tabu::Initial_solution::invariant
void invariant() const
class invariant about the orders that have been assigned
Definition: initialsol/tabu.cpp:50
vrprouting::problem::Solution::cost
std::tuple< int, int, size_t, TInterval, TInterval, TInterval > cost() const
Get all statistics in one cycle.
Definition: solution.cpp:218
vrprouting::initialsol::tabu::Initial_solution::process_unassigned
void process_unassigned()
Adds unassigned orders to phony vehicles.
Definition: initialsol/tabu.cpp:162
vrprouting::problem::Solution::is_feasible
bool is_feasible() const
is the solution feasible?
Definition: solution.cpp:129
TInterval
int64_t TInterval
Definition: typedefs.h:72
vrprouting::initialsol::tabu::Initial_solution::m_all_orders
Identifiers< size_t > m_all_orders
set of all orders
Definition: initialsol/tabu.h:66
vrprouting::initialsol::tabu::Initial_solution::process_given_solution_from_user
void process_given_solution_from_user(TTimestamp, bool)
processes the initial solution given by the user
Definition: initialsol/tabu.cpp:131
vrprouting::problem::Solution::m_trucks
Fleet m_trucks
Definition: solution.h:129
vrprouting::problem::Solution::m_orders
Orders m_orders
the problem info
Definition: solution.h:128
vrprouting::problem::Fleet::get_unused_trucks
std::vector< Vehicle_pickDeliver > get_unused_trucks()
Get all the unused vehicles.
Definition: fleet.cpp:80
Identifiers< size_t >
vrprouting::problem::Solution::cost_str
std::string cost_str() const
Definition: solution.cpp:246