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

Method summary

pyvrp/Result.py:60–78  ·  view source on GitHub ↗

Returns a nicely formatted result summary.

(self)

Source from the content-addressed store, hash-verified

58 return self.best.is_feasible()
59
60 def summary(self) -> str:
61 """
62 Returns a nicely formatted result summary.
63 """
64 obj_str = f"{self.cost()}" if self.is_feasible() else "INFEASIBLE"
65 summary = [
66 "Solution results",
67 "================",
68 f" # routes: {self.best.num_routes()}",
69 f" # trips: {self.best.num_trips()}",
70 f" # clients: {self.best.num_clients()}",
71 f" objective: {obj_str}",
72 f" distance: {self.best.distance()}",
73 f" duration: {self.best.duration()}",
74 f"# iterations: {self.num_iterations}",
75 f" run-time: {self.runtime:.2f} seconds",
76 ]
77
78 return "\n".join(summary)
79
80 def __str__(self) -> str:
81 content = [

Callers 5

__str__Method · 0.95
test_endFunction · 0.95
endMethod · 0.80

Calls 5

costMethod · 0.95
is_feasibleMethod · 0.95
num_clientsMethod · 0.80
distanceMethod · 0.45
durationMethod · 0.45

Tested by 3

test_endFunction · 0.76