sim_base_normal: sim_Base_normal

View source: R/sim_base_normal.R

sim_base_normalR Documentation

sim_Base_normal

Description

Simulating a Base Stock policy.

Usage

sim_base_normal(
  demand,
  mean,
  sd,
  leadtime,
  service_level,
  Base = FALSE,
  ordering_delay = FALSE,
  shortage_cost = FALSE,
  inventory_cost = FALSE,
  ordering_cost = FALSE
)

Arguments

demand

A vector of demand in N time periods.

mean

average demand in N time periods.

sd

standard deviation in N time periods.

leadtime

lead time from order to arrival

service_level

cycle service level requested

Base

Set to False for automatic calculation,else manual input of base.

ordering_delay

logical,Default is FALSE,if TRUE, orders are delayed one period.

shortage_cost

shortage cost per unit of sales lost

inventory_cost

inventory cost per unit.

ordering_cost

ordering cost for every time an order is made.

Details

The Function takes a demand vector, mean of demand ,sd,lead time and requested service level to simulate and 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 based on a normal distribution. the base is calculated automatically based on the mean demand and standard deviaiton. every period the order is exactly as the sales.

Value

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

Author(s)

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

Examples

sim_base_normal(demand=rpois(80,6),mean=6,sd=0.2,leadtime=5,service_level=0.95,Base = 50,
shortage_cost= 1,inventory_cost=1,ordering_cost=1,ordering_delay=FALSE)

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