How to control a Release Gate with data computed in another Subsystem?
Show older comments
Hello everyone,
I am trying to do a traffic simulation with SimEvents (Matlab R2013b). Since I have cars, that change their data continuously and entities, which are in a discrete event system I have to synchronize both parts. For a straight street my approach was to store the entities in a N-Server until the car has passed the straight and then let it out. The data of the car is stored in a matrix and each car has its own ID. Now the SimEvents system needs to check in the Matrix if the car already passed and then needs to open the release gate. If I try implementing this the function, which reads the memory matrix, is just executed once and the I also tried using "Event To Timed Signale" Blocks before and after the function, which reads the memory. But then I get an algebraic loop error. If I break this loop with an delay, my data gets too old, which falsifies my simulation. Do you have any ideas how to solve this? Is there a possibility to tell Simulink, to execute this function continuously?
Thanks for your help. I attached an example code.
Lucas
Accepted Answer
More Answers (0)
Categories
Find more on Discrete-Event Simulation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!