Jump to content
Simio Forum

Welcome to the Simio Forum

Welcome to the Simio Forum! Experience the full experience of the forum by becoming a Simio Insider! You must be an Insider to post on any forum!

Click_Here_button.png

New Software Release

Our latest release, Simio 11, is here!

Luu Khanh Minh

How to store the global variable at the initialization stage of simulation into an model-entity level state

Recommended Posts

I would like to refer to the BicycleAssembly Simio Simbit as I'm using it as a reference to set up my own model. As I set the Initialization step of my model, I read the Orders table row by row, using a global variable called CurrentRowNumber. However, when an order entity is created, I would like to keep track of the row in the Orders table that entity is created from with a model-entity level state variable. However, I'm not sure how to do. I cannot just assign the value of this ModelEntity.State = GlobalCurrentRowNumber as the GlobalCurrentRowNumber continuously changes as the simulation runs. 

May I have some suggestion as to how to do so?

Thank you 

Share this post


Link to post
Share on other sites

If the entity is created (similar to the Bicycle Assembly example in Simio) using an arrival table where the arrival time is specified in the table, the entity will automatically be assigned the associated row in that table. To assign a row reference to an entity without such logic, you would have to have the entity enter an add-on process when it is created and then use the SetRow step to assign the entity an associated row in a given table. The GlobalCurrentRowNumber you mention above could be used as the RowNumber assigned for the entity within the SetRow step, provided there were no conflicts with relational tables.

  • Like 1

Share this post


Link to post
Share on other sites
On 11/19/2018 at 9:41 PM, CWatson said:

If the entity is created (similar to the Bicycle Assembly example in Simio) using an arrival table where the arrival time is specified in the table, the entity will automatically be assigned the associated row in that table. To assign a row reference to an entity without such logic, you would have to have the entity enter an add-on process when it is created and then use the SetRow step to assign the entity an associated row in a given table. The GlobalCurrentRowNumber you mention above could be used as the RowNumber assigned for the entity within the SetRow step, provided there were no conflicts with relational tables.

Hi Watsons

Thank you very much for your explanation. Mine is the case where I have to use the process SetRow to assign an entity to an associated row in a given table. However, I'm a bit confused about how to refer to the values of this associated row. For example, I assign an entity to row 1 in TableA, in which there are 3 columns. What I want to do is to get the value of col1,row1 in TableA from the model entity itself: so I'm looking for something like ModelEntity.col1 which gives the value of col1, row1 in tableA. 

Can such a thing be done in Simio?

Thank you

Share this post


Link to post
Share on other sites

If the entity has a SetRow assigning the row to 1 in TableA, then toget to column1 (you already have a pointer to row1 via the SetRow assignment) - you would simply say TableA.ColumnName. Simio will know that it should use row1.

 

Share this post


Link to post
Share on other sites

×
×
  • Create New...