Dear Experts, need your opinion..
A center for treatment of leukemia has only 30 beds
Treatment involves the following process:
Induction 1--> Induction 2 --> Consolidation 1 --> Consolidation 2
Step #1 --> Induction 1
-accepting new cases to receive Chemotherapy Known as Induction 1 Regimen
-rate of arrival 2.3 patients / week
-average length of stay (ALOS) = 31 days
Step #2 --> Induction 2
-84.2 % of patients from step #1 arrive successfully to this step
-ALOS = 28 days
-highest priority for admission
Step #3 --> Consolidation 1
-74.6% of patients from step#1 arrive successfully to this
step
-ALOS = 25 days
- priority for admission less than step#2 but higher than step#1
Step #4 --> Consolidation 2
-73.5% of patients from step#1 arrive successfully to this step
-ALOS = 31.5 days
- priority for admission less than step#2 but higher than step#1
Using the R-script below, running the simulation for 2 years (730 days) and 30 beds gave the following
server status: 30(30) | queue status: 42
> mean(x$queue)
[1] 22.3562
Using the R-script below, running the simulation for 2 years (730 days) and 31 beds gave the following
server status: 31(31) | queue status: 13> mean(x$queue)
[1] 6.314767
Using the R-script below, running the simulation for 2 years (730 days) and 32 beds gave the following
server status: 30(32) | queue status: 0> mean(x$queue)
[1] 0.57 Does this mean that: "if I increase the center capacity from 30 to 32 beds, I will have no waiting list?"
library(simmer)
# rate of new patient arrival = 2.3 per week# inter-arrival time (IAT)= 7/2.3 days #rn = interarrival time of new cases who will receive Induction 1rn <- 7/2.3 # IAT = 7/2.3, Priority = 1 #rind2 = interarrival time of patients who will receive Induction 2rind2 <- (1/0.842) * rn # priority = 9 #consol1 = interarrival time of patients who will receive consolidation 1rconsol1 <- (1/0.746) * rn # priority = 8 #consol1 = interarrival time of patients who will receive consolidation 2rconsol2 <- (1/0.735) * rn # priority = 8 env <- simmer("AML-env") ## add a new patient trajectorynewpatient <- create_trajectory("newAMLpatientpath") %>% seize("bed", amount = 1, priority = 1) %>% ## 31 day timeout(function() rnorm(1, 31, 2)) %>% release("bed", 1) ## add a Induction2 patient trajectoryrind2patient <- create_trajectory("rind2AMLpatientpath") %>% seize("bed", amount = 1, priority = 9) %>% ## 28 days timeout(function() rnorm(1, 28, 2)) %>% release("bed", 1) ## add a Consolidation1 patient trajectoryconsol1patient <- create_trajectory("consol1AMLpatientpath") %>% seize("bed", amount = 1, priority = 8) %>% ## 25 days timeout(function() rnorm(1, 25, 2)) %>% release("bed", 1) ## add a Consolidation2 patient trajectoryconsol2patient <- create_trajectory("consol2AMLpatientpath") %>% seize("bed", amount = 1, priority = 8) %>% ## 31.5 days timeout(function() rnorm(1, 31.5, 2)) %>% release("bed", 1) env %>% add_resource("bed", 30) %>% add_generator("newpatient", newpatient, function() rn) %>% add_generator("rind2patient", rind2patient, function() rind2) %>% add_generator("consol1patient", consol1patient, function() rconsol1) %>% add_generator("consol2patient", consol2patient, function() rconsol2) env %>% run(until=730) ## run for two years (365 * 2 = 730)x<-env %>% get_mon_resources()y<-env %>% get_mon_arrivals()mean(x$queue)Does this mean that: "if I increase the center capacity from 30 to 32 beds, I will have no waiting list?"
Thanks a lot for your response. I did not know it is possible to make patients go through subsequent stages in r-simmer. How is this possible ? In the examples provided with documentation I could not find an example of entities in sequence. I might need your help, if possible.
Regarding IATs I can use a distribution (prefer exponential ?)
--
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/93bebb04-1325-4f1d-9a91-292b352cc38a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/99e9da8e-bbb8-4333-8d92-ff240091dae4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
What do you mean by "breakdown the queue"?
You received this message because you are subscribed to the Google Groups "simmer-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAGJu%2B0SdiONjj03iFckO0yAuqmV02SoWsgxtv3dLxyd%2Bq0KcYQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq3Z2HZ__Z%2Bgg3CKzVkdymXaSYMmzxP8yzcQHH4Wyu%3DYUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAGJu%2B0Q%2BOSPwk4tchrxGcMoN_Ypu8V-iHDWccgdOZRLyt1Epfw%40mail.gmail.com.
To unsubscribe from this group and all its topics, send an email to simmer-devel+unsubscribe@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/99e9da8e-bbb8-4333-8d92-ff240091dae4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Mohamed Kamal, R.Ph., CHRP
--
You received this message because you are subscribed to the Google Groups "simmer-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simmer-devel+unsubscribe@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAGJu%2B0SdiONjj03iFckO0yAuqmV02SoWsgxtv3dLxyd%2Bq0KcYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq3Z2HZ__Z%2Bgg3CKzVkdymXaSYMmzxP8yzcQHH4Wyu%3DYUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--Mohamed Kamal, R.Ph., CHRP
--
You received this message because you are subscribed to the Google Groups "simmer-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAGJu%2B0Q%2BOSPwk4tchrxGcMoN_Ypu8V-iHDWccgdOZRLyt1Epfw%40mail.gmail.com.
Experts
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/99e9da8e-bbb8-4333-8d92-ff240091dae4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Mohamed Kamal, R.Ph., CHRP
--
You received this message because you are subscribed to the Google Groups "simmer-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAGJu%2B0SdiONjj03iFckO0yAuqmV02SoWsgxtv3dLxyd%2Bq0KcYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq3Z2HZ__Z%2Bgg3CKzVkdymXaSYMmzxP8yzcQHH4Wyu%3DYUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--Mohamed Kamal, R.Ph., CHRP
--
You received this message because you are subscribed to the Google Groups "simmer-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAGJu%2B0Q%2BOSPwk4tchrxGcMoN_Ypu8V-iHDWccgdOZRLyt1Epfw%40mail.gmail.com.
--
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/e45765c7-1782-4afb-ae68-b3b7e2d3349b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To avoid a branch inside a branch inside a branch… I would simulate something like this:
patient <- create_trajectory() %>%
seize("waiting_induction1", 1) %>%
seize("bed", 1, priority=induction1) %>%
release("waiting_induction1", 1) %>%
timeout(induction1_timeout) %>%
branch(induction1_prob_continue, c(T, F),
create_trajectory() %>% release("bed"),
create_trajectory() %>% release("bed")) %>%
seize("waiting_induction2", 1) %>%
seize("bed", 1, priority=induction2) %>%
release("waiting_induction2", 1) %>%
timeout(induction2_timeout) %>%
...
and so on, where “waiting_induction1”, “waiting_induction2”… are resources with infinite capacity allocated to count how many patients are waiting for each stage.
--
You received this message because you are subscribed to the Google Groups "simmer-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAJ2peNeD00hUgjXJDfWFkeRoqazGwKFKjkqB9iQDBVYmuM-X0g%40mail.gmail.com.
Thanks a lot. Would you kindly advise me how to get waiting time data as vector. I can only get it as curve using function plot_evolution_arrival_times(env, "waiting_time")
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq2ZcXT6kOtA07_Fz1r8hN1QUX6B_cSY04C5KROaEsPoDw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47cnPPR%2BhGarRzQsffGws7C_tbbj0%3DZ-C6g%3D9T8S8%2BkKyVA%40mail.gmail.com.
what if the patient is discharged from the hospital for 5 days before re-admission. I don't want to count those 5 days as waiting time (because it is not). How is it possible to do it in simmer?
No, you shouldn’t. You need, instead of function() rexp(1, 1/myIAT), a new function returning one time rexp(1, 1/myIAT) and 9 times 0, one time rexp(1, 1/myIAT), 9 times 0, and so on.
--
You received this message because you are subscribed to the Google Groups "simmer-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/1fff68d7-aea2-46ff-b15c-82d200788ac8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq1Gnb6y1jnni0YT8nqaUnx96Ot7JA9QeUwAQ1E8EC9Wvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAGJu%2B0Q78Zpd7nfJcPp56yAKTnn5YX6v8VKAPu5C-7V4kCp%3Dgw%40mail.gmail.com.
Thanks Shawn. That does the trick.
However, this is easier with the current version (check out the master branch on GitHub), because the generation function can return more than one value at once (see #65), so now we can do the following:
add_generator("newpatient", newpatient, function() c(rexp(1, 1/myIAT), rep(0, 9)))
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CAJ2peNfj2m5nmpHykYmRfD0d03XaYj%2B3XBFDzZzBcBVkZZFHUg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47cmjtnzXq%2B7WBXU9VfzZmo0GH-DU3HEX6oHjzX_MSrs3LQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq1LgzFBkj5vgjjb_2DtUHg8mg%2BE0OtGKfCGOSHfD8GnbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Is it possible that "waiting time" be negative values ?
--
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq05ta4V7zfr_FHDTjHVieH1wLUcrBb0QO%3DDJAKE%3DPL3BA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "simmer-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47cm4qTj43iwoqB3ZPe3g4gBtL7om5vept%2BsqRGubJ7OWhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Could you please send me a zip file to install it as I have no experience to install it from github
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq2R7kRftyPrd22sk29b5DYsq0Y3RY_S2hc3iHskAvX_dA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47ckSzZ3XEczmrZkn3W7kaP8Vw0Vmcv7nYgXnfTyb4zPXsg%40mail.gmail.com.
Thanks
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq2jFQ2E4FMjHugHCBAAb4Qh%2BJhKpnKgm32QS%3DmtdXJVcA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47cnAGrUb4UyCVLK7qgaCZJ-%3D6XZ2GbAy%3D47008j_Jczq_g%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq1T0M5KGWFr6GmiwHbBEQ_ncuHS40eTpyPOZTxGd63f3A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47ckGNSxUFONQzfyaTfrFcyPASi7dy%3D3-yrD4CK%2BzL3U0zg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq2T_1N2d9eZQ%2BxWhAJupnE9wETOFuXPvUn4o8Bo_FkPXg%40mail.gmail.com.
For a reason or another the only version working is the one on CRAN. Is there any snippet of script to prevent cumulative sum of timeout inside a branch
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47cmXewEc6ML_d%3D-ugvSqjOpPg7C0-smTK_6%3DzsdjusRhjg%40mail.gmail.com.
BTW, in order to avoid so many nested branches in your model, you’ll be probably interested in the new activity called leave, which does exactly what you need: leave a trajectory with some probability.
Have any sample ?
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq1jqu7LVC38Vb7Bz-ycwXxk9tYis70oAk7hq2qkqJjZYA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47cnsFs2yZ%3DFXBTDvV51vJzjyHt46BNDeGDAnu-oKLjDz0g%40mail.gmail.com.
branch(function() sample(c(1,2),size=1,replace=T,prob=c(0.2,0.8)), merge=c(T, T),
create_trajectory("relapse") %>%
seize("bed", amount = 1, priority = 1) %>%
seize("relapse", amount = 1, priority = 1) %>%
timeout(function() rnorm(1, 40, 2)) %>%
release("bed", 1)
,
create_trajectory("relapse_out") %>%
seize("bed", amount = 1, priority = 9) %>%
seize("relapse_out", amount = 1, priority = 1) %>%
timeout(function() rnorm(1, 10, 2)) %>%
release("bed", 1)
)
So, in such case there is no other option but to use branch inside a branch, right?To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq3XZ8SV3WSeS_fhU%3DNivBeSDYLONUWhzmZBNF%2B4HGd0-w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47cm-6%2B9qinhLM6ibwjjO5y8yGst3Shfwm06DqYDxbWFttA%40mail.gmail.com.
Congratulations for version 3.3 btw
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq0QZrH8oVp7hQ73bt5f6g8E-XwLvuRJ7GFZwchr_2eN8Q%40mail.gmail.com.
get_mon_resources does NOT have a per_resource argument nor a finished column in the resulting data frame.get_mon_arrivals does have a per_resource argument, butper_resource=F (default) shows a finished column, and you’ll see TRUEs and FALSEs.per_resource=T does NOT show a finished column.To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47c%3Dx8p2yWzCff_b_nHtr_iKH27L02mcxBqZF_4UG5cw%2BgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Thanks, but I always have "TRUE" only. If for example 200 patients generated I only have 160-170 records with finished= "true" but zero records with finished= false
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq2VSRRhMjg1nRdza36L8MQdN2pSKR2zv0RygRztJ%3DhK6w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47cm-Z5QFmpaATQyz4isJBrzdjyC4%2Bj1WJxgo%3Dxu0NrRfvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Sorry for bothering, how can a patient get rejected
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq3C8j65mfDNaf9joYa277PJCChFXwnY6a8-K6zu8X6Rug%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALz47c%3DaPs2ZKtdjDqaahz4YXp-_Rxd3xx-Jz9S_FSXbt%3DnG_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
"waiting time evolution" plot is plotted from the waiting time
calculated from the get_mon_arrivals(per_resource=FALSE), right?
--
You received this message because you are subscribed to a topic in the Google Groups "simmer-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/simmer-devel/sXcFXvUDD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to simmer-devel...@googlegroups.com.
To post to this group, send email to simmer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/CALEXWq2ikTVO6cXVH-12Yiy43HcQFrs8g0q9EMC35fL_y_D4uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.