Spaces:
Runtime error
Runtime error
ademarteau commited on
Commit ·
ff33a83
1
Parent(s): b7d695d
fixed all environment files
Browse files- demand_calculator.py +1 -1
- demand_environment.py +1 -1
- inventory_manager.py +1 -1
- main.py +1 -1
- montecarlo_simulator.py +1 -1
- order_processor.py +1 -1
- performance_tracker.py +1 -0
demand_calculator.py
CHANGED
|
@@ -4,7 +4,7 @@ from dataclasses import dataclass
|
|
| 4 |
from typing import Tuple
|
| 5 |
from config import LEAD_TIME
|
| 6 |
|
| 7 |
-
|
| 8 |
np.random.seed(42)
|
| 9 |
|
| 10 |
@dataclass
|
|
|
|
| 4 |
from typing import Tuple
|
| 5 |
from config import LEAD_TIME
|
| 6 |
|
| 7 |
+
#Demand_Calculator
|
| 8 |
np.random.seed(42)
|
| 9 |
|
| 10 |
@dataclass
|
demand_environment.py
CHANGED
|
@@ -5,7 +5,7 @@ from config import SHAPE_GAMMA_POISSON, LAMBDA_GAMMA_POISSON, SCALE_GAMMA_POISSO
|
|
| 5 |
SCALE_GAMMA_GAMMA_LOW_MEAN, SHAPE_GAMMA_GAMMA_HIGH_MEAN, SCALE_GAMMA_GAMMA_HIGH_MEAN, SHAPE_GAMMA_LOW_VAR, \
|
| 6 |
SCALE_GAMMA_LOW_VAR, RATE_SPORADIC_HIGH
|
| 7 |
from demand_calculator import DailyDemandDistribution, DemandCalculator
|
| 8 |
-
|
| 9 |
class Environment(ABC):
|
| 10 |
def __init__(self, sim_days: int):
|
| 11 |
self.sim_days = sim_days
|
|
|
|
| 5 |
SCALE_GAMMA_GAMMA_LOW_MEAN, SHAPE_GAMMA_GAMMA_HIGH_MEAN, SCALE_GAMMA_GAMMA_HIGH_MEAN, SHAPE_GAMMA_LOW_VAR, \
|
| 6 |
SCALE_GAMMA_LOW_VAR, RATE_SPORADIC_HIGH
|
| 7 |
from demand_calculator import DailyDemandDistribution, DemandCalculator
|
| 8 |
+
#Demand_Environment
|
| 9 |
class Environment(ABC):
|
| 10 |
def __init__(self, sim_days: int):
|
| 11 |
self.sim_days = sim_days
|
inventory_manager.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from config import WRITE_OFF_RATE, BASE_STOCK, DEFAULT_SERVICE_LEVEL, MC_SIMS
|
| 2 |
-
|
| 3 |
class InventoryManager:
|
| 4 |
def __init__(self, order_processor, agent):
|
| 5 |
self.inventory = BASE_STOCK
|
|
|
|
| 1 |
from config import WRITE_OFF_RATE, BASE_STOCK, DEFAULT_SERVICE_LEVEL, MC_SIMS
|
| 2 |
+
#Inventory_Manager
|
| 3 |
class InventoryManager:
|
| 4 |
def __init__(self, order_processor, agent):
|
| 5 |
self.inventory = BASE_STOCK
|
main.py
CHANGED
|
@@ -5,7 +5,7 @@ from demand_calculator import DemandCalculator
|
|
| 5 |
from config import SIM_DAYS, N_SIMULATIONS
|
| 6 |
import ciw
|
| 7 |
ciw.seed(11)
|
| 8 |
-
|
| 9 |
simulation_version = input("Choose a simulation version (0-3):\n"
|
| 10 |
"0: Historical Demand Agent\n"
|
| 11 |
"1: Safety Stock Agent\n"
|
|
|
|
| 5 |
from config import SIM_DAYS, N_SIMULATIONS
|
| 6 |
import ciw
|
| 7 |
ciw.seed(11)
|
| 8 |
+
#Main
|
| 9 |
simulation_version = input("Choose a simulation version (0-3):\n"
|
| 10 |
"0: Historical Demand Agent\n"
|
| 11 |
"1: Safety Stock Agent\n"
|
montecarlo_simulator.py
CHANGED
|
@@ -4,7 +4,7 @@ from demand_calculator import DemandCalculator
|
|
| 4 |
from order_processor import OrderProcessor
|
| 5 |
from inventory_manager import InventoryManager
|
| 6 |
from performance_tracker import PerformanceTracker
|
| 7 |
-
|
| 8 |
class MonteCarloSimulator():
|
| 9 |
def __init__(self, agent, environment):
|
| 10 |
self.agent = agent
|
|
|
|
| 4 |
from order_processor import OrderProcessor
|
| 5 |
from inventory_manager import InventoryManager
|
| 6 |
from performance_tracker import PerformanceTracker
|
| 7 |
+
#MC_Simulator
|
| 8 |
class MonteCarloSimulator():
|
| 9 |
def __init__(self, agent, environment):
|
| 10 |
self.agent = agent
|
order_processor.py
CHANGED
|
@@ -2,7 +2,7 @@ from dataclasses import dataclass
|
|
| 2 |
from typing import List
|
| 3 |
import numpy as np
|
| 4 |
from config import LEAD_TIME, LEAD_TIME_JITTER
|
| 5 |
-
|
| 6 |
@dataclass
|
| 7 |
class Order:
|
| 8 |
arrival_day: int
|
|
|
|
| 2 |
from typing import List
|
| 3 |
import numpy as np
|
| 4 |
from config import LEAD_TIME, LEAD_TIME_JITTER
|
| 5 |
+
#Order_processor
|
| 6 |
@dataclass
|
| 7 |
class Order:
|
| 8 |
arrival_day: int
|
performance_tracker.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
class PerformanceTracker:
|
| 2 |
|
| 3 |
def __init__(self):
|
|
|
|
| 1 |
+
#KPIs
|
| 2 |
class PerformanceTracker:
|
| 3 |
|
| 4 |
def __init__(self):
|