Setting block parameters programatically inside a simevents block's event actions
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Robert Kugler
el 9 de Ag. de 2021
Respondida: Abdolkarim Mohammadi
el 2 de Sept. de 2021
Hello,
I would like to modify the batch size an entity batch creator applies after each batch creation (more specifically: after each created batch, the next batch size shall vary randomly). To do this, I would like to modify the block's parameter "Number of entities in batch" inside the following field (batch generate - since it's called right after batch generation):
From the documentation I understand that the parameter can be accessed through "NumberOfEntitiesInBatch". However, if I simply write NumberOfEntitiesInBatch = XYZ nothing happens/changes. The batch sizes don't seem to be set randomly after each batch creation. I assume I have to access it by something along the lines of thismodel.thisblock.NumberOfEntitiesInBatch = XYZ or so.
Can anyone let me know how to appy code correctly here? Thanks in advance!
0 comentarios
Respuesta aceptada
Abdolkarim Mohammadi
el 2 de Sept. de 2021
I do not have an exact solution for your problem, but I'm sure SimEvents' block parameters cannot be changed when the model is running. However, MDES (MATLAB Discrete-Event System) is a powerful block than enables you to create customized discrete-event blocks. I think there is a high chance you can solve your problem there.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Discrete-Event Simulation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!