Simulating a Min,Q policy or also called S,Q policy, . The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate an inventory system, orders are lost if inventory level is less than requested demand, also ordering is made at day t+1, metrics like item fill rate and cycle service level are calculated. the min is calculated based on a normal distribution or a poisson distribution, also min can be set manually. Q (fixed quantity) is ordered whenever inventory position reaches min
sim_min_Q(
demand,
mean = FALSE,
sd = FALSE,
leadtime,
service_level,
initial_inventory_level = FALSE,
min = FALSE,
Quantity,
shortage_cost = FALSE,
inventory_cost = FALSE,
ordering_cost = FALSE,
distribution = "normal",
recalculate = FALSE,
recalculate_windows = FALSE,
plot = FALSE,
Backlogs = FALSE
)
A vector of demand in N time periods.
average demand in N time periods.default is FALSE and is automatically calculated. otherwise set manually.
standard deviation in N time periods.default is FALSE and is automatically calculated. otherwise set manually.
lead time from order to arrival
cycle service level requested
integer,Default is False and simulation starts with min as inventory level
integer,Default is False and min is calculated based on mean,demand and leadtime unless set manually
Fixed order quantity to be ordered at min
numeric,Default is FALSE shortage cost per unit of sales lost
numeric,Default is FALSE inventory cost per unit.
numeric,Default is FALSE ordering cost for every time an order is made.
distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom'
Logical, if true the mean and sd is recalculated every period from first period to t,default is FALSE .
integer, the min mean and sd windows to recalculate , for example if it is set to 4 mean and sd is calculated from t to t-4,,default is FALSE, if TRUE, recalculate has to be TRUE Also.
Logical, Default is False, if true a plot is generated
Logical, Default is False, if true inventory level accounts for previous lost orders is calculated from t to t-4,,default is FALSE .
a list of two date frames, the simulation and the metrics.
# NOT RUN {
sim_min_Q(demand = rpois(90,7),leadtime = 5,service_level = 0.95,Quantity = 80,
recalculate = TRUE,distribution = 'normal',recalculate_windows = 5,Backlogs=FALSE)
# }
Run the code above in your browser using DataLab