pm4py.algo.analysis.marking_equation.variants package

Submodules

pm4py.algo.analysis.marking_equation.variants.classic module

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.algo.analysis.marking_equation.variants.classic.MarkingEquationSolver(net: pm4py.objects.petri_net.obj.PetriNet, im: pm4py.objects.petri_net.obj.Marking, fm: pm4py.objects.petri_net.obj.Marking, parameters: Optional[Dict[Any, Any]] = None)[source]

Bases: object

change_ini_vec(ini: pm4py.objects.petri_net.obj.Marking)[source]

Changes the initial marking of the synchronous product net

Parameters:ini – Initial marking
get_activated_transitions(sol_points: List[int]) → List[pm4py.objects.petri_net.obj.PetriNet.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
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
get_firing_sequence(x: List[int]) → Tuple[List[pm4py.objects.petri_net.obj.PetriNet.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
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_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
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

class pm4py.algo.analysis.marking_equation.variants.classic.Parameters[source]

Bases: enum.Enum

An enumeration.

A = 'A_matrix'
ACTIVITY_KEY = 'pm4py:param:activity_key'
CASE_ID_KEY = 'pm4py:param:case_id_key'
COSTS = 'costs'
FULL_BOOTSTRAP_REQUIRED = 'full_bootstrap_required'
INCIDENCE_MATRIX = 'incidence_matrix'
pm4py.algo.analysis.marking_equation.variants.classic.build(net: pm4py.objects.petri_net.obj.PetriNet, im: pm4py.objects.petri_net.obj.Marking, fm: pm4py.objects.petri_net.obj.Marking, parameters: Optional[Dict[Any, Any]] = None) → pm4py.algo.analysis.marking_equation.variants.classic.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: pm4py.algo.analysis.marking_equation.variants.classic.MarkingEquationSolver, parameters: Optional[Dict[Any, Any]] = 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

Module contents

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.