SimEvents Control Entity Gate
6 次查看(过去 30 天)
显示 更早的评论
Hi all,
Within SimEvents I'm trying to model a system forwarding entities at a specified time by controlling an entity gate.
Up untill now, I haven't been succesfull trying several different approaches.
Basically, I'm sending an entity from the generator towards the enable gate, once the enable gate is not enabled (controlled by a step or signal editor) the entity may not be forwarded. Currently, the entity is being generated correctly but the control mechanism of the gate does not seem to work, in my idea the gate is always open.
Please see attached file.
Looking forward receiving your reply!
Kind regards,
Colin
2 个评论
Renato SL
2019-8-27
I'd like to help but my MATLAB version is R2017b. Can you provide the .slx file for version R2017b or below?
采纳的回答
Renato SL
2019-8-27
You implemented the Entity Gate like this,
Because you show the enable port, I found that the gate will be open once the enable port receives a positive signal (and will never close even though it receives 0 or negative value) and therefore as you put in the question, you think that "the gate is always open".
So I removed the enable port.
The description in the Entity Gate: "(1) Enable Gate opens when the control port receives a message with a positive value," so I believe that there is no need for an enable port to get the behaviour that you want.
I tested it and voila.
So that's it.
Removing the enable port solved the problem.
PS.
I believe that is an appropriate result even though it seems not as the occurrence of entities are not in line with the time (first entity is not at t=1, second entity is not at t=2, third entity is not at t=4).
The reason for that is that Entity Generators in default are set to hold on to entities that cannot depart from the block. In this case the depart of entities is determined by the opening of the Entity Gate, so that in the plot:
- the first entity in the plot is actually the one generated at t=0 (the generate entity at simulation start tickbox in Entity Generator is ticked) and has just been released because the Entity Gate has just opened at that time
- the next entity is 1 time unit apart from the last departed entity (as period = 1 in the Entity Generator)
- the last entity was supposed to depart 1 time unit after the second one but it was blocked because the Entity Gate is closed. Therefore, it departs as soon as the Entity Gate opens (just before t=4)
0 个评论
更多回答(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!