MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / start

Method start

pyvrp/ProgressPrinter.py:98–127  ·  view source on GitHub ↗

Outputs information about PyVRP and the data instance that is being solved.

(self, data: ProblemData)

Source from the content-addressed store, hash-verified

96 self._best_cost = datum.best_cost
97
98 def start(self, data: ProblemData):
99 """
100 Outputs information about PyVRP and the data instance that is being
101 solved.
102 """
103 if not self._print:
104 return
105
106 num_d = data.num_depots
107 depot_text = f"{num_d} depot{'s' if num_d > 1 else ''}"
108
109 num_c = data.num_clients
110 client_text = f"{num_c} client{'s' if num_c > 1 else ''}"
111
112 num_v = data.num_vehicles
113 vehicle_text = f"{num_v} vehicle{'s' if num_v > 1 else ''}"
114
115 num_vt = data.num_vehicle_types
116 vehicle_type_text = f"{num_vt} vehicle type{'s' if num_vt > 1 else ''}"
117
118 msg = _START.format(
119 version=version("pyvrp"),
120 depot_text=depot_text,
121 client_text=client_text,
122 vehicle_text=vehicle_text,
123 vehicle_type_text=vehicle_type_text,
124 )
125
126 for line in msg.splitlines():
127 logger.info(line)
128
129 def end(self, result: Result):
130 """

Callers 4

runMethod · 0.95
test_startFunction · 0.95

Calls

no outgoing calls

Tested by 3

test_startFunction · 0.76