sim_min_Q: sim_min_Q

sim_min_QR Documentation

sim_min_Q

Description

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

Usage

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
)

Arguments

demand

A vector of demand in N time periods.

mean

average demand in N time periods.default is FALSE and is automatically calculated. otherwise set manually.

sd

standard deviation in N time periods.default is FALSE and is automatically calculated. otherwise set manually.

leadtime

lead time from order to arrival

service_level

cycle service level requested

initial_inventory_level

integer,Default is False and simulation starts with min as inventory level

min

integer,Default is False and min is calculated based on mean,demand and leadtime unless set manually

Quantity

Fixed order quantity to be ordered at min

shortage_cost

numeric,Default is FALSE shortage cost per unit of sales lost

inventory_cost

numeric,Default is FALSE inventory cost per unit.

ordering_cost

numeric,Default is FALSE ordering cost for every time an order is made.

distribution

distribution to calculate safety stock based on demand distribution, current choices are 'normal' 'poisson','gamma' and negative binomial 'nbinom'

recalculate

Logical, if true the mean and sd is recalculated every period from first period to t,default is FALSE .

recalculate_windows

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.

plot

Logical, Default is False, if true a plot is generated

Backlogs

Logical, Default is False, if true inventory level accounts for previous lost orders is calculated from t to t-4,,default is FALSE .

Value

a list of two date frames, the simulation and the metrics.

Author(s)

"haytham omar email: <haytham@rescaleanalytics.com>"

Examples

sim_min_Q(demand = rpois(90,7),leadtime = 5,service_level = 0.95,Quantity = 80,
recalculate = TRUE,distribution = 'normal',recalculate_windows = 5,Backlogs=FALSE)

inventorize documentation built on June 1, 2022, 1:07 a.m.