row number

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.
Post Reply
msalemip
Posts: 24
Joined: Fri May 13, 2016 2:30 pm

row number

Post by msalemip » Mon Sep 19, 2016 4:02 pm

Assume an entity is assigned to a table. So there is a row number associated to each entity from the table.
Using a process for the entity, how I can get reference to the row number of that entity in a table. I will create a new entity later and I want to assign the same row number to the new entity. I know I can do the later one with "setRow" step. But I do not know how to find the row number on the fist place.

ptkolodziejczyk
Posts: 27
Joined: Sat Aug 16, 2014 8:31 am
Location: Delft, NL

Re: row number

Post by ptkolodziejczyk » Tue Sep 20, 2016 3:25 am

I am afraid you need to go around and create a state variable within the entity to hold the row number when you set the table row. Then, for a new entity you need just to use it for the SetRow step.
Paweł Kołodziejczyk | Systems Navigator

dsturrock
Simio Team Member
Posts: 1455
Joined: Thu Mar 13, 2008 12:35 pm
Location: Sewickley, PA USA
Contact:

Re: row number

Post by dsturrock » Tue Sep 20, 2016 10:42 am

We are considering adding this feature, but full relational tables add some complexity to it.

One possibility is that when you copy an entity (for example using a Separator), by default it copies its states, including its table references, to the new entity.

Another possible work-around is to add an integer column to the table, perhaps called something like MyRow. When you populate the table, put a monotonically increasing number in each cell (e.g. row 1 gets a 1, row 2 gets a 2, ...).

Then at anytime you can reference MyTable.MyRow to get its current row number.
Dave Sturrock
VP Operations, Simio LLC

msalemip
Posts: 24
Joined: Fri May 13, 2016 2:30 pm

Re: row number

Post by msalemip » Wed Sep 21, 2016 4:07 pm

thanks. I defined a state variable and it worked.

Post Reply