r-simmer / simmer

Discrete-Event Simulation for R
https://r-simmer.org
GNU General Public License v2.0
222 stars 42 forks source link

Airport control security #289

Closed Jbbbb777 closed 1 year ago

Jbbbb777 commented 1 year ago

I am trying to do a security check in an airport and i am meant to use a poisson distribuition instead of a exponential. Also i have 22 counters which it has a singular queue or one queue for each counter. The plots are not great so i may have some errors. Security time consists in preparation time plus scanning time. It is supposed to be an 1 hour simulation.

This is the code

env <- simmer("airport") env lambda = 1384/60

passenger <- trajectory("passenger path") %>% log("Arrived") %>% seize("validation machine", 1) %>% timeout(function() runif(1,.016,.05 )) %>% release("validation machine", 1) %>% log("Validated") %>%

seize("counter") %>% timeout(function() rexp(1, lambda)) %>% release("counter") %>% log_("arrived security") %>%

seize("security time",1) %>% timeout(function() rtri(1,min= .17 ,max= .75, mode= .33)) %>% release("security time", 1) %>% log_("Vou-me embora(security time)")

env %>% add_resource("validation machine", 3) %>% add_resource("counter", 22) %>% add_resource("security time",1) %>% add_generator("passenger", passenger, function() rexp(1 , lambda ))

env %>% run(until= 60)

Enchufa2 commented 1 year ago

Closing this in favour of #290