Single Stage Periodic Review Inventory Policy

Single Stage Periodic Review Inventory Policy preview image

1 collaborator

Default-person Dajun Yue (Author)

Tags

inventory 

Tagged by Dajun Yue about 6 years ago

supply chain 

Tagged by Dajun Yue about 6 years ago

Part of project 'Supply Chain Models'
Model group MAM-2013 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.4 • Viewed 446 times • Downloaded 24 times • Run 0 times
Download the 'Single Stage Periodic Review Inventory Policy' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;; Single stage model, EOQ model

globals [
  unit-price
  unit-holding-cost
  unit-backorder-penalty               ;; These are the given cost parameters
  demand-today
]



turtles-own [
  bs 
  on-hand-stock 
  back-order
  inventory-position                   ;; The storage unit follows the (r,Q) policy
  alpha-service-level
  beta-service-level
  pipeline
  
  variable-order-cost              ;; no fixed-order cost
  inventory-holding-cost
  back-order-penalty
  total-cost
  
  num-filled
  num-missed
  quantity-filled
  quantity-missed
  
  checklist
]

to setup
  ca
  
  set unit-price 1
  set unit-holding-cost 0.05
  set unit-backorder-penalty 2
  
  
  set-default-shape turtles "circle"
  crt 1 [
    set color red 
  ]
  ask turtles [
    set on-hand-stock initial-inventory
    set back-order 0
    set inventory-position (on-hand-stock - back-order)
    set total-cost 0
    
    set bs base-stock-level 
    set pipeline n-values lead-time [0]
    set checklist n-values (review-period - 1) [0]
    set checklist lput 1 checklist
    set variable-order-cost 0 
    
    resize-shape
  ]
  reset-ticks
end 

to go
  if ticks >= 1000 [stop]
  update-policy
  set demand-today daily-demand            ;; demand for every day is different
  ask turtles [
    receive
    sell
    replenish
    calculate-service-level
    resize-shape
  ]
  update-plot
  tick
end 

to update-policy
  ask turtles [
    set bs base-stock-level                 ;; inventory policy can be adjusted on the fly
  ]  
end 

to-report should-order?
  report inventory-position <= bs and first checklist = 1                 ;; If the inventory position is below reorder point r, we should place an order
end                                                   

to receive
  let amount-received first pipeline                         ;; amount-received equals to the first item in "pipeline" list 
  ifelse back-order > 0                                      
  [
    ifelse back-order >= amount-received                     ;; after receiving the order, update on-hand stock and back-orders
    [
      set back-order (back-order - amount-received)
    ]
    [
      set back-order 0
      set on-hand-stock (amount-received - back-order)
    ]
    
  ]
  [
    set on-hand-stock (on-hand-stock + amount-received)
  ]
end 

to sell
  ifelse on-hand-stock >= demand-today
  [
    set on-hand-stock (on-hand-stock - demand-today)
    set num-filled num-filled + 1
    set quantity-filled (quantity-filled + demand-today)               ;; according to today's demand, update the on-hand stock and back-orders
  ]
  [
    set num-missed num-missed + 1                                      ;; if a demand is not fully met, num-missed + 1
    ifelse on-hand-stock > 0                                           ;; filled demand goes to quantity-filled, unfilled demand goes to quantity-missed
    [
      set quantity-filled (quantity-filled + on-hand-stock)
      set quantity-missed (quantity-missed + demand-today - on-hand-stock)
      
      set on-hand-stock 0
      set back-order (demand-today - on-hand-stock)
    ]
    [
      set quantity-missed (quantity-missed + demand-today)
      
      set back-order (back-order + demand-today)
    ]
  ]
end 

to replenish
  ifelse should-order? [
    set pipeline lput amount-to-order pipeline                                       
    
    set variable-order-cost variable-order-cost + unit-price * amount-to-order
  ]
  [
    set pipeline lput 0 pipeline                                      ;; if place an order, put the order quantity q into pipeline list
  ]
  set pipeline but-first pipeline
  set inventory-position sum pipeline + on-hand-stock - back-order                 ;; note that inventory position = on-hand stock - back-orders + inventory in-transit
  
  rotate-checklist
  
  set inventory-holding-cost inventory-holding-cost + on-hand-stock * unit-holding-cost
  set back-order-penalty back-order-penalty + back-order * unit-backorder-penalty
  set total-cost (variable-order-cost + inventory-holding-cost + back-order-penalty)
end 

to update-plot
  set-current-plot-pen "on-hand"
  plot sum [on-hand-stock] of turtles              ;; draw inventory profile on the plot
  
  set-current-plot-pen "back-ordered"
  plot sum [back-order] of turtles
  
  set-current-plot-pen "inv-position"
  plot sum [inventory-position] of turtles
end 

to calculate-service-level
  set alpha-service-level num-filled / (num-filled + num-missed)                   ;; alpha-service level is based on times filled
  set beta-service-level quantity-filled / (quantity-filled + quantity-missed)     ;; beta-service level is based on quantity filled
end 

to resize-shape
  set size 0.5 * (sqrt on-hand-stock)          ;; visualize the on-hand stock via size of the turtle
end 

to-report truncated-normal [mean-value std-value min-value max-value]
  let random-num random-normal mean-value std-value
  ifelse random-num > max-value or random-num < min-value
  [report min-value + random-float (max-value - min-value)]
  [report random-num]
end 

to-report daily-demand
  if distribution = "deterministic"
    [report deterministic-demand]          ;; deterministic demand
  
  if distribution = "poisson" 
    [report random-poisson mean-for-poisson]             ;; Here we assume that the daily demand follows the Poisson distribution
  
  if distribution = "normal"          
    [report truncated-normal mean-for-normal std-for-normal lower-bound-for-normal upper-bound-for-normal]   ;; truncated normal
end  

to-report amount-to-order
  report max list (bs - inventory-position) 0
end 

to rotate-checklist
  let check-today first checklist
  set checklist but-first checklist
  set checklist lput check-today checklist
end 

There is only one version of this model, created about 6 years ago by Dajun Yue.

Attached files

File Type Description Last updated
Single Stage Periodic Review Inventory Policy.png preview Preview for 'Single Stage Periodic Review Inventory Policy' about 6 years ago, by Dajun Yue Download
Yue_Dajun_Final_Report.docx word Final report for EECS 372/472 about 6 years ago, by Dajun Yue Download
Yue_Dajun_Jun4.docx word description of general network model about 6 years ago, by Dajun Yue Download
Yue_Dajun_May21.docx word Revised proposal with progress report about 6 years ago, by Dajun Yue Download
Yue_Dajun_May27.docx word sequential chain about 6 years ago, by Dajun Yue Download
Yue_Dajun_Poster.pdf pdf Poster for the final project about 6 years ago, by Dajun Yue Download

This model does not have any ancestors.

This model does not have any descendants.