Treating TESolver and TopologyManager classes as private implementation details should make this library easier to use, and thus reduce the chances of confusion. We could:
Make TEManager provide all of the surface API to PCE, by moving TESolver and TopologyManager classes to a private module.
"Gate" the necessary methods via TEManager.
As a more concrete example, consider this code sample from the README:
from sdx_pce.load_balancing.te_solver import TESolver
from sdx_pce.topology.temanager import TEManager
temanager = TEManager(initial_topology)
for topology in topologies:
temanager.add_topology(topology)
graph = temanager.generate_graph_te()
traffic_matrix = temanager.generate_traffic_matrix(connection_request)
solution = TESolver(graph, traffic_matrix).solve()
breakdown = temanager.generate_connection_breakdown(solution)
for domain, link in breakdown.items():
# publish(domain, link)
This would become:
from sdx_pce.topology.temanager import TEManager
temanager = TEManager(initial_topology)
for topology in topologies:
temanager.add_topology(topology)
# generate graph, traffic matrix, and call TESolver.solve()
solution = temanager.solve(connection_request)
breakdown = temanager.generate_connection_breakdown(solution)
for domain, link in breakdown.items():
# publish(domain, link)
Or maybe even:
from sdx_pce.topology.temanager import TEManager
temanager = TEManager(initial_topology)
for topology in topologies:
temanager.add_topology(topology)
# generate graph, traffic matrix, call TESolver.solve(), and
# then return a breakdown usable across domain.
breakdown = temanager.solve(connection_request)
for domain, link in breakdown.items():
# publish(domain, link)
Treating
TESolver
andTopologyManager
classes as private implementation details should make this library easier to use, and thus reduce the chances of confusion. We could:TEManager
provide all of the surface API to PCE, by movingTESolver
andTopologyManager
classes to a private module.TEManager
.As a more concrete example, consider this code sample from the README:
This would become:
Or maybe even: