fsy5393 Posted June 24, 2014 Share Posted June 24, 2014 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 More sharing options...
gocken Posted June 25, 2014 Share Posted June 25, 2014 this is not a solution but a trick, just assign the value of modelentity's state variable to mode state variable whenever it changes, and use model state variable's value... Link to comment Share on other sites More sharing options...
agraunke Posted June 25, 2014 Share Posted June 25, 2014 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 More sharing options...
fsy5393 Posted June 26, 2014 Author Share Posted June 26, 2014 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 More sharing options...
Recommended Posts