Skip to content

Commit

Permalink
handle missing edge cost value in the gpdp evaluate function
Browse files Browse the repository at this point in the history
  • Loading branch information
g-poveda committed Feb 27, 2024
1 parent 0601051 commit 9acace9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discrete_optimization/pickup_vrp/gpdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def evaluate(self, variable: GPDPSolution) -> Dict[str, float]: # type: ignore
def compute_distance(self, path: List[Node]) -> float:
distance = 0.0
for i in range(len(path) - 1):
distance += self.distance_delta[path[i]][path[i + 1]]
distance += self.distance_delta[path[i]].get(path[i + 1], 1000000)
return distance

def evaluate_function_node(self, node_1: Node, node_2: Node) -> float:
Expand Down

0 comments on commit 9acace9

Please sign in to comment.