SimEvents: route using on attribute
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I assign an attribute to an entity that is a 1D-Vector with a 10 elements. The attribute looks like this:
out_package = [ 1 1 245 247 40 248 245 124 204 36 ]
Now, what I'd love to do is to route the entities based on the first one. So all entities with the first value of the attribute vector '1' get routed into one queue, all entities with the first value of the attribute vector = '2' will get routed into another queue and so on. How do I do this? I see that the output switch can switch depending on the entitys attribute but does not seem to be able to handle my vector.
Any ideas?
1 Kommentar
Antworten (1)
Abdolkarim Mohammadi
am 12 Mär. 2021
Bearbeitet: Abdolkarim Mohammadi
am 13 Mär. 2021
You can create a scalar attribute, whose value is equal to the first element of the vector.
entity.Attribute2 = out_package (1);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Discrete-Event Simulation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!