Skip to content
Snippets Groups Projects
Commit 150699f0 authored by Aleksandra Dimitrova's avatar Aleksandra Dimitrova
Browse files

adding missed modifications in the last commit

parent 88a9ab1b
Branches aleks4
No related tags found
No related merge requests found
......@@ -50,8 +50,6 @@ activities = 16
# dqn.train(space, activities)
# dqn.train(space, activities)
''''''
# generate event log
env = simpy.Environment()
......@@ -59,10 +57,10 @@ business_process = model.BusinessProcess(env, ressources)
business_process.event_log_flag = True
env.process(model.run_process(env, business_process))
env.run(until = 30000)
log.export_to_csv(business_process, r'C:\Users\nourm\OneDrive\Desktop\Nour\optis_app\backend\eventlog_test\optis.csv')
log.export_to_csv(business_process, r'..\Frontend\export\testeventlog')
# extract active cases from event log
active_cases = log.get_active_cases()
active_cases = log.get_active_cases("testeventlog.csv")
print(active_cases)
......
......@@ -388,6 +388,8 @@ def generate_event_log(start_timestamp, time):
Parameters
----------
start_timestamp : datetime
the start date and time of the simulation
time : int
the time units for which the simulation is supposed to run
"""
......@@ -435,6 +437,21 @@ def generate_event_log(start_timestamp, time):
export_to_xes(business_process, r'export/elog.xes') #local
def get_case_information(case_id, name):
"""Generate an event log from the simulation model and export it to .csv and .xes
Parameters
----------
case_id : int
the case-id of a case in the event log
name : str
name of the event log file
Returns
-------
pandas.DataFrame
a dataframe containing all the events that happened for a certain case
"""
event_log = convert_to_dataframe(name)
# Sort the event log by case ID and start timestamp
event_log.sort_values(by=['CaseID', 'StartTimestamp'], inplace=True)
......
......@@ -3,6 +3,7 @@
The module includes the following functions:
* generate_petri_net() - generates a petri-net represenation of the business process
* process_petri_net(): saves the process's petri-net as a png so that it can be used as a static image
* decorate_petri_net(case, name) - exports a .png of a petri-net with the case trace colored
* decorate_petri_net_with_rec(case, rec, name) - exports a .png of a petri-net with the case trace and the recommendation colored
"""
......@@ -49,6 +50,8 @@ def generate_petri_net():
return net, initial_marking, final_marking
def process_petri_net():
"""Function which we use to create the business process's petri-net and save it as a png so we can use it as a static image
"""
net, initial_marking, final_marking = generate_petri_net()
decoration = {}
for p in net.places:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment