How can read data of entity in queue
Show older comments
Hi, please somebody help me I need to attribute values of entity which are waiting on queue at the any t time. How can read this data of entity when entity wait in queue ?
1 Comment
Ryan G
on 14 Dec 2012
What are you trying to accomplish? You can pull the attribute off the entity before it enters the queue for later use, or perhaps use a different block to accomplish your task.
Accepted Answer
More Answers (2)
Devdatt Lad
on 14 Dec 2012
1 vote
Currently you cannot peek inside a queue to look at entity attributes. As RyanG said, you can only pull out attribute values as entities enter or leave the queue.
With that in mind, you can put together some blocks that will cause all entities in the queue to leave the queue, and be fed back to the same queue in a feedback loop. Use a signal to open a gate or something that triggers this whole feedback loop. As each entity goes round the loop, pull off any attribute values you care about and send the entity back into the same queue.
This scheme will work if you want to iterate over ALL entities in the queue. If you just want the attribute value of the last entity that entered, or last entity to leave the queue, Ryan's suggestion would be better. Use a Signal Latch to save the attribute value before the entity enters the queue.
777777
on 31 Oct 2017
0 votes
Hi,I have a similar problem with you .Can you show me how to resolve this problem ? I want to use the data I stored in Queue ,but I don't know how to do it .
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!