diff --git a/Dockerfile b/Dockerfile index 237aba9d7d54c4573c85b8bc59dcf5a6031747d7..8dae610fba73c11f5c37158b0f0fac4d6c6170dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,10 @@ RUN apt-get install -y graphviz # copy every content from the local file to the image COPY . . +WORKDIR /app/Frontend + # configure the container to run in an executed manner ENTRYPOINT [ "python" ] # RUN chmod 644 Frontend/main.py -CMD ["Frontend/main.py" ] +CMD ["main.py" ] diff --git a/Frontend/static/net.png b/Frontend/static/net.png index 8366921b9e46cb86a778eb9ecff958710ab7c90c..5e496d527dad115255c9a79be871b04582723c21 100644 Binary files a/Frontend/static/net.png and b/Frontend/static/net.png differ diff --git a/Frontend/static/preview_net.png b/Frontend/static/preview_net.png index 4c886acac6b1cfadf4e6e9d25f3c87563fe7bf38..9cd458c38aa97891aa12f1a8f7383129aa8b964d 100644 Binary files a/Frontend/static/preview_net.png and b/Frontend/static/preview_net.png differ diff --git a/Frontend/static/process_net.png b/Frontend/static/process_net.png index cb472bd29eba5a493233367c319c6d4548043cf8..39c56cfa0481e6f81fd9bd7bfe5386712bad09db 100644 Binary files a/Frontend/static/process_net.png and b/Frontend/static/process_net.png differ diff --git a/Frontend/static/styles.css b/Frontend/static/styles.css index e7360356f9141ec0ea93cb98a71f1396c4e1da89..ab22263e10fda004f1eed88833185dd667cbc62b 100644 --- a/Frontend/static/styles.css +++ b/Frontend/static/styles.css @@ -45,10 +45,18 @@ th, td { margin:0px; } +.contents{ + margin-top: 5%; +} + /* Add a black background color to the top navigation */ .topnav { background-color:rgb(0,114,188); overflow: hidden; + position: fixed; + top: 0; + left: 0; + width: 100%; } /* Style the links inside the navigation bar */ diff --git a/Frontend/static/user_manual.pdf b/Frontend/static/user_manual.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ae3b2fbac4eb6f759329487057ddb53763b1c77f Binary files /dev/null and b/Frontend/static/user_manual.pdf differ diff --git a/Frontend/templates/aboutus.html b/Frontend/templates/aboutus.html index aa332ae318996c77115be22812d4137dd43089ac..30628e3ccf46f91aa984479aed0c86af02e460bc 100644 --- a/Frontend/templates/aboutus.html +++ b/Frontend/templates/aboutus.html @@ -5,7 +5,7 @@ {% endblock %} {% block body %} -<div style='text-align:center'> +<div class="contents" style='text-align:center'> <h1>This is a project from the Chair of Process and Data Science from RWTH Aachen University</h1> <img src="{{url_for('static',filename='moyai.jpg')}}" alt="Placeholder"> <br> <h2>by: Ahmad Mannoun, Aleksandra Dimitrova, Geno Jayadi, Paula Hermenau </h2> diff --git a/Frontend/templates/case.html b/Frontend/templates/case.html index ca55b4d8ffb81dbdd6fc263bc3ba85df09b62c3c..430e221722eee14244730297c3ba31b393471e07 100644 --- a/Frontend/templates/case.html +++ b/Frontend/templates/case.html @@ -8,7 +8,7 @@ {% endblock %} {% block body %} -<div style="text-align: center; margin-top: 10px;" class="custom-select" > +<div class="contents" style="text-align: center;" class="custom-select" > Choose which case you want to optimize: <!-- This is the form for directly sending case ID to be processed by the agent. --> diff --git a/Frontend/templates/index.html b/Frontend/templates/index.html index a2ef9ca4ef235db9964059a71017fa491e0f0689..5b456ac29347b138856d1ffdb15205c4148ecb19 100644 --- a/Frontend/templates/index.html +++ b/Frontend/templates/index.html @@ -6,24 +6,26 @@ {% endblock %} {% block body %} - <header style="text-align: center;"> - <img src="/static/OPTIS_logo3.png" alt="Placeholder" style="max-width: 50%; padding: 40px; margin-top: 40px;"> - </header> + <div class="contents"> + <header style="text-align: center;"> + <img src="/static/OPTIS_logo3.png" alt="Placeholder" style="max-width: 50%; padding: 40px; margin-top: 40px;"> + </header> - <div style="text-align: center; padding-top: 40 px;"> - <h1 class="introductions" style="color: rgb(0,114,188);">Introduction</h1> - <text class="desc">OPTIS is a standalone Python based web application which aims to minimize time requirements of busines processes. <br> It seeks to achieve this by using an intelligent agent that is trained using reinforcement learning techniques. <br> Learn more about the app <a href="info.html">here</a>! <br></text> - </div> - - <div style="text-align: center; padding-top: 40 px; margin-top: 20px;"> - <text class="desc">Make sure to read the <a href="{{ url_for('static', filename='User_Manual.pdf') }}">user manual</a> and have fun optimizing your process!</text> - </div> + <div style="text-align: center; padding-top: 40 px;"> + <h1 class="introductions" style="color: rgb(0,114,188);">Introduction</h1> + <text class="desc">OPTIS is a standalone Python based web application which aims to minimize time requirements of busines processes. <br> It seeks to achieve this by using an intelligent agent that is trained using reinforcement learning techniques. <br> Learn more about the app <a href="info.html">here</a>! <br></text> + </div> - <form id="gotoStart" method="post" name="gotoStart"> - <div style = "text-align: center;"> - <!--Submit button--> - <button type="submit" class="button" form="gotoStart" style="margin-top: 50px;"> Optimize now!</button> + <div style="text-align: center; padding-top: 40 px; margin-top: 20px;"> + <text class="desc">Make sure to read the <a href="{{ url_for('static', filename='user_manual.pdf') }}">user manual</a> and have fun optimizing your process!</text> </div> - </form> + + <form id="gotoStart" method="post" name="gotoStart"> + <div style = "text-align: center;"> + <!--Submit button--> + <button type="submit" class="button" form="gotoStart" style="margin-top: 50px;"> Optimize now!</button> + </div> + </form> + </div> {% endblock %} \ No newline at end of file diff --git a/Frontend/templates/info.html b/Frontend/templates/info.html index 16de4cc0ed56dea606925c69bd1847983afec3e4..47fa9dec67d5587b8a9d8424220eb1a9f1f7baf9 100644 --- a/Frontend/templates/info.html +++ b/Frontend/templates/info.html @@ -5,7 +5,7 @@ {% endblock %} {% block body %} - <div style="text-align: center; padding-top: 40 px;"> + <div class="contents" style="text-align: center; padding-top: 40 px;"> <h1 class="introductions" style="color: rgb(0,114,188);">What does OPTIS do?</h1> <text class="desc">OPTIS is a standalone Python based web application which aims to minimize time requirements of busines processes. <br> It's customized to work on a single business process: diff --git a/Frontend/templates/preview.html b/Frontend/templates/preview.html index 4527cc172fe0b07cb0e5e61a8b42dc0065247fa8..c4b1993f0bb0ed0a3a863ef80358170a681cde28 100644 --- a/Frontend/templates/preview.html +++ b/Frontend/templates/preview.html @@ -5,7 +5,7 @@ {%endblock%} {%block body%} -<div style="text-align: center;"> +<div class="contents" style="text-align: center;"> <h1>File Preview: {{ filename }}</h1> <p>Preview the first {{ row_count }} rows of your uploaded event log to make sure you've uploaded the right file.</p> <table> diff --git a/Frontend/templates/result.html b/Frontend/templates/result.html index 729f646bb9f49f35a0d868e6c1d9a78e66680ba3..7c19f75022ccf79829b7e328a8a570954dfd1a66 100644 --- a/Frontend/templates/result.html +++ b/Frontend/templates/result.html @@ -9,7 +9,7 @@ {%endblock%} {%block body%} -<div style="text-align: center;"> +<div class="contents" style="text-align: center;"> <h1>Here are the results of the optimization!</h1> <h2>We recommend you to do the following activity for this specific case: {{name}}</h2> <!--res is the result--> diff --git a/Frontend/templates/start.html b/Frontend/templates/start.html index 9856d5767b1376907c735b5758f060cfba65b8b9..a768327a57838bd093694d2172c494d818d9f9da 100644 --- a/Frontend/templates/start.html +++ b/Frontend/templates/start.html @@ -6,7 +6,7 @@ {% endblock %} {% block body %} - <div style="text-align: center;"> + <div class = "contents" style="text-align: center;"> <h1>Upload your files and get started now!</h1> <!--This is the upload functionality. It automatically already filters for xes and csv file. However, a warning is added nonetheless for user experience.--> <form action="{{ url_for('upload_file') }}" method="POST" enctype="multipart/form-data" name="upload"> diff --git a/backend/__pycache__/businessprocess.cpython-311.pyc b/backend/__pycache__/businessprocess.cpython-311.pyc index b6f04a576873684deaf809179ad802bd4d2d87ef..a580e36c64da5d35fad56190cb79a6f49875e631 100644 Binary files a/backend/__pycache__/businessprocess.cpython-311.pyc and b/backend/__pycache__/businessprocess.cpython-311.pyc differ diff --git a/backend/__pycache__/case.cpython-311.pyc b/backend/__pycache__/case.cpython-311.pyc index 3b2628846fceeaa96fc6ca86cddbe07f2980b3fe..99c33626418ce6d23efb7d20076581d25a471ce4 100644 Binary files a/backend/__pycache__/case.cpython-311.pyc and b/backend/__pycache__/case.cpython-311.pyc differ diff --git a/backend/__pycache__/dqn.cpython-311.pyc b/backend/__pycache__/dqn.cpython-311.pyc index 076b9498a5fe6028b2cc6bfe9d18fcf383ed9d97..09e5cf216cd4ff0d14f675ac554d994d78fb7ea3 100644 Binary files a/backend/__pycache__/dqn.cpython-311.pyc and b/backend/__pycache__/dqn.cpython-311.pyc differ diff --git a/backend/__pycache__/environment.cpython-311.pyc b/backend/__pycache__/environment.cpython-311.pyc index bf8bdd6f8abf57d44d7d31e285c1f817d1686836..60619c9ae81a91e3a545648b79c523c08e8db24e 100644 Binary files a/backend/__pycache__/environment.cpython-311.pyc and b/backend/__pycache__/environment.cpython-311.pyc differ diff --git a/backend/__pycache__/eventlog.cpython-311.pyc b/backend/__pycache__/eventlog.cpython-311.pyc index c8a819fc6da9b70e6008a966e287198171f68b99..b667180f002b3a5262a9a5545c0823391b79e7d3 100644 Binary files a/backend/__pycache__/eventlog.cpython-311.pyc and b/backend/__pycache__/eventlog.cpython-311.pyc differ diff --git a/backend/__pycache__/petrinet.cpython-311.pyc b/backend/__pycache__/petrinet.cpython-311.pyc index e3b4b2a8c31c9e0f375b05a90218b1ed84db86bb..8095564d92d01a40d4ca9a9d7a9c303f31665759 100644 Binary files a/backend/__pycache__/petrinet.cpython-311.pyc and b/backend/__pycache__/petrinet.cpython-311.pyc differ diff --git a/backend/__pycache__/simplesimmodel.cpython-311.pyc b/backend/__pycache__/simplesimmodel.cpython-311.pyc index ebc60eb64288c41e6615808803a79c5a522b4589..5b18da0fb020e1d8dec13987efb9a4c922123706 100644 Binary files a/backend/__pycache__/simplesimmodel.cpython-311.pyc and b/backend/__pycache__/simplesimmodel.cpython-311.pyc differ diff --git a/backend/dqn.py b/backend/dqn.py index ab2d9ea46280818862bc2e1dc606ec94364103e3..06efd7bc349c51c98d92a6ae4590dcfe09aa1701 100644 --- a/backend/dqn.py +++ b/backend/dqn.py @@ -68,7 +68,7 @@ def deploy(state): number of the encoded optimal action to take """ - model = DQN.load(r'..\models\1687176631\2000000') + model = DQN.load(r'../models/1687176631/2000000') action, _ = model.predict(state, deterministic=True) return action diff --git a/backend/petrinet.py b/backend/petrinet.py index dab423110cef14b32921511c608004514dc0a7ab..3af772cda6f66b69425cc5032749d6ca2b326c0a 100644 --- a/backend/petrinet.py +++ b/backend/petrinet.py @@ -30,7 +30,7 @@ def generate_petri_net(): # we use an existing event log to create a petri net for our process # dataframe = pd.read_csv(r'Frontend/static/eventlog.csv', sep=',') #docker - dataframe = pd.read_csv(r'static\eventlog.csv', sep=',') #local + dataframe = pd.read_csv(r'static/eventlog.csv', sep=',') #local dataframe['StartTimestamp'] = pd.to_datetime(dataframe['StartTimestamp']) # Sort the event log by case ID and start timestamp, and get only finished cases @@ -60,7 +60,7 @@ def process_petri_net(): for t in net.transitions: decoration.update({t: {}}) decoration[t].update({"color":"white"}) - pm4py.save_vis_petri_net(net, initial_marking, final_marking, bgcolor = "#E6F1FA", decorations = decoration, file_path = r"static\process_net.png") #local + pm4py.save_vis_petri_net(net, initial_marking, final_marking, bgcolor = "#E6F1FA", decorations = decoration, file_path = r"static/process_net.png") #local def decorate_petri_net(case, name): """Exports a .png of a petri-net with the trace of the case colored. @@ -105,7 +105,7 @@ def decorate_petri_net(case, name): # pm4py.view_petri_net(net, initial_marking, final_marking, decorations = decoration) print("made petrinet") # pm4py.save_vis_petri_net(net, initial_marking, final_marking, decorations = decoration, file_path = r"Frontend/static/preview_net.png") #docker - pm4py.save_vis_petri_net(net, initial_marking, final_marking, bgcolor = "#E6F1FA", decorations = decoration, file_path = r"static\preview_net.png") #local + pm4py.save_vis_petri_net(net, initial_marking, final_marking, bgcolor = "#E6F1FA", decorations = decoration, file_path = r"static/preview_net.png") #local def decorate_petri_net_with_rec(case, rec, name): """Exports a .png of a petri-net in which the trace of the case is colored in one color and the recommended activity in another. @@ -153,7 +153,7 @@ def decorate_petri_net_with_rec(case, rec, name): # pm4py.view_petri_net(net, initial_marking, final_marking, decorations = decoration) # pm4py.save_vis_petri_net(net, initial_marking, final_marking, decorations = decoration, file_path = r"Frontend/static/net.png") #docker - pm4py.save_vis_petri_net(net, initial_marking, final_marking, bgcolor = "#E6F1FA", decorations = decoration, file_path = r"static\net.png") #local + pm4py.save_vis_petri_net(net, initial_marking, final_marking, bgcolor = "#E6F1FA", decorations = decoration, file_path = r"static/net.png") #local return rec_name # decorate_petri_net(646, 7, "eventlog.csv")