2256 lines
154 KiB
Text
2256 lines
154 KiB
Text
|
|
{
|
||
|
|
"nbformat": 4,
|
||
|
|
"nbformat_minor": 0,
|
||
|
|
"metadata": {
|
||
|
|
"colab": {
|
||
|
|
"name": "case1_student_notebook.ipynb",
|
||
|
|
"provenance": [],
|
||
|
|
"toc_visible": true,
|
||
|
|
"collapsed_sections": [
|
||
|
|
"-P1-336gb1mL",
|
||
|
|
"7W7uTUrbcavk",
|
||
|
|
"i7HhY0Vqc4vT",
|
||
|
|
"mjVrfdcE8Wos",
|
||
|
|
"gVQE6YOq-Ic0"
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"kernelspec": {
|
||
|
|
"name": "python3",
|
||
|
|
"display_name": "Python 3"
|
||
|
|
},
|
||
|
|
"language_info": {
|
||
|
|
"name": "python"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"cells": [
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"# Case 1 - Student notebook\n",
|
||
|
|
"\n",
|
||
|
|
"Welcome to the helper notebook for case 1. This notebook contains prepared code that you can use to tackle case 1. Specifically, you can find here:\n",
|
||
|
|
"\n",
|
||
|
|
"- Code to load the case data.\n",
|
||
|
|
"- Simulation tools to test warehouse purchasing policies.\n",
|
||
|
|
"\n",
|
||
|
|
"This notebook is designed to be used in Google Colab. You can also export it and run it in any other Jupyter Notebook environment, but a thing or two will probably break and you will need to fix them yourself. Your choice."
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "SIqkunrpbF0F"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"## Imports and Data loading"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "-P1-336gb1mL"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"execution_count": 1,
|
||
|
|
"metadata": {
|
||
|
|
"id": "Nsf-Vl3-a82N"
|
||
|
|
},
|
||
|
|
"outputs": [],
|
||
|
|
"source": [
|
||
|
|
"# Import all the necessary packages\n",
|
||
|
|
"import io\n",
|
||
|
|
"import pandas as pd\n",
|
||
|
|
"import numpy as np\n",
|
||
|
|
"import seaborn as sns\n",
|
||
|
|
"from google.colab import files\n",
|
||
|
|
"from datetime import datetime, timedelta"
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# Upload files from your computer here\n",
|
||
|
|
"# Run the cell and click the \"Browse\" button to upload the provided CSV \n",
|
||
|
|
"# files\n",
|
||
|
|
"uploaded = files.upload()"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"colab": {
|
||
|
|
"resources": {
|
||
|
|
"http://localhost:8080/nbextensions/google.colab/files.js": {
|
||
|
|
"data": "Ly8gQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQwovLwovLyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLy8geW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgovLyBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLy8KLy8gICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLy8KLy8gVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQovLyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAovLyBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlk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wogIGlucHV0RWxlbWVudC5wYXJlbnRFbGVtZW50LmFwcGVuZENoaWxkKGNhbmNlbCk7CiAgY2FuY2VsLnRleHRDb250ZW50ID0gJ0NhbmNlbCB1cGxvYWQnOwogIGNvbnN0IGNhbmNlbFByb21pc2UgPSBuZXcgUHJvbWlzZSgocmVzb2x2ZSkgPT4gewogICAgY2FuY2VsLm9uY2xpY2sgPSAoKSA9PiB7CiAgICAgIHJlc29sdmUo
|
||
|
|
"ok": true,
|
||
|
|
"headers": [
|
||
|
|
[
|
||
|
|
"content-type",
|
||
|
|
"application/javascript"
|
||
|
|
]
|
||
|
|
],
|
||
|
|
"status": 200,
|
||
|
|
"status_text": "OK"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
"base_uri": "https://localhost:8080/",
|
||
|
|
"height": 142
|
||
|
|
},
|
||
|
|
"id": "4psao7htcAwr",
|
||
|
|
"outputId": "6bc57f2c-c1ca-49e6-a12c-cf88c5e04452"
|
||
|
|
},
|
||
|
|
"execution_count": 2,
|
||
|
|
"outputs": [
|
||
|
|
{
|
||
|
|
"output_type": "display_data",
|
||
|
|
"data": {
|
||
|
|
"text/plain": [
|
||
|
|
"<IPython.core.display.HTML object>"
|
||
|
|
],
|
||
|
|
"text/html": [
|
||
|
|
"\n",
|
||
|
|
" <input type=\"file\" id=\"files-e9a16b47-653b-4c1e-969c-3f40d9a0e212\" name=\"files[]\" multiple disabled\n",
|
||
|
|
" style=\"border:none\" />\n",
|
||
|
|
" <output id=\"result-e9a16b47-653b-4c1e-969c-3f40d9a0e212\">\n",
|
||
|
|
" Upload widget is only available when the cell has been executed in the\n",
|
||
|
|
" current browser session. Please rerun this cell to enable.\n",
|
||
|
|
" </output>\n",
|
||
|
|
" <script src=\"/nbextensions/google.colab/files.js\"></script> "
|
||
|
|
]
|
||
|
|
},
|
||
|
|
"metadata": {}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"output_type": "stream",
|
||
|
|
"name": "stdout",
|
||
|
|
"text": [
|
||
|
|
"Saving sourcing_events.csv to sourcing_events.csv\n",
|
||
|
|
"Saving stock_state.csv to stock_state.csv\n",
|
||
|
|
"Saving demand_events.csv to demand_events.csv\n"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# Read the files as pandas dataframes and print them so you can check that the\n",
|
||
|
|
"# process went fine\n",
|
||
|
|
"\n",
|
||
|
|
"demand_events = pd.read_csv(io.BytesIO(uploaded['demand_events.csv']))\n",
|
||
|
|
"sourcing_events = pd.read_csv(io.BytesIO(uploaded['sourcing_events.csv']))\n",
|
||
|
|
"stock_state = pd.read_csv(io.BytesIO(uploaded['stock_state.csv']))\n",
|
||
|
|
"\n",
|
||
|
|
"for table in (demand_events, sourcing_events, stock_state):\n",
|
||
|
|
" print(table.head())"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"colab": {
|
||
|
|
"base_uri": "https://localhost:8080/"
|
||
|
|
},
|
||
|
|
"id": "X8N0PZ4qcOls",
|
||
|
|
"outputId": "b96a4d01-e827-4de7-8de0-7e0dfdc6c456"
|
||
|
|
},
|
||
|
|
"execution_count": 3,
|
||
|
|
"outputs": [
|
||
|
|
{
|
||
|
|
"output_type": "stream",
|
||
|
|
"name": "stdout",
|
||
|
|
"text": [
|
||
|
|
" date demand_quantity\n",
|
||
|
|
"0 2021-01-01 54609.492813\n",
|
||
|
|
"1 2021-01-02 36208.636486\n",
|
||
|
|
"2 2021-01-03 77784.172768\n",
|
||
|
|
"3 2021-01-04 76481.813604\n",
|
||
|
|
"4 2021-01-05 52305.876589\n",
|
||
|
|
" request_date delivery_date amount\n",
|
||
|
|
"0 2021-06-18 2021-06-24 361622.084212\n",
|
||
|
|
"1 2021-04-08 2021-04-17 404943.208184\n",
|
||
|
|
"2 2021-08-02 2021-08-10 372079.374931\n",
|
||
|
|
"3 2021-03-23 2021-03-28 324410.868370\n",
|
||
|
|
"4 2021-07-14 2021-07-19 467167.833054\n",
|
||
|
|
" date amount_in_stock\n",
|
||
|
|
"0 2021-01-01 647479.251651\n",
|
||
|
|
"1 2021-01-02 611270.615165\n",
|
||
|
|
"2 2021-01-03 533486.442397\n",
|
||
|
|
"3 2021-01-04 457004.628793\n",
|
||
|
|
"4 2021-01-05 404698.752204\n"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"## Level 1\n",
|
||
|
|
"\n",
|
||
|
|
"From the case description:\n",
|
||
|
|
"\n",
|
||
|
|
" - Elisa wants you to measure the performance of the last year, providing\n",
|
||
|
|
" quantitative metrics. She knows it was a bad year, but hasn't looked at\n",
|
||
|
|
" the real data to summarize how bad it was. Remember that there is a\n",
|
||
|
|
" trade-off: too much stock, is not desired, but running out of stock and making\n",
|
||
|
|
" clients wait is also negative.\n",
|
||
|
|
" - Going one step further, Elisa wants to know: what was done wrong?\n",
|
||
|
|
"\n",
|
||
|
|
"Use this section to visualize/analyse data from last year to answer Elisa's request."
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "7W7uTUrbcavk"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# Your code goes in cells in this section"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "ENVo0y5mc1Ud"
|
||
|
|
},
|
||
|
|
"execution_count": 4,
|
||
|
|
"outputs": []
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"## Level 2\n",
|
||
|
|
"\n",
|
||
|
|
"From the case description:\n",
|
||
|
|
"\n",
|
||
|
|
" - Elisa wants you to propose an ordering policy. This means, that you need\n",
|
||
|
|
" to define a rule that, once each day, should answer the questions: should\n",
|
||
|
|
" be place an order to request material today? If yes, how much should we\n",
|
||
|
|
" order?\n",
|
||
|
|
" - Use simulation to present metrics on what is the expected performance\n",
|
||
|
|
" with the policy you are proposing. Remember, you need to convince Elisa\n",
|
||
|
|
" that this is better than what happens today.\n",
|
||
|
|
" - As a specific constraint, Elisa explains that she wants that the\n",
|
||
|
|
" probability of a stockout to be at most of 5% on any given day.\n",
|
||
|
|
"\n",
|
||
|
|
"Use this Level 2 section to learn how to use the provided code and run your own analysis and simulations to answer Elisa's request."
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "i7HhY0Vqc4vT"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"### Prepared simulation code\n",
|
||
|
|
"\n",
|
||
|
|
"To help you out, I have prepared some code that will assist you in running simulations. The cells below contain the code and a small example showing you how to use."
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "-pPzw48XdOtA"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# This is the helper code. Run the cell to load it.\n",
|
||
|
|
"\n",
|
||
|
|
"base = datetime(2022,1,1)\n",
|
||
|
|
"dates_in_2022 = [base + timedelta(days=x) for x in range(365)]\n",
|
||
|
|
"\n",
|
||
|
|
"class SimulationResult:\n",
|
||
|
|
"\n",
|
||
|
|
" def __init__(self, stock_states, demand_by_day, sourcing_events):\n",
|
||
|
|
" self.stock_states = stock_states\n",
|
||
|
|
" self.demand_by_day = demand_by_day\n",
|
||
|
|
" self.sourcing_events = sourcing_events\n",
|
||
|
|
"\n",
|
||
|
|
" def plot_stock_history(self):\n",
|
||
|
|
" sns.lineplot(x=dates_in_2022, y=self.stock_states)\n",
|
||
|
|
"\n",
|
||
|
|
" def plot_stock_distribution(self):\n",
|
||
|
|
" sns.histplot(x=self.stock_states, kde=True)\n",
|
||
|
|
"\n",
|
||
|
|
" def service_level(self):\n",
|
||
|
|
" return (self.stock_states > 0 ).astype(int).mean()\n",
|
||
|
|
"\n",
|
||
|
|
" def stock_level_summary(self):\n",
|
||
|
|
" print(\n",
|
||
|
|
" pd.DataFrame(self.stock_states).describe()\n",
|
||
|
|
" ) \n",
|
||
|
|
" \n",
|
||
|
|
" def mean_stock_level(self):\n",
|
||
|
|
" return self.stock_states.mean()\n",
|
||
|
|
"\n",
|
||
|
|
" def median_stock_level(self):\n",
|
||
|
|
" return np.median(self.stock_states)\n",
|
||
|
|
"\n",
|
||
|
|
" def stdev_stock_level(self):\n",
|
||
|
|
" return self.stock_states.std()\n",
|
||
|
|
"\n",
|
||
|
|
" def mean_demand(self):\n",
|
||
|
|
" return self.demand_by_day.mean()\n",
|
||
|
|
" \n",
|
||
|
|
" def number_of_purchase_orders_placed(self):\n",
|
||
|
|
" return len(self.sourcing_events)\n",
|
||
|
|
"\n",
|
||
|
|
"\n",
|
||
|
|
"class SimulationConfig:\n",
|
||
|
|
"\n",
|
||
|
|
" def __init__(self, starting_stock, demand_generator, lead_time_generator, purchaser):\n",
|
||
|
|
" self.starting_stock = starting_stock\n",
|
||
|
|
" self.demand_generator = demand_generator\n",
|
||
|
|
" self.lead_time_generator = lead_time_generator\n",
|
||
|
|
" self.purchaser = purchaser\n",
|
||
|
|
"\n",
|
||
|
|
"class PurchaseOrder:\n",
|
||
|
|
" \n",
|
||
|
|
" def __init__(self, amount, request_date, delivery_date):\n",
|
||
|
|
" self.amount = amount\n",
|
||
|
|
" self.request_date = request_date\n",
|
||
|
|
" self.delivery_date = delivery_date\n",
|
||
|
|
"\n",
|
||
|
|
" def __repr__(self):\n",
|
||
|
|
" return f\"Order of {self.amount:.0f}, requested on {self.request_date}, delivery on {self.delivery_date}.\"\n",
|
||
|
|
"\n",
|
||
|
|
"\n",
|
||
|
|
"class Simulation:\n",
|
||
|
|
" \n",
|
||
|
|
" def __init__(self, config: SimulationConfig, verbose=False):\n",
|
||
|
|
" self._config = config\n",
|
||
|
|
" self.verbose = verbose\n",
|
||
|
|
"\n",
|
||
|
|
" def run(self):\n",
|
||
|
|
"\n",
|
||
|
|
" stock_states = np.array([self._config.starting_stock])\n",
|
||
|
|
" opened_orders = []\n",
|
||
|
|
" ongoing_orders = {}\n",
|
||
|
|
" demand_by_day = np.array(list())\n",
|
||
|
|
" \n",
|
||
|
|
" for day in dates_in_2022:\n",
|
||
|
|
" if self.verbose:\n",
|
||
|
|
" print(f\"Simulating day: {day}\")\n",
|
||
|
|
" current_stock = stock_states[-1]\n",
|
||
|
|
" if self.verbose:\n",
|
||
|
|
" print(f\"Starting stock: {current_stock:.0f}\")\n",
|
||
|
|
" demand_for_this_day = self._config.demand_generator()\n",
|
||
|
|
" if self.verbose:\n",
|
||
|
|
" print(f\"Generated demand for today: {demand_for_this_day:.0f}\")\n",
|
||
|
|
" demand_by_day = np.append(demand_by_day, [demand_for_this_day])\n",
|
||
|
|
" goods_received_this_day = 0\n",
|
||
|
|
" if day in ongoing_orders:\n",
|
||
|
|
" order_delivered_today = ongoing_orders.pop(day)\n",
|
||
|
|
" goods_received_this_day = order_delivered_today.amount\n",
|
||
|
|
" if self.verbose:\n",
|
||
|
|
" print(f\"Goods received today: {goods_received_this_day:.0f}\")\n",
|
||
|
|
" \n",
|
||
|
|
" current_stock = current_stock + goods_received_this_day - demand_for_this_day\n",
|
||
|
|
" stock_states = np.append(stock_states, [current_stock])\n",
|
||
|
|
"\n",
|
||
|
|
"\n",
|
||
|
|
" order_to_make = self._config.purchaser(\n",
|
||
|
|
" day, \n",
|
||
|
|
" current_stock, \n",
|
||
|
|
" ongoing_orders,\n",
|
||
|
|
" self._config.lead_time_generator\n",
|
||
|
|
" )\n",
|
||
|
|
"\n",
|
||
|
|
" if order_to_make:\n",
|
||
|
|
" if self.verbose:\n",
|
||
|
|
" print(f\"Placing a new order: {order_to_make}\")\n",
|
||
|
|
" opened_orders.append(order_to_make)\n",
|
||
|
|
" ongoing_orders[order_to_make.delivery_date] = order_to_make\n",
|
||
|
|
" \n",
|
||
|
|
" stock_states = np.delete(stock_states, 0) # Remove starting stock\n",
|
||
|
|
" \n",
|
||
|
|
" self.results = SimulationResult(\n",
|
||
|
|
" stock_states=stock_states, \n",
|
||
|
|
" demand_by_day=demand_by_day, \n",
|
||
|
|
" sourcing_events=opened_orders \n",
|
||
|
|
" )\n",
|
||
|
|
"\n",
|
||
|
|
" return self.results\n",
|
||
|
|
"\n"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "JRN7MPU-c84s"
|
||
|
|
},
|
||
|
|
"execution_count": 5,
|
||
|
|
"outputs": []
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"### Guide on the prepared code"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "MB_4hRpBhsCd"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"#### SimulationConfig and PurchaseOrder"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "hqWXp047lX1R"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# There are four relevant objects you need to know about: Simulation, \n",
|
||
|
|
"# SimulationConfig, PurchaseOrder and Simulation Result.\n",
|
||
|
|
"\n",
|
||
|
|
"# SimulationConfig specifies the context for a simulation. You need to create one\n",
|
||
|
|
"# to run a simulation.\n",
|
||
|
|
"\n",
|
||
|
|
"an_example_config = SimulationConfig(\n",
|
||
|
|
" # How much stock there is in the warehouse when the simulation begins.\n",
|
||
|
|
" starting_stock=100, \n",
|
||
|
|
" # A function that generates the daily demand. You can define any kind of \n",
|
||
|
|
" # function, as long as it returns a number and doesn't require any arguments.\n",
|
||
|
|
" # The example below generates samples from a normal distribution with a mean\n",
|
||
|
|
" # of 10 and variance of 1.\n",
|
||
|
|
" demand_generator=lambda: np.random.normal(10, 1),\n",
|
||
|
|
" # A function that generates the lead time (in days) for purchase orders. \n",
|
||
|
|
" # This way, we simulate how long it will take for goods to reach the \n",
|
||
|
|
" # warehouse after placing an order. You can define any kind of function, as \n",
|
||
|
|
" # long as it returns an integer number and doesn't require any arguments.\n",
|
||
|
|
" # The example below generates samples from a normal distribution with a mean\n",
|
||
|
|
" # of 5 and variance of 1, and rounds the result so that we get full days.\n",
|
||
|
|
" lead_time_generator=lambda: int(np.random.normal(5, 1)),\n",
|
||
|
|
" # A function that decides when and how much to buy. See more details below.\n",
|
||
|
|
" purchaser=lambda: \"ignore_me_for_now\",\n",
|
||
|
|
")\n",
|
||
|
|
"\n",
|
||
|
|
"# A PurchaseOrder represents an order from Caserta to Diemen requesting goods.\n",
|
||
|
|
"an_example_order = PurchaseOrder(\n",
|
||
|
|
" amount=100,\n",
|
||
|
|
" # We request a 100.\n",
|
||
|
|
" request_date=datetime.today(),\n",
|
||
|
|
" # We request time today\n",
|
||
|
|
" delivery_date=datetime.today() + timedelta(days=1)\n",
|
||
|
|
" # We receive them tomorrow\n",
|
||
|
|
")\n",
|
||
|
|
"\n",
|
||
|
|
"# The purchaser function is the logical definition of the proposal you need to\n",
|
||
|
|
"# make to Elisa, which is a policy on when, and how much to buy. \n",
|
||
|
|
"# The function receives information from the simulation (which day is it, what \n",
|
||
|
|
"# is the stocklevel, whether there are other ongoing purchase orders, etc.) and \n",
|
||
|
|
"# either does nothing or decides that a PurchaseOrder should be created.\n",
|
||
|
|
"# This function gets called one time on each day of the simulation, so each \n",
|
||
|
|
"# simulated day can have a purchase. \n",
|
||
|
|
"\n",
|
||
|
|
"def a_simple_purchaser(\n",
|
||
|
|
" day, # The current day\n",
|
||
|
|
" current_stock, # The level of stock on that day\n",
|
||
|
|
" ongoing_orders, # A dictionary with the open purchase orders\n",
|
||
|
|
" lead_time_generator # The same lead time generator you pass to the Simulation Config\n",
|
||
|
|
" ):\n",
|
||
|
|
" \n",
|
||
|
|
" if ongoing_orders or current_stock > 100:\n",
|
||
|
|
" # If we are already waiting for an order to arrive or we have enough stock\n",
|
||
|
|
" # we don't request more goods.\n",
|
||
|
|
" return None\n",
|
||
|
|
"\n",
|
||
|
|
" if current_stock <= 100:\n",
|
||
|
|
" # If the stock is going low, we request 200 more.\n",
|
||
|
|
" return PurchaseOrder(\n",
|
||
|
|
" amount=100,\n",
|
||
|
|
" request_date=day,\n",
|
||
|
|
" delivery_date=day + timedelta(days=lead_time_generator()) # We simulate the delay in the delivery\n",
|
||
|
|
" )\n",
|
||
|
|
"\n",
|
||
|
|
"# Now that we have a purchaser function, we can complete the SimulationConfig by\n",
|
||
|
|
"# using it.\n",
|
||
|
|
"\n",
|
||
|
|
"an_example_config = SimulationConfig(\n",
|
||
|
|
" starting_stock=100, \n",
|
||
|
|
" demand_generator=lambda: np.random.normal(10, 1),\n",
|
||
|
|
" lead_time_generator=lambda: int(np.random.normal(10, 1)),\n",
|
||
|
|
" purchaser=a_simple_purchaser\n",
|
||
|
|
")\n",
|
||
|
|
"\n"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "xBopZNA_dFb5"
|
||
|
|
},
|
||
|
|
"execution_count": 6,
|
||
|
|
"outputs": []
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"#### Simulation"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "aM8Xzx_zleds"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# The Simulation class is the code that actually runs a simulation. It takes a \n",
|
||
|
|
"# SimulationConfig as an input, and returns a SimulationResult as an output.\n",
|
||
|
|
"\n",
|
||
|
|
"example_simulation = Simulation(\n",
|
||
|
|
" config=an_example_config,\n",
|
||
|
|
" verbose=True # This shows daily details. Turn to False if you don't want to see them.\n",
|
||
|
|
")\n",
|
||
|
|
"\n",
|
||
|
|
"# Let's run the simulation and store the results\n",
|
||
|
|
"\n",
|
||
|
|
"example_simulation_results = example_simulation.run()"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"colab": {
|
||
|
|
"base_uri": "https://localhost:8080/"
|
||
|
|
},
|
||
|
|
"id": "hQObT4ITlg2G",
|
||
|
|
"outputId": "91c2253c-0740-420e-b084-8dc4a317c3ca"
|
||
|
|
},
|
||
|
|
"execution_count": 7,
|
||
|
|
"outputs": [
|
||
|
|
{
|
||
|
|
"output_type": "stream",
|
||
|
|
"name": "stdout",
|
||
|
|
"text": [
|
||
|
|
"Simulating day: 2022-01-01 00:00:00\n",
|
||
|
|
"Starting stock: 100\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-01-01 00:00:00, delivery on 2022-01-09 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-01-02 00:00:00\n",
|
||
|
|
"Starting stock: 89\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-03 00:00:00\n",
|
||
|
|
"Starting stock: 79\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-04 00:00:00\n",
|
||
|
|
"Starting stock: 70\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-05 00:00:00\n",
|
||
|
|
"Starting stock: 61\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-06 00:00:00\n",
|
||
|
|
"Starting stock: 53\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-07 00:00:00\n",
|
||
|
|
"Starting stock: 43\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-08 00:00:00\n",
|
||
|
|
"Starting stock: 34\n",
|
||
|
|
"Generated demand for today: 13\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-09 00:00:00\n",
|
||
|
|
"Starting stock: 21\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-01-10 00:00:00\n",
|
||
|
|
"Starting stock: 111\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-11 00:00:00\n",
|
||
|
|
"Starting stock: 102\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-01-11 00:00:00, delivery on 2022-01-19 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-01-12 00:00:00\n",
|
||
|
|
"Starting stock: 93\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-13 00:00:00\n",
|
||
|
|
"Starting stock: 83\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-14 00:00:00\n",
|
||
|
|
"Starting stock: 74\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-15 00:00:00\n",
|
||
|
|
"Starting stock: 64\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-16 00:00:00\n",
|
||
|
|
"Starting stock: 54\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-17 00:00:00\n",
|
||
|
|
"Starting stock: 43\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-18 00:00:00\n",
|
||
|
|
"Starting stock: 32\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-19 00:00:00\n",
|
||
|
|
"Starting stock: 22\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-01-20 00:00:00\n",
|
||
|
|
"Starting stock: 112\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-01-20 00:00:00, delivery on 2022-01-28 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-01-21 00:00:00\n",
|
||
|
|
"Starting stock: 100\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-22 00:00:00\n",
|
||
|
|
"Starting stock: 91\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-23 00:00:00\n",
|
||
|
|
"Starting stock: 80\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-24 00:00:00\n",
|
||
|
|
"Starting stock: 71\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-25 00:00:00\n",
|
||
|
|
"Starting stock: 61\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-26 00:00:00\n",
|
||
|
|
"Starting stock: 50\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-27 00:00:00\n",
|
||
|
|
"Starting stock: 39\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-28 00:00:00\n",
|
||
|
|
"Starting stock: 30\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-01-29 00:00:00\n",
|
||
|
|
"Starting stock: 120\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-30 00:00:00\n",
|
||
|
|
"Starting stock: 111\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-01-31 00:00:00\n",
|
||
|
|
"Starting stock: 101\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-01-31 00:00:00, delivery on 2022-02-09 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-02-01 00:00:00\n",
|
||
|
|
"Starting stock: 93\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-02 00:00:00\n",
|
||
|
|
"Starting stock: 83\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-03 00:00:00\n",
|
||
|
|
"Starting stock: 73\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-04 00:00:00\n",
|
||
|
|
"Starting stock: 62\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-05 00:00:00\n",
|
||
|
|
"Starting stock: 53\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-06 00:00:00\n",
|
||
|
|
"Starting stock: 45\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-07 00:00:00\n",
|
||
|
|
"Starting stock: 34\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-08 00:00:00\n",
|
||
|
|
"Starting stock: 23\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-09 00:00:00\n",
|
||
|
|
"Starting stock: 13\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-02-10 00:00:00\n",
|
||
|
|
"Starting stock: 104\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-02-10 00:00:00, delivery on 2022-02-21 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-02-11 00:00:00\n",
|
||
|
|
"Starting stock: 94\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-12 00:00:00\n",
|
||
|
|
"Starting stock: 85\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-13 00:00:00\n",
|
||
|
|
"Starting stock: 76\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-14 00:00:00\n",
|
||
|
|
"Starting stock: 66\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-15 00:00:00\n",
|
||
|
|
"Starting stock: 58\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-16 00:00:00\n",
|
||
|
|
"Starting stock: 49\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-17 00:00:00\n",
|
||
|
|
"Starting stock: 40\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-18 00:00:00\n",
|
||
|
|
"Starting stock: 31\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-19 00:00:00\n",
|
||
|
|
"Starting stock: 21\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-20 00:00:00\n",
|
||
|
|
"Starting stock: 12\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-21 00:00:00\n",
|
||
|
|
"Starting stock: 0\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-02-21 00:00:00, delivery on 2022-03-02 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-02-22 00:00:00\n",
|
||
|
|
"Starting stock: 91\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-23 00:00:00\n",
|
||
|
|
"Starting stock: 81\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-24 00:00:00\n",
|
||
|
|
"Starting stock: 69\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-25 00:00:00\n",
|
||
|
|
"Starting stock: 59\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-26 00:00:00\n",
|
||
|
|
"Starting stock: 49\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-27 00:00:00\n",
|
||
|
|
"Starting stock: 39\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-02-28 00:00:00\n",
|
||
|
|
"Starting stock: 28\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-01 00:00:00\n",
|
||
|
|
"Starting stock: 20\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-02 00:00:00\n",
|
||
|
|
"Starting stock: 8\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-03-02 00:00:00, delivery on 2022-03-10 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-03-03 00:00:00\n",
|
||
|
|
"Starting stock: 99\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-04 00:00:00\n",
|
||
|
|
"Starting stock: 89\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-05 00:00:00\n",
|
||
|
|
"Starting stock: 81\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-06 00:00:00\n",
|
||
|
|
"Starting stock: 70\n",
|
||
|
|
"Generated demand for today: 13\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-07 00:00:00\n",
|
||
|
|
"Starting stock: 57\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-08 00:00:00\n",
|
||
|
|
"Starting stock: 48\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-09 00:00:00\n",
|
||
|
|
"Starting stock: 36\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-10 00:00:00\n",
|
||
|
|
"Starting stock: 28\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-03-11 00:00:00\n",
|
||
|
|
"Starting stock: 117\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-12 00:00:00\n",
|
||
|
|
"Starting stock: 107\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-03-12 00:00:00, delivery on 2022-03-21 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-03-13 00:00:00\n",
|
||
|
|
"Starting stock: 97\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-14 00:00:00\n",
|
||
|
|
"Starting stock: 86\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-15 00:00:00\n",
|
||
|
|
"Starting stock: 77\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-16 00:00:00\n",
|
||
|
|
"Starting stock: 68\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-17 00:00:00\n",
|
||
|
|
"Starting stock: 59\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-18 00:00:00\n",
|
||
|
|
"Starting stock: 49\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-19 00:00:00\n",
|
||
|
|
"Starting stock: 40\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-20 00:00:00\n",
|
||
|
|
"Starting stock: 31\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-21 00:00:00\n",
|
||
|
|
"Starting stock: 20\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-03-22 00:00:00\n",
|
||
|
|
"Starting stock: 111\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-23 00:00:00\n",
|
||
|
|
"Starting stock: 103\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-03-23 00:00:00, delivery on 2022-04-01 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-03-24 00:00:00\n",
|
||
|
|
"Starting stock: 93\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-25 00:00:00\n",
|
||
|
|
"Starting stock: 83\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-26 00:00:00\n",
|
||
|
|
"Starting stock: 74\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-27 00:00:00\n",
|
||
|
|
"Starting stock: 65\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-28 00:00:00\n",
|
||
|
|
"Starting stock: 53\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-29 00:00:00\n",
|
||
|
|
"Starting stock: 43\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-30 00:00:00\n",
|
||
|
|
"Starting stock: 33\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-03-31 00:00:00\n",
|
||
|
|
"Starting stock: 22\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-01 00:00:00\n",
|
||
|
|
"Starting stock: 11\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-04-02 00:00:00\n",
|
||
|
|
"Starting stock: 101\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-04-02 00:00:00, delivery on 2022-04-11 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-04-03 00:00:00\n",
|
||
|
|
"Starting stock: 91\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-04 00:00:00\n",
|
||
|
|
"Starting stock: 82\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-05 00:00:00\n",
|
||
|
|
"Starting stock: 73\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-06 00:00:00\n",
|
||
|
|
"Starting stock: 63\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-07 00:00:00\n",
|
||
|
|
"Starting stock: 51\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-08 00:00:00\n",
|
||
|
|
"Starting stock: 40\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-09 00:00:00\n",
|
||
|
|
"Starting stock: 30\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-10 00:00:00\n",
|
||
|
|
"Starting stock: 20\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-11 00:00:00\n",
|
||
|
|
"Starting stock: 11\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-04-12 00:00:00\n",
|
||
|
|
"Starting stock: 101\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-04-12 00:00:00, delivery on 2022-04-22 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-04-13 00:00:00\n",
|
||
|
|
"Starting stock: 89\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-14 00:00:00\n",
|
||
|
|
"Starting stock: 79\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-15 00:00:00\n",
|
||
|
|
"Starting stock: 70\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-16 00:00:00\n",
|
||
|
|
"Starting stock: 60\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-17 00:00:00\n",
|
||
|
|
"Starting stock: 51\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-18 00:00:00\n",
|
||
|
|
"Starting stock: 41\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-19 00:00:00\n",
|
||
|
|
"Starting stock: 33\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-20 00:00:00\n",
|
||
|
|
"Starting stock: 22\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-21 00:00:00\n",
|
||
|
|
"Starting stock: 11\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-22 00:00:00\n",
|
||
|
|
"Starting stock: -1\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-04-22 00:00:00, delivery on 2022-05-02 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-04-23 00:00:00\n",
|
||
|
|
"Starting stock: 89\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-24 00:00:00\n",
|
||
|
|
"Starting stock: 80\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-25 00:00:00\n",
|
||
|
|
"Starting stock: 70\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-26 00:00:00\n",
|
||
|
|
"Starting stock: 61\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-27 00:00:00\n",
|
||
|
|
"Starting stock: 50\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-28 00:00:00\n",
|
||
|
|
"Starting stock: 40\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-29 00:00:00\n",
|
||
|
|
"Starting stock: 30\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-04-30 00:00:00\n",
|
||
|
|
"Starting stock: 21\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-01 00:00:00\n",
|
||
|
|
"Starting stock: 13\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-02 00:00:00\n",
|
||
|
|
"Starting stock: 3\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-05-02 00:00:00, delivery on 2022-05-10 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-05-03 00:00:00\n",
|
||
|
|
"Starting stock: 94\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-04 00:00:00\n",
|
||
|
|
"Starting stock: 84\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-05 00:00:00\n",
|
||
|
|
"Starting stock: 73\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-06 00:00:00\n",
|
||
|
|
"Starting stock: 63\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-07 00:00:00\n",
|
||
|
|
"Starting stock: 54\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-08 00:00:00\n",
|
||
|
|
"Starting stock: 43\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-09 00:00:00\n",
|
||
|
|
"Starting stock: 33\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-10 00:00:00\n",
|
||
|
|
"Starting stock: 21\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-05-11 00:00:00\n",
|
||
|
|
"Starting stock: 111\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-12 00:00:00\n",
|
||
|
|
"Starting stock: 101\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-05-12 00:00:00, delivery on 2022-05-23 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-05-13 00:00:00\n",
|
||
|
|
"Starting stock: 91\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-14 00:00:00\n",
|
||
|
|
"Starting stock: 83\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-15 00:00:00\n",
|
||
|
|
"Starting stock: 72\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-16 00:00:00\n",
|
||
|
|
"Starting stock: 62\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-17 00:00:00\n",
|
||
|
|
"Starting stock: 51\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-18 00:00:00\n",
|
||
|
|
"Starting stock: 42\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-19 00:00:00\n",
|
||
|
|
"Starting stock: 31\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-20 00:00:00\n",
|
||
|
|
"Starting stock: 22\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-21 00:00:00\n",
|
||
|
|
"Starting stock: 12\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-22 00:00:00\n",
|
||
|
|
"Starting stock: 2\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-23 00:00:00\n",
|
||
|
|
"Starting stock: -6\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-05-23 00:00:00, delivery on 2022-06-01 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-05-24 00:00:00\n",
|
||
|
|
"Starting stock: 84\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-25 00:00:00\n",
|
||
|
|
"Starting stock: 73\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-26 00:00:00\n",
|
||
|
|
"Starting stock: 63\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-27 00:00:00\n",
|
||
|
|
"Starting stock: 53\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-28 00:00:00\n",
|
||
|
|
"Starting stock: 43\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-29 00:00:00\n",
|
||
|
|
"Starting stock: 33\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-30 00:00:00\n",
|
||
|
|
"Starting stock: 23\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-05-31 00:00:00\n",
|
||
|
|
"Starting stock: 12\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-01 00:00:00\n",
|
||
|
|
"Starting stock: 4\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-06-01 00:00:00, delivery on 2022-06-11 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-06-02 00:00:00\n",
|
||
|
|
"Starting stock: 95\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-03 00:00:00\n",
|
||
|
|
"Starting stock: 86\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-04 00:00:00\n",
|
||
|
|
"Starting stock: 76\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-05 00:00:00\n",
|
||
|
|
"Starting stock: 67\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-06 00:00:00\n",
|
||
|
|
"Starting stock: 57\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-07 00:00:00\n",
|
||
|
|
"Starting stock: 47\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-08 00:00:00\n",
|
||
|
|
"Starting stock: 37\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-09 00:00:00\n",
|
||
|
|
"Starting stock: 26\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-10 00:00:00\n",
|
||
|
|
"Starting stock: 17\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-11 00:00:00\n",
|
||
|
|
"Starting stock: 8\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-06-11 00:00:00, delivery on 2022-06-20 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-06-12 00:00:00\n",
|
||
|
|
"Starting stock: 99\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-13 00:00:00\n",
|
||
|
|
"Starting stock: 90\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-14 00:00:00\n",
|
||
|
|
"Starting stock: 79\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-15 00:00:00\n",
|
||
|
|
"Starting stock: 68\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-16 00:00:00\n",
|
||
|
|
"Starting stock: 57\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-17 00:00:00\n",
|
||
|
|
"Starting stock: 47\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-18 00:00:00\n",
|
||
|
|
"Starting stock: 38\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-19 00:00:00\n",
|
||
|
|
"Starting stock: 28\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-20 00:00:00\n",
|
||
|
|
"Starting stock: 16\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-06-21 00:00:00\n",
|
||
|
|
"Starting stock: 106\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-06-21 00:00:00, delivery on 2022-06-29 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-06-22 00:00:00\n",
|
||
|
|
"Starting stock: 97\n",
|
||
|
|
"Generated demand for today: 7\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-23 00:00:00\n",
|
||
|
|
"Starting stock: 90\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-24 00:00:00\n",
|
||
|
|
"Starting stock: 80\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-25 00:00:00\n",
|
||
|
|
"Starting stock: 70\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-26 00:00:00\n",
|
||
|
|
"Starting stock: 58\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-27 00:00:00\n",
|
||
|
|
"Starting stock: 49\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-28 00:00:00\n",
|
||
|
|
"Starting stock: 39\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-06-29 00:00:00\n",
|
||
|
|
"Starting stock: 28\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-06-30 00:00:00\n",
|
||
|
|
"Starting stock: 117\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-01 00:00:00\n",
|
||
|
|
"Starting stock: 107\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-07-01 00:00:00, delivery on 2022-07-10 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-07-02 00:00:00\n",
|
||
|
|
"Starting stock: 96\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-03 00:00:00\n",
|
||
|
|
"Starting stock: 86\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-04 00:00:00\n",
|
||
|
|
"Starting stock: 77\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-05 00:00:00\n",
|
||
|
|
"Starting stock: 68\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-06 00:00:00\n",
|
||
|
|
"Starting stock: 56\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-07 00:00:00\n",
|
||
|
|
"Starting stock: 46\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-08 00:00:00\n",
|
||
|
|
"Starting stock: 37\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-09 00:00:00\n",
|
||
|
|
"Starting stock: 28\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-10 00:00:00\n",
|
||
|
|
"Starting stock: 17\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-07-11 00:00:00\n",
|
||
|
|
"Starting stock: 108\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-07-11 00:00:00, delivery on 2022-07-19 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-07-12 00:00:00\n",
|
||
|
|
"Starting stock: 99\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-13 00:00:00\n",
|
||
|
|
"Starting stock: 89\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-14 00:00:00\n",
|
||
|
|
"Starting stock: 79\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-15 00:00:00\n",
|
||
|
|
"Starting stock: 71\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-16 00:00:00\n",
|
||
|
|
"Starting stock: 61\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-17 00:00:00\n",
|
||
|
|
"Starting stock: 50\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-18 00:00:00\n",
|
||
|
|
"Starting stock: 41\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-19 00:00:00\n",
|
||
|
|
"Starting stock: 29\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-07-20 00:00:00\n",
|
||
|
|
"Starting stock: 119\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-21 00:00:00\n",
|
||
|
|
"Starting stock: 109\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-22 00:00:00\n",
|
||
|
|
"Starting stock: 101\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-07-22 00:00:00, delivery on 2022-07-30 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-07-23 00:00:00\n",
|
||
|
|
"Starting stock: 89\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-24 00:00:00\n",
|
||
|
|
"Starting stock: 80\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-25 00:00:00\n",
|
||
|
|
"Starting stock: 70\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-26 00:00:00\n",
|
||
|
|
"Starting stock: 59\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-27 00:00:00\n",
|
||
|
|
"Starting stock: 50\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-28 00:00:00\n",
|
||
|
|
"Starting stock: 40\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-29 00:00:00\n",
|
||
|
|
"Starting stock: 28\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-07-30 00:00:00\n",
|
||
|
|
"Starting stock: 18\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-07-31 00:00:00\n",
|
||
|
|
"Starting stock: 108\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-07-31 00:00:00, delivery on 2022-08-09 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-08-01 00:00:00\n",
|
||
|
|
"Starting stock: 96\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-02 00:00:00\n",
|
||
|
|
"Starting stock: 84\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-03 00:00:00\n",
|
||
|
|
"Starting stock: 74\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-04 00:00:00\n",
|
||
|
|
"Starting stock: 65\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-05 00:00:00\n",
|
||
|
|
"Starting stock: 55\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-06 00:00:00\n",
|
||
|
|
"Starting stock: 45\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-07 00:00:00\n",
|
||
|
|
"Starting stock: 37\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-08 00:00:00\n",
|
||
|
|
"Starting stock: 26\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-09 00:00:00\n",
|
||
|
|
"Starting stock: 17\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-08-10 00:00:00\n",
|
||
|
|
"Starting stock: 106\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-08-10 00:00:00, delivery on 2022-08-18 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-08-11 00:00:00\n",
|
||
|
|
"Starting stock: 96\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-12 00:00:00\n",
|
||
|
|
"Starting stock: 87\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-13 00:00:00\n",
|
||
|
|
"Starting stock: 78\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-14 00:00:00\n",
|
||
|
|
"Starting stock: 68\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-15 00:00:00\n",
|
||
|
|
"Starting stock: 58\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-16 00:00:00\n",
|
||
|
|
"Starting stock: 47\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-17 00:00:00\n",
|
||
|
|
"Starting stock: 36\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-18 00:00:00\n",
|
||
|
|
"Starting stock: 26\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-08-19 00:00:00\n",
|
||
|
|
"Starting stock: 117\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-20 00:00:00\n",
|
||
|
|
"Starting stock: 107\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-08-20 00:00:00, delivery on 2022-08-28 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-08-21 00:00:00\n",
|
||
|
|
"Starting stock: 97\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-22 00:00:00\n",
|
||
|
|
"Starting stock: 88\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-23 00:00:00\n",
|
||
|
|
"Starting stock: 78\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-24 00:00:00\n",
|
||
|
|
"Starting stock: 68\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-25 00:00:00\n",
|
||
|
|
"Starting stock: 60\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-26 00:00:00\n",
|
||
|
|
"Starting stock: 51\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-27 00:00:00\n",
|
||
|
|
"Starting stock: 42\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-28 00:00:00\n",
|
||
|
|
"Starting stock: 32\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-08-29 00:00:00\n",
|
||
|
|
"Starting stock: 122\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-30 00:00:00\n",
|
||
|
|
"Starting stock: 112\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-08-31 00:00:00\n",
|
||
|
|
"Starting stock: 102\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-08-31 00:00:00, delivery on 2022-09-09 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-09-01 00:00:00\n",
|
||
|
|
"Starting stock: 92\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-02 00:00:00\n",
|
||
|
|
"Starting stock: 84\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-03 00:00:00\n",
|
||
|
|
"Starting stock: 75\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-04 00:00:00\n",
|
||
|
|
"Starting stock: 64\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-05 00:00:00\n",
|
||
|
|
"Starting stock: 52\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-06 00:00:00\n",
|
||
|
|
"Starting stock: 42\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-07 00:00:00\n",
|
||
|
|
"Starting stock: 31\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-08 00:00:00\n",
|
||
|
|
"Starting stock: 20\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-09 00:00:00\n",
|
||
|
|
"Starting stock: 12\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-09-10 00:00:00\n",
|
||
|
|
"Starting stock: 101\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-09-10 00:00:00, delivery on 2022-09-19 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-09-11 00:00:00\n",
|
||
|
|
"Starting stock: 94\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-12 00:00:00\n",
|
||
|
|
"Starting stock: 84\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-13 00:00:00\n",
|
||
|
|
"Starting stock: 74\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-14 00:00:00\n",
|
||
|
|
"Starting stock: 63\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-15 00:00:00\n",
|
||
|
|
"Starting stock: 53\n",
|
||
|
|
"Generated demand for today: 7\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-16 00:00:00\n",
|
||
|
|
"Starting stock: 46\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-17 00:00:00\n",
|
||
|
|
"Starting stock: 35\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-18 00:00:00\n",
|
||
|
|
"Starting stock: 26\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-19 00:00:00\n",
|
||
|
|
"Starting stock: 16\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-09-20 00:00:00\n",
|
||
|
|
"Starting stock: 106\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-09-20 00:00:00, delivery on 2022-10-01 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-09-21 00:00:00\n",
|
||
|
|
"Starting stock: 96\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-22 00:00:00\n",
|
||
|
|
"Starting stock: 85\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-23 00:00:00\n",
|
||
|
|
"Starting stock: 76\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-24 00:00:00\n",
|
||
|
|
"Starting stock: 67\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-25 00:00:00\n",
|
||
|
|
"Starting stock: 56\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-26 00:00:00\n",
|
||
|
|
"Starting stock: 47\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-27 00:00:00\n",
|
||
|
|
"Starting stock: 36\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-28 00:00:00\n",
|
||
|
|
"Starting stock: 27\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-29 00:00:00\n",
|
||
|
|
"Starting stock: 16\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-09-30 00:00:00\n",
|
||
|
|
"Starting stock: 8\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-01 00:00:00\n",
|
||
|
|
"Starting stock: -1\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-10-01 00:00:00, delivery on 2022-10-12 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-10-02 00:00:00\n",
|
||
|
|
"Starting stock: 88\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-03 00:00:00\n",
|
||
|
|
"Starting stock: 78\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-04 00:00:00\n",
|
||
|
|
"Starting stock: 67\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-05 00:00:00\n",
|
||
|
|
"Starting stock: 55\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-06 00:00:00\n",
|
||
|
|
"Starting stock: 44\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-07 00:00:00\n",
|
||
|
|
"Starting stock: 34\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-08 00:00:00\n",
|
||
|
|
"Starting stock: 26\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-09 00:00:00\n",
|
||
|
|
"Starting stock: 16\n",
|
||
|
|
"Generated demand for today: 7\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-10 00:00:00\n",
|
||
|
|
"Starting stock: 9\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-11 00:00:00\n",
|
||
|
|
"Starting stock: -2\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-12 00:00:00\n",
|
||
|
|
"Starting stock: -14\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-10-12 00:00:00, delivery on 2022-10-22 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-10-13 00:00:00\n",
|
||
|
|
"Starting stock: 77\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-14 00:00:00\n",
|
||
|
|
"Starting stock: 66\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-15 00:00:00\n",
|
||
|
|
"Starting stock: 57\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-16 00:00:00\n",
|
||
|
|
"Starting stock: 47\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-17 00:00:00\n",
|
||
|
|
"Starting stock: 38\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-18 00:00:00\n",
|
||
|
|
"Starting stock: 27\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-19 00:00:00\n",
|
||
|
|
"Starting stock: 17\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-20 00:00:00\n",
|
||
|
|
"Starting stock: 8\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-21 00:00:00\n",
|
||
|
|
"Starting stock: -3\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-22 00:00:00\n",
|
||
|
|
"Starting stock: -13\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-10-22 00:00:00, delivery on 2022-11-02 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-10-23 00:00:00\n",
|
||
|
|
"Starting stock: 78\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-24 00:00:00\n",
|
||
|
|
"Starting stock: 68\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-25 00:00:00\n",
|
||
|
|
"Starting stock: 57\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-26 00:00:00\n",
|
||
|
|
"Starting stock: 48\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-27 00:00:00\n",
|
||
|
|
"Starting stock: 38\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-28 00:00:00\n",
|
||
|
|
"Starting stock: 26\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-29 00:00:00\n",
|
||
|
|
"Starting stock: 16\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-30 00:00:00\n",
|
||
|
|
"Starting stock: 8\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-10-31 00:00:00\n",
|
||
|
|
"Starting stock: -1\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-01 00:00:00\n",
|
||
|
|
"Starting stock: -13\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-02 00:00:00\n",
|
||
|
|
"Starting stock: -23\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-11-02 00:00:00, delivery on 2022-11-12 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-11-03 00:00:00\n",
|
||
|
|
"Starting stock: 68\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-04 00:00:00\n",
|
||
|
|
"Starting stock: 57\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-05 00:00:00\n",
|
||
|
|
"Starting stock: 47\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-06 00:00:00\n",
|
||
|
|
"Starting stock: 36\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-07 00:00:00\n",
|
||
|
|
"Starting stock: 27\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-08 00:00:00\n",
|
||
|
|
"Starting stock: 17\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-09 00:00:00\n",
|
||
|
|
"Starting stock: 6\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-10 00:00:00\n",
|
||
|
|
"Starting stock: -4\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-11 00:00:00\n",
|
||
|
|
"Starting stock: -14\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-12 00:00:00\n",
|
||
|
|
"Starting stock: -25\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-11-12 00:00:00, delivery on 2022-11-21 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-11-13 00:00:00\n",
|
||
|
|
"Starting stock: 63\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-14 00:00:00\n",
|
||
|
|
"Starting stock: 54\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-15 00:00:00\n",
|
||
|
|
"Starting stock: 44\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-16 00:00:00\n",
|
||
|
|
"Starting stock: 34\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-17 00:00:00\n",
|
||
|
|
"Starting stock: 24\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-18 00:00:00\n",
|
||
|
|
"Starting stock: 14\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-19 00:00:00\n",
|
||
|
|
"Starting stock: 3\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-20 00:00:00\n",
|
||
|
|
"Starting stock: -7\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-21 00:00:00\n",
|
||
|
|
"Starting stock: -17\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-11-21 00:00:00, delivery on 2022-12-01 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-11-22 00:00:00\n",
|
||
|
|
"Starting stock: 73\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-23 00:00:00\n",
|
||
|
|
"Starting stock: 64\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-24 00:00:00\n",
|
||
|
|
"Starting stock: 55\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-25 00:00:00\n",
|
||
|
|
"Starting stock: 45\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-26 00:00:00\n",
|
||
|
|
"Starting stock: 35\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-27 00:00:00\n",
|
||
|
|
"Starting stock: 26\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-28 00:00:00\n",
|
||
|
|
"Starting stock: 16\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-29 00:00:00\n",
|
||
|
|
"Starting stock: 5\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-11-30 00:00:00\n",
|
||
|
|
"Starting stock: -6\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-01 00:00:00\n",
|
||
|
|
"Starting stock: -17\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-12-01 00:00:00, delivery on 2022-12-09 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-12-02 00:00:00\n",
|
||
|
|
"Starting stock: 71\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-03 00:00:00\n",
|
||
|
|
"Starting stock: 60\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-04 00:00:00\n",
|
||
|
|
"Starting stock: 51\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-05 00:00:00\n",
|
||
|
|
"Starting stock: 40\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-06 00:00:00\n",
|
||
|
|
"Starting stock: 31\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-07 00:00:00\n",
|
||
|
|
"Starting stock: 20\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-08 00:00:00\n",
|
||
|
|
"Starting stock: 8\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-09 00:00:00\n",
|
||
|
|
"Starting stock: -3\n",
|
||
|
|
"Generated demand for today: 12\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-12-09 00:00:00, delivery on 2022-12-18 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-12-10 00:00:00\n",
|
||
|
|
"Starting stock: 86\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-11 00:00:00\n",
|
||
|
|
"Starting stock: 76\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-12 00:00:00\n",
|
||
|
|
"Starting stock: 66\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-13 00:00:00\n",
|
||
|
|
"Starting stock: 56\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-14 00:00:00\n",
|
||
|
|
"Starting stock: 46\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-15 00:00:00\n",
|
||
|
|
"Starting stock: 36\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-16 00:00:00\n",
|
||
|
|
"Starting stock: 27\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-17 00:00:00\n",
|
||
|
|
"Starting stock: 17\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-18 00:00:00\n",
|
||
|
|
"Starting stock: 7\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-12-18 00:00:00, delivery on 2022-12-27 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-12-19 00:00:00\n",
|
||
|
|
"Starting stock: 98\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-20 00:00:00\n",
|
||
|
|
"Starting stock: 88\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-21 00:00:00\n",
|
||
|
|
"Starting stock: 77\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-22 00:00:00\n",
|
||
|
|
"Starting stock: 66\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-23 00:00:00\n",
|
||
|
|
"Starting stock: 56\n",
|
||
|
|
"Generated demand for today: 9\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-24 00:00:00\n",
|
||
|
|
"Starting stock: 47\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-25 00:00:00\n",
|
||
|
|
"Starting stock: 36\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-26 00:00:00\n",
|
||
|
|
"Starting stock: 27\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-27 00:00:00\n",
|
||
|
|
"Starting stock: 16\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 100\n",
|
||
|
|
"Simulating day: 2022-12-28 00:00:00\n",
|
||
|
|
"Starting stock: 108\n",
|
||
|
|
"Generated demand for today: 8\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-29 00:00:00\n",
|
||
|
|
"Starting stock: 100\n",
|
||
|
|
"Generated demand for today: 11\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Placing a new order: Order of 100, requested on 2022-12-29 00:00:00, delivery on 2023-01-09 00:00:00.\n",
|
||
|
|
"Simulating day: 2022-12-30 00:00:00\n",
|
||
|
|
"Starting stock: 89\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n",
|
||
|
|
"Simulating day: 2022-12-31 00:00:00\n",
|
||
|
|
"Starting stock: 79\n",
|
||
|
|
"Generated demand for today: 10\n",
|
||
|
|
"Goods received today: 0\n"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# That was a simulation of a full year with the passed parameters. If you go \n",
|
||
|
|
"# carefully through the output, you can see the stock, demand and goods received\n",
|
||
|
|
"# on each date, as well as the placing of orders."
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "UkFu2DpXoj99"
|
||
|
|
},
|
||
|
|
"execution_count": 8,
|
||
|
|
"outputs": []
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"#### Simulation Results"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "Fg4955v-p56d"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# The SimulationResults objects allows to get some summarized statistics from \n",
|
||
|
|
"# a simulation. For example, let's plot the stock in the warehouse over that \n",
|
||
|
|
"# simulation.\n",
|
||
|
|
"\n",
|
||
|
|
"example_simulation_results.plot_stock_history()"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"colab": {
|
||
|
|
"base_uri": "https://localhost:8080/",
|
||
|
|
"height": 265
|
||
|
|
},
|
||
|
|
"id": "svQJQPCZoxFK",
|
||
|
|
"outputId": "d17e6edc-d51c-41f4-8669-9438bf870fef"
|
||
|
|
},
|
||
|
|
"execution_count": 9,
|
||
|
|
"outputs": [
|
||
|
|
{
|
||
|
|
"output_type": "display_data",
|
||
|
|
"data": {
|
||
|
|
"text/plain": [
|
||
|
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
|
],
|
||
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD4CAYAAAAEhuazAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHd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jhFJ0zr0fsqKmbLhtdd5bjmd1peLLQy65jWVgsI50T9j/BVWB52kU/Bz77wbt/zw7+RrXk6wY3FaYO/l7sH8MggbG3+t9TsBhGkRLwTw+ur31wN4Efn7L2mD9wBYV0o9etLBHgW5Iq9c7v547GifVIn+WOc7Kk2CJhkbTSo5N3cP8E2veSf+3/ffJ57r3/23j+B/+a8fnGC0aZwU+iA3T9P7mTO8Kc7/+sr4S/zuOEM/pcZgn9+WMts5asmOMef5v+G9nwYAfPbyNrv95Ezapx/U7MwrPjcp53+j1vpz1e/3A7ix+v0mAPeQ/e6t/hZBKfUypdSdSqk7L168OOFwYuQ8f3rfdw9ij0droN9pY6XfSRr/aTXJvrixy05IukHguQnnv7N/iL3DMT57iS8YAgzF8dAMuUjaXGTWhXN7B2P2ewXyL53WQLdtJDNk45/n/HPfW87zT23XxLBL49SV57827Cafz/VM4dFJmbQXAZSilXTHZo2pBXy1eYuv+U3WWt+htb6gtb5w/vz5aQ2nRtMiL4Bfzlq+dG3YzWRspM/TBHc9sIGvfNUf4D+/59PRNq01Om2Flb68dG/C+TcJtpoVzOz15w/HeubN0Z/14+/AF/7I7yXHIUFD15r+Yh5+wvO3E5s1/pJnn6skttu5mID9PtcTaataA60WsgHfc0vp3PMmP
|
||
|
|
},
|
||
|
|
"metadata": {
|
||
|
|
"needs_background": "light"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# We can also visualize the distribution of the stock level during the full year\n",
|
||
|
|
"\n",
|
||
|
|
"example_simulation_results.plot_stock_distribution()"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"colab": {
|
||
|
|
"base_uri": "https://localhost:8080/",
|
||
|
|
"height": 265
|
||
|
|
},
|
||
|
|
"id": "b5ANCHLmrT6t",
|
||
|
|
"outputId": "01e1f1cd-459a-4cfc-8ef3-78a6c2ec99c9"
|
||
|
|
},
|
||
|
|
"execution_count": 10,
|
||
|
|
"outputs": [
|
||
|
|
{
|
||
|
|
"output_type": "display_data",
|
||
|
|
"data": {
|
||
|
|
"text/plain": [
|
||
|
|
"<Figure size 432x288 with 1 Axes>"
|
||
|
|
],
|
||
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD4CAYAAADrRI2NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd3xc1Z338c9vijTq3bKsLnfjXsDGxoApoQUDIYQsIYQSw6aRsJtANrv7PHmSZxNeZEOym2cTnBAwIZCEFkwvphgDLnIT7pZlyZKsXqxeZuY8f8wYhHGRZc3cKb/36zUvzb0z0v362vr5zLnnniPGGJRSSkUPm9UBlFJKBZcWfqWUijJa+JVSKspo4VdKqSijhV8ppaKMw+oAw5GZmWmKioqsjqGUUmFl8+bNzcaYrGP3h0XhLyoqorS01OoYSikVVkSk6nj7tatHKaWiTEBb/CJSCXQCHsBtjJkvIunAX4EioBK4wRjTFsgcSimlPhGMFv+FxpjZxpj5/u37gDXGmInAGv+2UkqpILGiq2c5sMr/fBVwjQUZlFIqagW68BvgdRHZLCIr/PuyjTF1/uf1QPbxvlFEVohIqYiUNjU1BTimUkpFj0CP6llijKkVkTHAGyKyZ+iLxhgjIsedJc4YsxJYCTB//nydSU4ppUZJQFv8xpha/9dG4DngbKBBRHIA/F8bA5lBKaXUpwWs8ItIgogkHX0OXArsAFYDt/jfdgvwfKAyKKWU+qxAdvVkA8+JyNHjPGGMeVVENgF/E5HbgSrghgBmUEopdYyAFX5jTAUw6zj7W4CLAnVcpUYiv6CQmupDQTue3eHE4x4M2vHy8guoPnTcmzhVFAqLKRuUCrSa6kP88vW9QTvePZdODvrxlDpKC79Sw2CMod/tpXfQg9tjGPR4cXsNbo8X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
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# And check the details of the distribution\n",
|
||
|
|
"\n",
|
||
|
|
"example_simulation_results.stock_level_summary()"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"colab": {
|
||
|
|
"base_uri": "https://localhost:8080/"
|
||
|
|
},
|
||
|
|
"id": "ekTLMm_6salj",
|
||
|
|
"outputId": "6f1a3f50-bbbd-49eb-95ca-f1bb8b5e5a10"
|
||
|
|
},
|
||
|
|
"execution_count": 11,
|
||
|
|
"outputs": [
|
||
|
|
{
|
||
|
|
"output_type": "stream",
|
||
|
|
"name": "stdout",
|
||
|
|
"text": [
|
||
|
|
" 0\n",
|
||
|
|
"count 365.000000\n",
|
||
|
|
"mean 54.411392\n",
|
||
|
|
"std 32.615996\n",
|
||
|
|
"min -24.762915\n",
|
||
|
|
"25% 29.047827\n",
|
||
|
|
"50% 54.524196\n",
|
||
|
|
"75% 79.744893\n",
|
||
|
|
"max 121.614883\n"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# SimulationResults contains some other helpful functions. See the examples \n",
|
||
|
|
"# below:\n",
|
||
|
|
"\n",
|
||
|
|
"service_level = example_simulation_results.service_level()\n",
|
||
|
|
"mean_stock_level = example_simulation_results.mean_stock_level()\n",
|
||
|
|
"median_stock_level = example_simulation_results.median_stock_level()\n",
|
||
|
|
"stdev_stock_level = example_simulation_results.stdev_stock_level()\n",
|
||
|
|
"number_of_purchase_orders = example_simulation_results.number_of_purchase_orders_placed()\n",
|
||
|
|
"\n",
|
||
|
|
"\n",
|
||
|
|
"print(f\"Demand was properly satisfied on {service_level * 100}% of simulated days.\")\n",
|
||
|
|
"print(f\"The mean and median stock level were: {mean_stock_level} and {median_stock_level}.\")\n",
|
||
|
|
"print(f\"There was a total of {number_of_purchase_orders} orders during the simulation.\")"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"colab": {
|
||
|
|
"base_uri": "https://localhost:8080/"
|
||
|
|
},
|
||
|
|
"id": "3nORekD6ptpB",
|
||
|
|
"outputId": "770cf04f-c722-4cf0-fb04-7bab92a11287"
|
||
|
|
},
|
||
|
|
"execution_count": 12,
|
||
|
|
"outputs": [
|
||
|
|
{
|
||
|
|
"output_type": "stream",
|
||
|
|
"name": "stdout",
|
||
|
|
"text": [
|
||
|
|
"Demand was properly satisfied on 95.06849315068493% of simulated days.\n",
|
||
|
|
"The mean and median stock level were: 54.41139166431389 and 54.52419638372521.\n",
|
||
|
|
"There was a total of 37 orders during the simulation.\n"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"### Your turn\n",
|
||
|
|
"\n",
|
||
|
|
"Now that you are familiar with the provided simulation objects, use them to answer Elisa's requests on level 2."
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "GMzPWTWF7kdi"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# Your code goes in cells in this section"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "PpS5hsrP8Tw5"
|
||
|
|
},
|
||
|
|
"execution_count": 13,
|
||
|
|
"outputs": []
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"## Level 3\n",
|
||
|
|
"\n",
|
||
|
|
"From the case description:\n",
|
||
|
|
"\n",
|
||
|
|
" - Right after you finished designing your policy for level 2, Elisa called\n",
|
||
|
|
" with some news: she has just been informed by the management in Diemen\n",
|
||
|
|
" that a new Minimum Order Quantity (MOQ) rule will begin soon. This rule\n",
|
||
|
|
" means that, when the Caserta warehouse places an order to request\n",
|
||
|
|
" material from, the order should be of at least 500,000 kgs of beans, and\n",
|
||
|
|
" not less than that.\n",
|
||
|
|
" - Elisa wants you to take this into account. Does it affect the policy you\n",
|
||
|
|
" proposed for level 2? If so, you need to come up with a new one that\n",
|
||
|
|
" adapts to this rule and compare it to the previous one."
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "mjVrfdcE8Wos"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# Your code goes in cells in this section"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "jRAEfGGu8hUs"
|
||
|
|
},
|
||
|
|
"execution_count": 14,
|
||
|
|
"outputs": []
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "markdown",
|
||
|
|
"source": [
|
||
|
|
"## Level 4\n",
|
||
|
|
"\n",
|
||
|
|
"From the case description:\n",
|
||
|
|
"\n",
|
||
|
|
" - Elisa briefly discussed with you in one meeting that there is an option\n",
|
||
|
|
" to come to an agreement with the team in Diemen to improve the lead time\n",
|
||
|
|
" stability. The proposal from Diemen is that, if the target lead time was\n",
|
||
|
|
" set to something higher that the current 7 days target, providing a more\n",
|
||
|
|
" stable delivery would be feasible.\n",
|
||
|
|
" - The specific proposal from Diemen is: if the lead time target is changed\n",
|
||
|
|
" to 15 days, they provide a 100% guarantee that orders will be delivered\n",
|
||
|
|
" in exactly 15 days.\n",
|
||
|
|
" - Elisa would love if you could take some additional time to study this\n",
|
||
|
|
" proposal. What is better for Caserta? The current 7 days target\n",
|
||
|
|
" lead-time, with unstable deliveries? Or a fixed, 15-day lead time?\n",
|
||
|
|
" - The MOQ rule of level 3 still applies."
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "gVQE6YOq-Ic0"
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"cell_type": "code",
|
||
|
|
"source": [
|
||
|
|
"# Your code goes in cells in this section"
|
||
|
|
],
|
||
|
|
"metadata": {
|
||
|
|
"id": "0q7asO3L-ieE"
|
||
|
|
},
|
||
|
|
"execution_count": 15,
|
||
|
|
"outputs": []
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|