Access current simulation time in SimEvents blocks
7 次查看(过去 30 天)
显示 更早的评论
I'd like to access the current simulation time in a SimEvents block like the Entity Server to set attributes accordingly. The use case is to obtain the elapsed time an entity stayed in the Entity Queue in order to set an entity's waiting time attribute. Do SimEvents blocks provide a way to get the current simtime as a parameter without having to specify a Discrete-Event System? Thanks in advance, I appreciate any help you can provide!!
0 个评论
采纳的回答
Devdatt Lad
2016-7-13
You can create a Simulink Function t = getTime() which contains a Digital Clock block and then call this function from any event action from a SimEvents block to get the current time.
2 个评论
Abdolkarim Mohammadi
2021-3-22
Please notice that the sample time of the Digital Clock must be set to inherited (-1).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete-Event Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!