SimEvents: How to set a resource acquirer amount using a Bus Entity parameter?

2 次查看(过去 30 天)
My Resource Acquirer block receives as input a Bus Entity.
I would like to use one of the parameters carried by the Entity (eg entity.Parts.Wheels.Warning [yes, is a number]) to setup the amount for a certain resource.
I choosed "Amount Source" = "Attribute" and "Amount" = "entity.Parts.Wheels.Warning" but I'm receiving back the following error:
"You have configured the 'Resource Acquirer' block to require an incoming entity that has an attribute named 'entity.Parts.Wheels.Warning'. However, entities that will arrive at this block will not have such an attribute."
I'm sure that the input is correct and the entity has the correct structure.
Any ideas on how to solve?
Thanks
  3 个评论
Simone Rosa
Simone Rosa 2020-1-31
编辑:Simone Rosa 2020-1-31
Hello Renato,
thanks for your question.
In the Entity Generator Block I just declare the Entity type as "Bus Object" and I define the structure of my object using the "Bus Editor".
Then, in the other blocks of my system, I assign values to each element of my Bus Object.
I want to use one of these values to set a resource acquirer amount (Exactly as I use them for example to select the output port in an entity output switch).
Maybe is not possible to do that and I mandatory need an structured entity type instead of a bus object, what do you think?
Thank you
Renato SL
Renato SL 2020-2-3
I skimmed an article about using bus object in Simulink and found that it should be possible to define an entity there (plus the priority and the attributes). Maybe you missed something in the definition of the entity or the definition of the attributes or something else, so that the error is triggered.
I am not familiar with bus object, so I can't say if what you did should be correct or not.
Unless you are obligated to use a bus object, I recommend you to use a structured entity type instead and define the entity attributes in the Entity Generator.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resource Allocation Modeling 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by