Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OPTIS_App
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OPTIS
OPTIS_App
Commits
150699f0
Commit
150699f0
authored
1 year ago
by
Aleksandra Dimitrova
Browse files
Options
Downloads
Patches
Plain Diff
adding missed modifications in the last commit
parent
88a9ab1b
Branches
aleks4
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/Tests/testagent.py
+2
-4
2 additions, 4 deletions
backend/Tests/testagent.py
backend/eventlog.py
+17
-0
17 additions, 0 deletions
backend/eventlog.py
backend/petrinet.py
+3
-0
3 additions, 0 deletions
backend/petrinet.py
with
22 additions
and
4 deletions
backend/Tests/testagent.py
+
2
−
4
View file @
150699f0
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
backend/eventlog.py
+
17
−
0
View file @
150699f0
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
backend/petrinet.py
+
3
−
0
View file @
150699f0
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment