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

2 views (last 30 days)
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 Comments
Simone Rosa
Simone Rosa on 31 Jan 2020
Edited: Simone Rosa on 31 Jan 2020
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 on 3 Feb 2020
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.

Sign in to comment.

Answers (0)

Categories

Find more on Resource Allocation Modeling in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!