How to generate entities with different probability in SimEvents?

5 ビュー (過去 30 日間)
MS
MS 2023 年 2 月 14 日
回答済み: Adit Kirtani 2023 年 2 月 23 日
Hi all!
I want to generate and define 5 different type of entities (let's say 5 customer for a restaurant, and they always order the same thing from the menu, it means the same service time for a specific customer). On the other hand, some of customers come to this restaurant more frequently than others. How can I generate and specify those 5 entities with a probabilistic approach?
I hope my question is comprehensible.
Thanks in advance.

回答 (1 件)

Adit Kirtani
Adit Kirtani 2023 年 2 月 23 日
Hi,
For your question you could use two approaches; using a single entity generator with different attributes to differentiate between customers, or 5 different entity generators.
For multiple generators, you can use change the dt variable as you wish to specify a generation time.
Using the Entity Multicast Blocks and a Multicast Receive Queue Block you can combine the entities and use them as you wish.
For a single generator, you can modify the "Generate" Event Action and specify code to modify attributes of the Entity to differentiate between them, in your example, different customers would have different attributes. Using code you can randomly assign a generated entity to a particular Customer and modify it's attributes accordingly.
Here are a few documentation links as well which may be helpful to you.
I hope this helps,
Adit Kirtani.

カテゴリ

Help Center および File ExchangeSimEvents についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by