フィルターのクリア

SimEvents: route using on attribute

2 ビュー (過去 30 日間)
Joel
Joel 2014 年 10 月 16 日
編集済み: Abdolkarim Mohammadi 2021 年 3 月 13 日
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 件のコメント
Thomas vandeputte
Thomas vandeputte 2021 年 3 月 11 日
Hi, i wonder if you found a method to do this?

サインインしてコメントする。

回答 (1 件)

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2021 年 3 月 12 日
編集済み: Abdolkarim Mohammadi 2021 年 3 月 13 日
You can create a scalar attribute, whose value is equal to the first element of the vector.
entity.Attribute2 = out_package (1);

カテゴリ

Help Center および File ExchangeDiscrete-Event Simulation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by