pm4py.algo.analysis.extended_marking_equation.variants.classic module#
- class pm4py.algo.analysis.extended_marking_equation.variants.classic.Parameters(*values)[source]#
Bases:
Enum- CASE_ID_KEY = 'pm4py:param:case_id_key'#
- ACTIVITY_KEY = 'pm4py:param:activity_key'#
- MAX_K_VALUE = 'max_k_value'#
- COSTS = 'costs'#
- SPLIT_IDX = 'split_idx'#
- INCIDENCE_MATRIX = 'incidence_matrix'#
- A = 'A_matrix'#
- CONSUMPTION_MATRIX = 'consumption_matrix'#
- C = 'C_matrix'#
- FULL_BOOTSTRAP_REQUIRED = 'full_bootstrap_required'#
- class pm4py.algo.analysis.extended_marking_equation.variants.classic.ExtendedMarkingEquationSolver(trace: Trace, sync_net: PetriNet, sync_im: Marking, sync_fm: Marking, parameters: Dict[Any, Any] | None = None)[source]#
Bases:
object- get_components() Tuple[Any, Any, Any, Any, Any][source]#
Retrieve the components (Numpy matrixes) of the problem
- Returns:
c – objective function
Aub – Inequalities matrix
bub – Inequalities vector
Aeq – Equalities matrix
beq – Equalities vector
- change_ini_vec(ini: Marking)[source]#
Changes the initial marking of the synchronous product net
- Parameters:
ini – Initial marking
- get_x_vector(sol_points: List[int]) List[int][source]#
Returns the x vector of the solution
- Parameters:
sol_points – Solution of the integer problem
- Returns:
X vector
- Return type:
x
- get_h(sol_points: List[int]) int[source]#
Returns the value of the heuristics
- Parameters:
sol_points – Solution of the integer problem
- Returns:
Heuristics value
- Return type:
h
- get_activated_transitions(sol_points: List[int]) List[Transition][source]#
Gets the transitions of the synchronous product net that are non-zero in the solution of the marking equation
- Parameters:
sol_points – Solution of the integer problem
- Returns:
Activated transitions
- Return type:
act_trans
- solve(variant=None) Tuple[int, List[int]][source]#
Solves the extended marking equation, returning the heuristics and the x vector
- Parameters:
variant – Variant of the ILP solver to use
- Returns:
h – Heuristics value
x – X vector
- get_firing_sequence(x: List[int]) Tuple[List[Transition], bool, int][source]#
Gets a firing sequence from the X vector
- Parameters:
x – X vector
- Returns:
firing_sequence – Firing sequence
reach_fm – Boolean value that is true whether the firing sequence reaches the final marking
explained_events – Number of explaned events by the firing sequence
- pm4py.algo.analysis.extended_marking_equation.variants.classic.build(trace: Trace, sync_net: PetriNet, sync_im: Marking, sync_fm: Marking, parameters: Dict[Any, Any] | None = None) ExtendedMarkingEquationSolver[source]#
Builds the extended marking equation out of a trace and a synchronous product net
- Parameters:
trace – Trace
sync_net – Synchronous product net
sync_im – Initial marking (of sync net)
sync_fm – Final marking (of sync net)
parameters – Parameters of the algorithm, including: - Parameters.CASE_ID_KEY => attribute to use as case identifier - Parameters.ACTIVITY_KEY => attribute to use as activity - Parameters.COSTS => (if provided) the cost function (otherwise the default cost function is applied) - Parameters.SPLIT_IDX => (if provided) the split points as indices of elements of the trace
(e.g. for [“A”, “B”, “C”, “D”, “E”], specifying [1,3] as split points means splitting at “B” and “D”). If not provided, some split points at uniform distances are found.
- Parameters.MAX_K_VALUE => the maximum number of split points that is allowed (trim the specified indexes
if necessary).
Parameters.INCIDENCE_MATRIX => (if provided) the incidence matrix associated to the sync product net
Parameters.A => (if provided) the A numpy matrix of the incidence matrix
Parameters.CONSUMPTION_MATRIX => (if provided) the consumption matrix associated to the sync product net
Parameters.C => (if provided) the C numpy matrix of the consumption matrix
Parameters.FULL_BOOTSTRAP_REQUIRED => The preset/postset of places/transitions need to be inserted
- pm4py.algo.analysis.extended_marking_equation.variants.classic.get_h_value(solver: ExtendedMarkingEquationSolver, parameters: Dict[Any, Any] | None = None) int[source]#
Gets the heuristics value from the extended marking equation
- Parameters:
solver – Extended marking equation solver (class in this file)
parameters – Possible parameters of the algorithm