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

Method _depots

pyvrp/read.py:369–385  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

367 )
368
369 def _depots(self) -> list[Depot]:
370 num_depots = self.parser.num_depots
371 depot_idcs = self.parser.depot_idcs()
372
373 contiguous_lower_idcs = np.arange(num_depots)
374 if num_depots == 0 or (depot_idcs != contiguous_lower_idcs).any():
375 msg = """
376 Source file should contain at least one depot in the contiguous
377 lower indices, starting from 1.
378 """
379 raise ValueError(msg)
380
381 coords = self.parser.coords()
382 return [
383 Depot(x=coords[idx][0], y=coords[idx][1])
384 for idx in range(num_depots)
385 ]
386
387 def _clients(self) -> list[Client]:
388 groups = self.parser.mutually_exclusive_groups()

Callers 1

dataMethod · 0.95

Calls 4

DepotClass · 0.85
depot_idcsMethod · 0.80
anyMethod · 0.80
coordsMethod · 0.80

Tested by

no test coverage detected