Skip to content

Commit

Permalink
Merge pull request #178 from atlanticwave-sdx/175.default.latency
Browse files Browse the repository at this point in the history
#175: assign float(inf) to be the default request latency
  • Loading branch information
sajith authored Apr 24, 2024
2 parents 45c25be + 798a8ee commit da7c12d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/sdx_pce/topology/temanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@


class TEManager:

"""
TE Manager for connection - topology operations.
Expand Down Expand Up @@ -234,7 +233,7 @@ def generate_traffic_matrix(self, connection_request: dict) -> TrafficMatrix:
return None

required_bandwidth = request.bandwidth or 0
required_latency = request.latency or 0
required_latency = request.latency or float("inf")
request_id = request.id

self._logger.info(
Expand Down
8 changes: 4 additions & 4 deletions tests/test_te_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,16 @@ def test_generate_graph_and_connection_with_sax_2_valid(self):
self.assertEqual(request.source, 1)
self.assertEqual(request.destination, 0)
self.assertEqual(request.required_bandwidth, 0)
self.assertEqual(request.required_latency, 0)
self.assertEqual(request.required_latency, float("inf"))

solver = TESolver(graph, tm)
self.assertIsNotNone(solver)

# Solver will fail to find a solution here.
# Solver will find a solution here.
solution = solver.solve()
print(f"Solution to tm {tm}: {solution}")
self.assertIsNone(solution.connection_map, None)
self.assertEqual(solution.cost, 0.0)
self.assertIsNotNone(solution.connection_map, None)
self.assertEqual(solution.cost, 1.0)

def test_connection_amlight(self):
"""
Expand Down

0 comments on commit da7c12d

Please sign in to comment.