Closed gertjanssenswillen closed 4 years ago
Dear Gert,
With the command, you are not picking the place from the existing Petri net, but instead creating a completely new place that is not contained in the Petri net
Hence the error!
To pick an existing place, a way is list comprehension, like:
my_place = [p for p in net.places if p.name = "1d7d1b3f-ec36-410f-a0e8-65c7f905cd80"][0] initial_marking = {my_place: 1}
I'm trying to compute alignments for a petri net, and a log. The difficulty is that the both are imported, the net is not discovered from the log with pm4py Additional difficulty, when the net is imported, the initial marking is empty. So I tried to create one myself.
The error is the following:
`Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users/lucp8407/Documents/UH - Local/Python workspace/pm4py/ccc.py', wdir='C:/Users/lucp8407/Documents/UH - Local/Python workspace/pm4py')
File "C:\Users\lucp8407\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile execfile(filename, namespace)
File "C:\Users\lucp8407\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/lucp8407/Documents/UH - Local/Python workspace/pm4py/ccc.py", line 26, in
alignments = align_factory.apply_log(log, net, initial_marking, final_marking)
File "C:\Users\lucp8407\AppData\Local\Continuum\anaconda3\lib\site-packages\pm4py\algo\conformance\alignments\factory.py", line 139, in apply_log best_worst_cost = VERSIONS_COST[version](petri_net, initial_marking, final_marking, parameters=parameters)
File "C:\Users\lucp8407\AppData\Local\Continuum\anaconda3\lib\site-packages\pm4py\algo\conformance\alignments\versions\state_equation_a_star.py", line 72, in get_best_worst_cost parameters=new_parameters)
File "C:\Users\lucp8407\AppData\Local\Continuum\anaconda3\lib\site-packages\pm4py\algo\conformance\alignments\versions\state_equation_a_star.py", line 159, in apply trace_net_costs, parameters[PARAM_MODEL_COST_FUNCTION], revised_sync)
File "C:\Users\lucp8407\AppData\Local\Continuum\anaconda3\lib\site-packages\pm4py\objects\petri\synchronous_product.py", line 104, in construct_cost_aware sync_im[p2_map[p]] = im2[p]
KeyError: 1d7d1b3f-ec36-410f-a0e8-65c7f905cd80`
Any idea's what the cause might be, what I am doing wrong?
There's also a warning related to import_net being deprecated. What is the correct function, I based myself upon the documentation on the website?