treeBlindLP module¶
- class panco.blind.treeBlindLP.TreeBlindLP(network: Network, foi: int, filename='tree_blind.lp')¶
Bases:
object
Class for the analysis for tree networks with blind multiplexing using linear programming techniques.
- Parameters:
network (Network) – the network to analyze (must be a well-numbered tree)
foi (int) – the flow of interest for computing the performance bound
filename (str) – the name of the file where the linear program is written
- property backlog: float¶
Computes the worst-case backlog of the flow of interest
- Returns:
the backlog of the flow of interest
- Return type:
float
>>> flows = [Flow([TokenBucket(1, 1)], [3, 4]), Flow([TokenBucket(2, 2)], [0, 3]), ... Flow([TokenBucket(3, 3)], [2, 4]), Flow([TokenBucket(4, 4)], [1, 3, 4])] >>> servers = [Server([RateLatency(10, 1), RateLatency(5, 0)], []), Server([RateLatency(20, 2)], []), ... Server([RateLatency(30, 3)], []), Server([RateLatency(40, 3)], [TokenBucket(1, 40)]), ... Server([RateLatency(50, 5)], [])] >>> arrival_shaping = [(3, [0], [TokenBucket(0, 10)]), (1, [3], [TokenBucket(0, 20)]), ... (2, [2], [TokenBucket(0, 30)]), (0, [1], [TokenBucket(0, 40)])] >>> tree = Network(servers, flows, arrival_shaping) >>> TreeBlindLP(tree, 0, 'test_tree_blind_backlog.lp').backlog 11.03419973
- backlog_objective(file)¶
Writes the backlog objective of the flow of interest.
- Parameters:
file – file where constraints are written
- Returns:
nothing
- backlog_set_objective(set_flows: List[int], file)¶
Writes the backlog objective of a set of flows of interest flow of interest.
- Parameters:
set_flows – set of flows of interest
file – the file where constraints are written
- Returns:
nothing
- backlog_set_of_flows(set_flows: List[int], max_burst: float) float ¶
Computes the worst-case backlog of a set of flows of interest.
Warning: do not use if you do not master [Bou19], implemented for the iterative method.
- Parameters:
set_flows (List[int]) – set of flows of interest
max_burst (float) – maximum burst during the current iteration
- Returns:
the maximum backlog of the set of flows for the next iteration
- Return type:
float
- burst_constraints(file)¶
Write the burst constraints (in a tree, bursts are equal to the sigma parameter of the flows)
- Parameters:
file – file where to write the constraints
- Returns:
nothing
- property delay: float¶
Computes the worst-case delay of the flow of interest
WARNING: Flows must have a single token-bucket. otherwise, put them in the arrival shaping.
- Returns:
the delay of the flow of interest
- Return type:
float
>>> flows = [Flow([TokenBucket(1, 1)], [3, 4]), Flow([TokenBucket(2, 2)], [0, 3]), ... Flow([TokenBucket(3, 3)], [2, 4]), Flow([TokenBucket(4, 4)], [1, 3, 4])] >>> servers = [Server([RateLatency(10, 1), RateLatency(5, 0)], []), Server([RateLatency(20, 2)], []), ... Server([RateLatency(30, 3)], []), Server([RateLatency(40, 3)], [TokenBucket(1, 40)]), ... Server([RateLatency(50, 5)], [])] >>> arrival_shaping = [(3, [0], [TokenBucket(0, 10)]), (1, [3], [TokenBucket(0, 20)]), ... (2, [2], [TokenBucket(0, 30)]), (0, [1], [TokenBucket(0, 40)])] >>> tree = Network(servers, flows, arrival_shaping) >>> TreeBlindLP(tree, 0, 'test_tree_blind.lp').delay 10.06361149
- delay_objective(file)¶
Writes the delay objective and some additional constraints for the flow of interest
- Parameters:
file – file where constraints are written
- Returns:
nothing