specless.inference.timed_partial_order.TimeConstraintsLP
- class specless.inference.timed_partial_order.TimeConstraintsLP(traces, partial_order, decimals: int = 2, threshold: float = 0.5, slack_threshold: float = 0.1)[source]
Bases:
object
Handle Time Constraints Operation for Linear Programming
- events A set of events
- pairs A set of event pairs
- Type:
source, target
- event_to_bound A dictionary that maps an event to
- Type:
lb, ub
- event_pair_to_bound A dictionary that maps an event pair to
- Type:
lb, ub
- A, b
- event_to_index
- pair_to_index
Methods
Construct Linear Programming Constraints
Get the event variable index (column index)
Get Constraint String
Get Constraints A and b without the specified constraint
Get Event from index
Get an index for the given constraint (row index)
Find which event the indices are refering to
Translate a constraint to an strin
Get Lower/Upper bound for the event pair
Get Pair From index
Get Index of the constraint
Get a row of the provided constraint
Get Sign
Check whther the constraint was redudant by analyzing the changes between the original bound and the new bound
Remove the constraint
Set Event Lower/Upper Bound
Set Pair Lower/Upper Bound
Solve for the specified constraint.
- get_constraint_string(source_event: str, target_event: str, get_lb: bool, decimals: int) str [source]
Get Constraint String
- get_constraints_without(source_event: str, target_event: str, get_lb: bool) Tuple[ndarray, ndarray] [source]
Get Constraints A and b without the specified constraint
- get_event_row_index(event: str, get_lb: bool) int [source]
Get an index for the given constraint (row index)
- get_events_string(source_event: str, target_event: str) str [source]
Translate a constraint to an strin
- get_pair_bound(source_event: str, target_event: str, get_lb: bool) float [source]
Get Lower/Upper bound for the event pair
- get_pair_row_index(source_event: str, target_event: str, get_lb: bool) int [source]
Get Index of the constraint
- get_row(source_event: str, target_event: str, get_lb: bool) ndarray [source]
Get a row of the provided constraint
- is_redundant(orig_bound: float, new_bound: float, lb: bool, threshold: float) bool [source]
Check whther the constraint was redudant by analyzing the changes between the original bound and the new bound
- set_event_bound(event: str, lb: float | None = None, ub: float | None = None) None [source]
Set Event Lower/Upper Bound
- set_pair_bound(source_event: str, target_event: str, lb: float | None = None, ub: float | None = None) None [source]
Set Pair Lower/Upper Bound
- solvefor(source_event: str, target_event: str, lb: bool, decimals: int | None = None, threshold: float | None = None, slack_threshold: float | None = None, debug: bool = False) Dict [source]
Solve for the specified constraint. 1. Remove the specified constraint from the constraint list 2. Optimize for the specified constraint (minimize if lb or else maximize if ub) 3. If the constraint was identified “redundant”, return all the information