pm4py.objects.stochastic_petri.ctmc module#
- pm4py.objects.stochastic_petri.ctmc.get_corr_hex(num)[source]#
Gets correspondence between a number and an hexadecimal string
- Parameters:
num – Number
- Returns:
Hexadecimal string
- Return type:
hex_string
- pm4py.objects.stochastic_petri.ctmc.get_color_from_probabilities(prob_dictionary)[source]#
Returns colors from a dictionary of probabilities
- Parameters:
prob_dictionary – Dictionary of probabilities
- Returns:
Dictionary of colors
- Return type:
color_dictionary
- pm4py.objects.stochastic_petri.ctmc.get_tangible_reachability_and_q_matrix_from_dfg_performance(dfg_performance, invisible_firing_rate=1000.0, parameters=None)[source]#
Get the tangible reachability graph and the Q matrix from the performance DFG
- Parameters:
dfg_performance – Performance DFG
invisible_firing_rate – Firing rate for invisible transitions
parameters – Parameters
- Returns:
reachab_graph – Reachability graph
tangible_reach_graph – Tangible reachability graph
stochastic_info – Stochastic information
q_matrix – Q-matrix from the tangible reachability graph
- pm4py.objects.stochastic_petri.ctmc.get_tangible_reachability_and_q_matrix_from_log_net(log, net, im, fm, parameters=None)[source]#
Gets the tangible reachability graph from a log and an accepting Petri net
- Parameters:
log – Event log
net – Petri net
im – Initial marking
fm – Final marking
- Returns:
reachab_graph – Reachability graph
tangible_reach_graph – Tangible reachability graph
stochastic_info – Stochastic information
q_matrix – Q-matrix from the tangible reachability graph
- pm4py.objects.stochastic_petri.ctmc.transient_analysis_from_petri_net_and_smap(net, im, s_map, delay, parameters=None)[source]#
Gets the transient analysis from a Petri net, a stochastic map and a delay
- Parameters:
log – Event log
delay – Time delay
parameters – Parameters of the algorithm
- Returns:
Transient analysis result
- Return type:
transient_result
- pm4py.objects.stochastic_petri.ctmc.get_q_matrix_from_tangible_exponential(tangible_reach_graph, stochastic_info)[source]#
Gets Q matrix from tangible reachability graph and stochastic map where the distribution type has been forced to be exponential
- Parameters:
tangible_reach_graph – Tangible reachability graph
stochastic_info – Stochastic map for each transition
- Returns:
Q-matrix from the tangible reachability graph
- Return type:
q_matrix
- pm4py.objects.stochastic_petri.ctmc.transient_analysis_from_tangible_q_matrix_and_single_state(tangible_reach_graph, q_matrix, source_state, time_diff)[source]#
Do transient analysis from tangible reachability graph, Q matrix and a single state to start from
- Parameters:
tangible_reach_graph – Tangible reachability graph
q_matrix – Q matrix
source_state – Source state to consider
time_diff – Time interval we want to investigate
- Returns:
Transient analysis result
- Return type:
transient_result
- pm4py.objects.stochastic_petri.ctmc.transient_analysis_from_tangible_q_matrix_and_states_vector(tangible_reach_graph, q_matrix, states_vector, time_diff)[source]#
Do transient analysis from tangible reachability graph, Q matrix and a vector of probability of states
- Parameters:
tangible_reach_graph – Tangible reachability graph
q_matrix – Q matrix
states_vector – Vector of states probabilities to start from
time_diff – Time interval we want to investigate
- Returns:
Transient analysis result
- Return type:
transient_result
- pm4py.objects.stochastic_petri.ctmc.nullspace(a_matrix, atol=1e-13, rtol=0)[source]#
Compute an approximate basis for the nullspace of A.
The algorithm used by this function is based on the singular value decomposition of A.
- Parameters:
a_matrix (ndarray) – A should be at most 2-D. A 1-D array with length k will be treated as a 2-D with shape (1, k)
atol (float) – The absolute tolerance for a zero singular value. Singular values smaller than atol are considered to be zero.
rtol (float) – The relative tolerance. Singular values less than rtol*smax are considered to be zero, where smax is the largest singular value.
If both `atol` and `rtol` are positive, the combined tolerance is the
maximum of the two; that is:: – tol = max(atol, rtol * smax)
Singular values smaller than `tol` are considered to be zero.
- Returns:
ns – If A is an array with shape (m, k), then ns will be an array with shape (k, n), where n is the estimated dimension of the nullspace of A. The columns of ns are a basis for the nullspace; each element in numpy.dot(A, ns) will be approximately zero.
- Return type:
ndarray