Jump to content

Reference a Model State Variable in a Model Entity Process


jdf7fs
 Share

Recommended Posts

Hey all,


My team is developing a model to simulate a network of electric fleet vehicles. We are hoping to track the number of cars parked at a charger in the model as a state variable (called NumCars), and then reference this value in the "processes" tab of the model entity, in order to assign individual cars certain values (called Signal).


We have been unable to correctly reference NumCars in the Signal process within model entity. We attempted to use Model.NumCars to reference this value, but received an error stating: "Unable to get value of the property. Referenced definition type 'Model' does not match executing type 'ModelEntity'.


Is there any way to reference a model state variable within a model entity process, as we are hoping to do?


Thanks,

Joe

Link to comment
Share on other sites

Yes, you can reference a model state within the ModelEntity logic. In order to do this, the ModelEntity object will need to be aware of the model's state variable and to do this, you must create a property on the ModelEntity object definition. The property should be a State Property and this can be found under the list of Standard Properties. Within the ModelEntity's process logic, you would use this new State Property to pull in the latest value of that state. When you place down an instance of the ModelEntity into the Facility window of the Model, you will need to populate that new State Property on the ModelEntity instance with the model state that you want to "send into" the ModelEntity's logic.

Link to comment
Share on other sites

×
×
  • Create New...