pm4py.algo.analysis.marking_equation.variants.classic module#
- class pm4py.algo.analysis.marking_equation.variants.classic.Parameters(*values)[source]#
Bases:
Enum- CASE_ID_KEY = 'pm4py:param:case_id_key'#
- ACTIVITY_KEY = 'pm4py:param:activity_key'#
- COSTS = 'costs'#
- INCIDENCE_MATRIX = 'incidence_matrix'#
- A = 'A_matrix'#
- FULL_BOOTSTRAP_REQUIRED = 'full_bootstrap_required'#
- class pm4py.algo.analysis.marking_equation.variants.classic.MarkingEquationSolver(net: PetriNet, im: Marking, 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() Tuple[int, List[int]][source]#
Solves the marking equation, returning the heuristics and the x vector
- Returns:
h – Heuristics value
x – X vector
- solve_given_components(c, Aub, bub, Aeq, beq)[source]#
Solves the linear problem given the components
- Parameters:
c – Objective vector
Aub – Inequalities matrix
bub – Inequalities vector
Aeq – Equalities matrix
beq – Equalities vector
- 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.marking_equation.variants.classic.build(net: PetriNet, im: Marking, fm: Marking, parameters: Dict[Any, Any] | None = None) MarkingEquationSolver[source]#
Builds the marking equation out of a Petri net
- Parameters:
net – Petri net
im – Initial marking
fm – Final marking
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.INCIDENCE_MATRIX => (if provided) the incidence matrix of the Petri net - Parameters.A => (if provided) the A numpy matrix of the incidence matrix - Parameters.FULL_BOOTSTRAP_REQUIRED => The preset/postset of places/transitions need to be inserted
- pm4py.algo.analysis.marking_equation.variants.classic.get_h_value(solver: MarkingEquationSolver, parameters: Dict[Any, Any] | None = None) int[source]#
Gets the heuristics value from the marking equation
- Parameters:
solver – Marking equation solver (class in this file)
parameters – Possible parameters of the algorithm