Pre-determined batch()

51 views
Skip to first unread message

Eras

unread,
Apr 9, 2020, 8:09:39 AM4/9/20
to simmer-devel
Hi there, 

I want to batch arrivals based on some numeric attribute `poolId`. Here I want to give each batch a name equal to `poolId` where each batch has a predetermined size based on the arrival attribute 'poolSize'. Then, an arrival should be included in the specific batch that has name=poolId where poolId is equal to the arrivals' poolId attribute. 

Then using:
batch(n,  permanent = TRUE, name = "", rule = NULL)

I want to model something like this to achieve the above:
batch(function() get_attribute(env, "poolSize"),  permanent = TRUE, name = function() get_attribute(env, "poolId"), rule = NULL)

Above did not work so I tried to update some global variables poolIdGlobal and poolSizeGlobal once an arrival passed through the function get_pool_parameters() as follows:
timeout(function() get_pool_parameters()) %>%
batch(poolIdGlobal ,  permanent = TRUE, name =  poolIdGlobal , rule = NULL)
However, this did not work out as well.

What can be used to create the type of batches described above? That is, to determine if a new batch should be created (if there was no previous arrival with attribute 'poolId') or whether the current arrival should be added to a previously created batch with name 'poolId'.

Iñaki Ucar

unread,
Apr 9, 2020, 6:20:51 PM4/9/20
to simmer-devel
Please, check the reference page [1] and the arguments. The size of a
batch is a static parameter, you can't provide a function. The name is
just an identifier to be able to share the same batch in several
trajectories. The rule argument though can be used to dynamically
decide if an arrival joins a batch or continues.

[1] https://r-simmer.org/reference/batch.html
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/simmer-devel/efc083bc-0896-4a6d-9794-689267ea5249%40googlegroups.com.



--
Iñaki Úcar

rrom...@up.edu.mx

unread,
May 18, 2021, 9:18:31 AM5/18/21
to simmer-devel
Hi Iñaki,

Based on your answer then I'm assuming that we cannot set dynamic batch sizes and that if we need to do so, we should find another way of modeling dynamic batches. Is that correct?

Thanks for the help!

Regards,
Rodrigo

Iñaki Ucar

unread,
May 18, 2021, 9:19:48 AM5/18/21
to simmer-devel
On Tue, 18 May 2021 at 15:18, rrom...@up.edu.mx <rrom...@up.edu.mx> wrote:
Hi Iñaki,

Based on your answer then I'm assuming that we cannot set dynamic batch sizes and that if we need to do so, we should find another way of modeling dynamic batches. Is that correct?

Yes, that's correct.

Iñaki
 
POLÍTICA DE PRIVACIDAD: Las instituciones pertenecientes al Sistema UP-IPADE utilizarán cualquier dato personal expuesto en el presente correo electrónico, única y exclusivamente para cuestiones académicas, administrativas, de comunicación, o bien para las finalidades expresadas en cada asunto en concreto, esto en cumplimiento con la Ley Federal de Protección de Datos Personales en Posesión de los Particulares. Para mayor información acerca del tratamiento y de los derechos que puede hacer valer, usted puede acceder al aviso de privacidad integral a través de nuestras páginas de Internet: www.up.edu.mx / prepaup.up.edu.mx / www.ipade.mx / www.ipadealumni.com.mx 
La información contenida en este correo es privada y confidencial, dirigida exclusivamente a su destinatario. Si usted no es el destinatario del mismo debe destruirlo y notificar al remitente absteniéndose de obtener copias, ni difundirlo por ningún sistema, ya que está prohibido y goza de la protección legal de las comunicaciones.

--
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.

rrom...@up.edu.mx

unread,
May 18, 2021, 9:32:35 AM5/18/21
to simmer-devel
Thanks for the quick answer!
Reply all
Reply to author
Forward
0 new messages