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

Method add_edge

pyvrp/Model.py:82–94  ·  view source on GitHub ↗

Adds a new edge to this routing profile.

(
        self,
        frm: Client | Depot,
        to: Client | Depot,
        distance: int,
        duration: int = 0,
    )

Source from the content-addressed store, hash-verified

80 self.name = name
81
82 def add_edge(
83 self,
84 frm: Client | Depot,
85 to: Client | Depot,
86 distance: int,
87 duration: int = 0,
88 ) -> Edge:
89 """
90 Adds a new edge to this routing profile.
91 """
92 edge = Edge(frm, to, distance, duration)
93 self.edges.append(edge)
94 return edge
95
96 def __str__(self) -> str:
97 return self.name

Callers

nothing calls this directly

Calls 2

EdgeClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected