Skip to content

Commit f44f521

Browse files
authored
Add files via upload
1 parent 9a14ac0 commit f44f521

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5776
-0
lines changed

app.py

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
import pandas as pd
2+
import numpy as np
3+
import plotly.express as px
4+
from utils.routing.distances import (
5+
distance_picking,
6+
next_location
7+
)
8+
from utils.routing.routes import (
9+
create_picking_route
10+
)
11+
from utils.batch.mapping_batch import (
12+
orderlines_mapping,
13+
locations_listing
14+
)
15+
from utils.cluster.mapping_cluster import (
16+
df_mapping
17+
)
18+
from utils.batch.simulation_batch import (
19+
simulation_wave,
20+
simulate_batch
21+
)
22+
from utils.cluster.simulation_cluster import(
23+
loop_wave,
24+
simulation_cluster,
25+
create_dataframe,
26+
process_methods
27+
)
28+
from utils.results.plot import (
29+
plot_simulation1,
30+
plot_simulation2
31+
)
32+
import streamlit as st
33+
from streamlit import caching
34+
35+
# Set page configuration
36+
st.set_page_config(page_title ="Improve Warehouse Productivity using Order Batching",
37+
initial_sidebar_state="expanded",
38+
layout='wide',
39+
page_icon="🛒")
40+
41+
# Set up the page
42+
@st.cache(persist=False,
43+
allow_output_mutation=True,
44+
suppress_st_warning=True,
45+
show_spinner= True)
46+
# Preparation of data
47+
def load(filename, n):
48+
df_orderlines = pd.read_csv(IN + filename).head(n)
49+
return df_orderlines
50+
51+
52+
# Alley Coordinates on y-axis
53+
y_low, y_high = 5.5, 50
54+
# Origin Location
55+
origin_loc = [0, y_low]
56+
# Distance Threshold (m)
57+
distance_threshold = 35
58+
distance_list = [1] + [i for i in range(5, 100, 5)]
59+
IN = 'static/in/'
60+
# Store Results by WaveID
61+
list_wid, list_dst, list_route, list_ord, list_lines, list_pcs, list_monomult = [], [], [], [], [], [], []
62+
list_results = [list_wid, list_dst, list_route, list_ord, list_lines, list_pcs, list_monomult] # Group in list
63+
# Store Results by Simulation (Order_number)
64+
list_ordnum , list_dstw = [], []
65+
66+
# Simulation 1: Order Batch
67+
# SCOPE SIZE
68+
st.header("**🥇 Impact of the wave size in orders (Orders/Wave) **")
69+
st.subheader('''
70+
🛠️ HOW MANY ORDER LINES DO YOU WANT TO INCLUDE IN YOUR ANALYSIS?
71+
''')
72+
col1, col2 = st.beta_columns(2)
73+
with col1:
74+
n = st.slider(
75+
'SIMULATION 1 SCOPE (THOUSDAND ORDERS)', 1, 200 , value = 5)
76+
with col2:
77+
lines_number = 1000 * n
78+
st.write('''🛠️{:,} \
79+
order lines'''.format(lines_number))
80+
# SIMULATION PARAMETERS
81+
st.subheader('''
82+
🛠️ SIMULATE ORDER PICKING BY WAVE OF N ORDERS PER WAVE WITH N IN [N_MIN, N_MAX] ''')
83+
col_11 , col_22 = st.beta_columns(2)
84+
with col_11:
85+
n1 = st.slider(
86+
'SIMULATION 1: N_MIN (ORDERS/WAVE)', 0, 20 , value = 1)
87+
n2 = st.slider(
88+
'SIMULATION 1: N_MAX (ORDERS/WAVE)', n1 + 1, 20 , value = int(np.max([n1+1 , 10])))
89+
with col_22:
90+
st.write('''[N_MIN, N_MAX] = [{:,}, {:,}]'''.format(n1, n2))
91+
# START CALCULATION
92+
start_1= False
93+
if st.checkbox('SIMULATION 1: START CALCULATION',key='show', value=False):
94+
start_1 = True
95+
# Calculation
96+
if start_1:
97+
df_orderlines = load('df_lines.csv', lines_number)
98+
df_waves, df_results = simulate_batch(n1, n2, y_low, y_high, origin_loc, lines_number, df_orderlines)
99+
plot_simulation1(df_results, lines_number)
100+
101+
# Simulation 2: Order Batch using Spatial Clustering
102+
# SCOPE SIZE
103+
st.header("**🥈 Impact of the order batching method **")
104+
st.subheader('''
105+
🛠️ HOW MANY ORDER LINES DO YOU WANT TO INCLUDE IN YOUR ANALYSIS?
106+
''')
107+
col1, col2 = st.beta_columns(2)
108+
with col1:
109+
n_ = st.slider(
110+
'SIMULATION 2 SCOPE (THOUSDAND ORDERS)', 1, 200 , value = 5)
111+
with col2:
112+
lines_2 = 1000 * n_
113+
st.write('''🛠️{:,} \
114+
order lines'''.format(lines_2))
115+
# START CALCULATION
116+
start_2 = False
117+
if st.checkbox('SIMULATION 2: START CALCULATION',key='show_2', value=False):
118+
start_2 = True
119+
# Calculation
120+
if start_2:
121+
df_orderlines = load('df_lines.csv', lines_2)
122+
df_reswave, df_results = simulation_cluster(y_low, y_high, df_orderlines, list_results, n1, n2,
123+
distance_threshold)
124+
plot_simulation2(df_reswave, lines_2, distance_threshold)

requirements.txt

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
absl-py==0.15.0
2+
altair==4.1.0
3+
argon2-cffi==21.1.0
4+
astor==0.8.1
5+
attrs==21.2.0
6+
backcall==0.2.0
7+
backports.zoneinfo==0.2.1
8+
base58==2.1.1
9+
bleach==4.1.0
10+
blinker==1.4
11+
cachetools==4.2.4
12+
certifi==2021.10.8
13+
cffi==1.15.0
14+
charset-normalizer==2.0.7
15+
click==8.0.3
16+
cycler==0.11.0
17+
debugpy==1.5.1
18+
decorator==5.1.0
19+
defusedxml==0.7.1
20+
entrypoints==0.3
21+
et-xmlfile==1.1.0
22+
gitdb==4.0.9
23+
GitPython==3.1.24
24+
idna==3.3
25+
ipykernel==6.4.2
26+
ipython==7.29.0
27+
ipython-genutils==0.2.0
28+
ipywidgets==7.6.5
29+
jedi==0.18.0
30+
Jinja2==3.0.2
31+
jsonschema==4.1.2
32+
jupyter-client==7.0.6
33+
jupyter-core==4.9.1
34+
jupyterlab-pygments==0.1.2
35+
jupyterlab-widgets==1.0.2
36+
kiwisolver==1.3.2
37+
MarkupSafe==2.0.1
38+
matplotlib==3.4.3
39+
matplotlib-inline==0.1.3
40+
mistune==0.8.4
41+
nbclient==0.5.4
42+
nbconvert==6.2.0
43+
nbformat==5.1.3
44+
nest-asyncio==1.5.1
45+
notebook==6.4.5
46+
numpy==1.21.3
47+
openpyxl==3.0.9
48+
ortools==9.1.9490
49+
packaging==21.2
50+
pandas==1.3.4
51+
pandocfilters==1.5.0
52+
parso==0.8.2
53+
pexpect==4.8.0
54+
pickleshare==0.7.5
55+
Pillow==8.4.0
56+
plotly==5.3.1
57+
prometheus-client==0.12.0
58+
prompt-toolkit==3.0.21
59+
protobuf==3.19.1
60+
ptyprocess==0.7.0
61+
pyarrow==6.0.0
62+
pycparser==2.20
63+
pydeck==0.7.1
64+
Pygments==2.10.0
65+
pyparsing==2.4.7
66+
pyrsistent==0.18.0
67+
python-dateutil==2.8.2
68+
pytz==2021.3
69+
pytz-deprecation-shim==0.1.0.post0
70+
PyYAML==6.0
71+
pyzmq==22.3.0
72+
requests==2.26.0
73+
scipy==1.7.1
74+
Send2Trash==1.8.0
75+
six==1.16.0
76+
smmap==5.0.0
77+
streamlit==0.77.0
78+
tenacity==8.0.1
79+
terminado==0.12.1
80+
testpath==0.5.0
81+
toml==0.10.2
82+
toolz==0.11.1
83+
tornado==6.1
84+
traitlets==5.1.1
85+
typing-extensions==3.10.0.2
86+
tzdata==2021.5
87+
tzlocal==4.1
88+
urllib3==1.26.7
89+
validators==0.18.2
90+
watchdog==2.1.6
91+
wcwidth==0.2.5
92+
webencodings==0.5.1
93+
widgetsnbextension==3.5.2

static/img/1000lines_batch.png

32.9 KB
Loading
39.3 KB
Loading
33.3 KB
Loading

static/img/batch_final.png

33.3 KB
Loading

static/img/batch_function_1.png

62 KB
Loading

static/img/batch_function_2.png

51.2 KB
Loading

static/img/batch_results.png

16.4 KB
Loading

static/img/cluster_analysis.png

42.3 KB
Loading

0 commit comments

Comments
 (0)