Jump to content

RandomRow for only part of a table


Recommended Posts

In the attached model, I want to transfer entities to stations depending on some criteria defined in a table.

I have 2 types of entities, "A" and "B", defined in a table as primary keys. Also I have 2 states, "Good" or "Bad", also in a table as primary key. Finally I have 3 stations.

image.png.47360a98b6a8ac10a2bb0c372a7d2460.pngimage.png.27852f8f6be50cdb46c754aef86dcca3.pngimage.png.adfcda551ddbcda9121f214d59522688.png

I have a table that has 3 columns, “Entity_Type”, “Quality_Type” and “Station”. For example a row could be "A"; "Good"; "Station 1".

image.png.944e4f4702b37f84765388484418afae.png

It is possible for entity "A" with "Good" quality to end up in either "Station 1" or "Station 2", and in that case I want to randomly select one. The problem is that I cannot use a RandomRow based in more than one criteria. Either I use RandomRow for the rows of the table that are type "A" or  quality "Good", but I am not finding a way to do more than one combination.

This model is a simplification of the real model which is more complex and has hundreds of combinations.

 

 

 

 

image.png

Model_RandomRow_FilteredTable.spfx

Link to comment
Share on other sites

To start with, Destinations in Simio are always nodes. So the table should have a column of type Object Reference Property > Node.

Although its not on the pull-down list, when you specify a entity destination as Select From List, you can also specify a table column of type node list and it will automatically respect the table rows associated with that entity. 

image.png.5f97fc6c91917592c66ec01f8e6af798.png

Model_RandomRow_FilteredTable.spfx

Link to comment
Share on other sites

Thanks for the response.

I will use nodes instead of stations. But your solution doesn´t cover my problem completely. That list where you are picking nodes randomly is only filtering for types of entity A or B. I want also to take into account other columns, like the quality one.

The problem is when you know that your entity is of type A and good, then is when I would like to select randomly only one of the possible destinations.

Edited by JaimeSotomayor94
Link to comment
Share on other sites

  • 2 years later...
×
×
  • Create New...