You are on page 1of 2

Problem:

I would like to model a system where parts of different types arrive in a certain order.
Categories:
Arrival Logic, Data Tables
Key Concepts:
AvailableRowCount, Before Creating Entities, Before Exiting, Condition, Data Table, Dynamic Object Property,
Entity Type, Math.If, Real State Variable, Source, State Assignments, Table Reference Assignments
Assumption:
This is a simply Source, Server, Sink model that simply demonstrates controlling the order of arriving entities.
Technical Approach:
The Source reads information from a Data Table to determine which entity type to create for each arrival.
Details:
Simple System Setup
Place a Source, a Server and a Sink into the Facility window and connect them with Paths.
Place 4 ModelEntity objects into the Facility window and name them PartA, PartB, PartC and PartD.
o Ensure that the color of each entity is different to help with model verification. To change the
color of an entity, select the entity and then select a color from the Color drop down in the
Symbols ribbon and click back onto the entity. It should then change colors.
Create Data Table
The Data Table will contain the order in which the different entities should arrive.
Go to the Data window and click the Add Data Table icon in the ribbon to add a new table.
Add a column that is an Entity property by selecting Entity from the Object Reference drop down in the
ribbon. The column can be renamed to Parts.
Fill the table with any orders youd like in this example, they arrive in the order A A A A B B B C C D and
this pattern repeats.

Add Table Referencing To Source object


Go to the Definitions window and create a new State variable. From within the Definitions window, click
on the States panel along the left side of the interface and then click on Real in the ribbon to create a new
Discrete State. Name it RowNumber. Change the Initial State Value to 1.
From within the Facility window, click on the Source and expand the Table Reference Assignments
category. Next, expand the Before Creating Entities category and set the Table Name to Table1 and the
Row Number to RowNumber (the new State). This is telling the Source object to set a reference to the
Data Table before an entity is created.
Set the EntityType property of the Source to be Table1.Parts, where Table1 is the name of the Data Table
and Parts is the name of the column within the table. This will tell the Source to look in this table to
determine which type of entity to create.
Expand the State Assignments property category and open the Repeating Property editor of the Before
Exiting property (by clicking on the ellipse in the text box). Click Add to create a new Assignment and set
State Variable Name to RowNumber and New Value to Math.If( RowNumber ==
Table1.AvailableRowCount, 1, (RowNumber + 1) ) This checks to see if the current value of RowNumber
is equal to the total number of rows in the table (i.e. are we at the last row?). If True, it sets the value of
RowNumber back to 1 so it reads at the beginning of the table again. If False, RowNumber is incremented
by 1.
Embellishments:
Change the pattern of arrivals or try adding additional information into the Data Table and using it in the model.

You might also like