Simio
  • Search a row from a table using an expression

  • General Simio discussions. THIS IS *NOT* A GOOD PLACE FOR SUPPORT QUESTIONS.
    To limit spam this and all Public Forums have very limited ability to attach files. We recommend that support issues and more technical topics be initiated inside one of the Simio Insider (SI) forums below where you can attach your model and see example solutions. See above Welcome forum to join Simio Insiders.
General Simio discussions. THIS IS *NOT* A GOOD PLACE FOR SUPPORT QUESTIONS.
To limit spam this and all Public Forums have very limited ability to attach files. We recommend that support issues and more technical topics be initiated inside one of the Simio Insider (SI) forums below where you can attach your model and see example solutions. See above Welcome forum to join Simio Insiders.
 #8403  by AvinashPatel
 Fri May 12, 2017 4:01 am
Hello,

How to search for a particular row in a table using an expression?

I am using a time path and want to select the time in that path from a table depending upon the type of entity. There is an option to write an expression in the 'Time' field in time path, but I don't now how to search table using an expression.

Thanks
 #8405  by CWatson
 Fri May 12, 2017 11:04 am
There are a couple SimBits that you can review which use the Search step for finding information within a table - SearchTables.spfx and SearchTableUponEnteringObject.spfx. If you still have trouble after looking at those, please provide more information and perhaps attach a model to this discussion or email support@simio.com.
 #8407  by agraunke
 Fri May 12, 2017 12:39 pm
The general idea is that you will need a process (maybe at the beginning node?) that uses the search step, and then stores the resulting expression in a state on the entity (such as MyTravelTime). Then, you can refer to that entity state in the travel time property of the time path.
travel time --> ModelEntity.MyTravelTime

Alternatively, you can refer to the row directly, if (for example), you have an integer state/property that indicates the entity type, and that corresponds to a row in the table:
travel time -> Table1[EntityType].TimeExpression (Here EntityType is a state or property that you've set somewhere else, and corresponds to the index of a row in the table).

Lastly, you can use the "set row" step in a process to link a row to an entity (or use the built-in Table row referencing properties on the source object). Then, you'd just need to reference the table column in the time expression:
travel time -> Table1.TimeExpression

-Adam