Jump to content

Referring to a specific row in a table


fsy5393
 Share

Recommended Posts

I would like to refer to a specific row in a date table for a specific property. I found the syntax for this as TableName[RowNumber].PropertyName. However, I want to use a model entity state variable that returns an integer for the row number. The model gives an error saying "invalid syntax". A model state variable works fine, but I can't use a modelentity variable. (TableName[ModelEntity.StateName].PropertyName). Are there any suggestions to solve this issue? Thank you.

Link to comment
Share on other sites

I think the issue is that the value of ModelEntity.StateName is set at the population member level. So, your expression needs to be evaluated in the context of a specific entity or using a reference to a specific population member. Your approach works with the model level state variable because there is no ambiguity in the reference. In fact, I think gocken’s suggestion will result in the same error for this reason.


When are you trying to evaluate the expression TableName[ModelEntity.StateName].PropertyName? Which entity population member do you want to refer to?


Is the ModelEntity state variable intended to be the same value across the population? If so, Simio does not offer that functionality exactly… you can set a Property value on the entity instance, and state values on the population members, but no state values on the population as a whole (unless this has been updated):

http://www.simio.com/forums/viewtopic.php?f=18&t=1030


-Adam

Link to comment
Share on other sites

Thank you for your help, I was trying to evaluate that expression involving the modelentity state variable on the right frame dialog box that shows up when we click on a node. I first chose "select from list" for the entity destination, then entered that expression for the list name.

I solved the issue using a different approach; when the entity enters the node, I use a "SetRow" process step, and enter ModelEntity.StateVariableName for the row number.

Then on the facility window, when I specify the name of the list, I just use the expression TableName.PropertyName, without specifying the row number, since it's already set.

Link to comment
Share on other sites

×
×
  • Create New...