Assignment - Discrete Event Simulation
Assignment - Discrete Event Simulation
1. Make the above model: create a source, three servers and a sink. Connect them as shown
in the figure using a connector.
2. What is the difference between a connector, a path, and a timepath?
3. Start the simulation.
EL MOUAYNI ISMAIL 1
4. Place a "ModelEntity" entity in the “Facility window”, modify the value of the "Initial
Sequence" parameter under the "Rooting Logic" part by putting the name of the sequence table
created in question 3.
5. Change the output node of all elements by setting the "Entity Destination" parameter under the
"Rooting Logic" part to the "By Sequence" value.
6. Start simulation. Comment the result.
EL MOUAYNI ISMAIL 2
5. For each server, modify the distribution of service times by setting a triangular distribution of
parameters 0.5, 0.8, 1.2 (Random.Triangular (0.5, 0.8, 1.2)).
6. For each output node, set the Entity Destination Type under Rooting logic to "bySequence".
7. Start the simulation.
EL MOUAYNI ISMAIL 3
2. In the Data tab, select each sequence table; use the "Standard Property" drop-down menu to
create an "Expression" type property. Name it Process Time.
3. For each sequence table, complete the column as follows:
➢ SequenceA: Input@Server1 = Random.Uniform(0.5, 0.9), Input@Server2 =
Random.Triangular(0.5, 1.1, 1.2), Input@Server3 = Random.Triangular(0.5, 1.1, 1.2),
Input@Sink1 = 0.0
➢ SequenceB: Input@Server3 = Random.Triangular(0.5, 0.8, 1.2), Input@Server2 = 1.5,
Input@Server1 = 1, Input@Sink1 = 0.0
➢ SequenceC: Input@Server2 = Random.Triangular(0.5, 1.2, 1.6), Input@Sink1 = 0.0
4. In the "Data" tab, add data table, name it "JobTable", add the following properties:
➢ (Entity Object Reference) PartType, set PartA, PartB, PartC as values ;
➢ (Expression) ProcessTime, set SequenceA.ProcessTime, SequenceB.ProcessTime,
SequenceC.ProcessTime as values;
➢ (Integer) ProductMix, set 10, 20, 30 as values;
➢ (Sequence Table) PartSequence, set SequenceA, SequenceB, SequenceC as values.
5. In "Facility Window", expand "Table Reference Assignments" under the source properties
window (Source1). Under "Before Creating Entities", set "Table name" to "JobTable" and the
Row Number property to "JobTable.ProductMixt.RandomRow". Under the On Created Entity
part, set the Table Name property to "JobTable.PartSequence" and leave Row Number blank.
6. Under the source, change the "Arrival, Logic Entity Type" to "JobTable.PartType".
7. For all servers, set the Process Time property under Processing Logic to JobTable.ProcessTime.
8. Verify that for all transfer nodes, the Entity Destination Type property is set to "By Sequence".
9. Start the simulation.
EL MOUAYNI ISMAIL 4
3. Add a new sequence table called "Sequeneces" consisting of a Sequence, named Sequence, and
expression “ProcessTime” for the operating times. Use the "Foreign Key" button to add a foreign
key, called "SequenceType". On the Logic tab, under column properties, assign
JobeTable.SequenceType to the Table Key attribute. Fill the table as shown in the figure below:
4. For the different servers, under ProcessingTime, assign the Sequence.ProcessTime expressions
instead of JobTable.ProcessTime. Verify that for model entities, Initial Sequence is empty. Start
simulation.
Part Quantity
0 4
1 5
0 2
1 20
0 35
1 40
1. Conceptual model: create a model composed of a source, a server, and a sink (Sink) connected
respectively by a connector and a path. Add a "ModelEntity" from the standard library. Name it
"AnyEntity". Click on AnyEntity, and use the "Add Additional Symbol" button, click the "color"
icon to change the entity's color for the index 0. Keep the original index color 0.
2. Data table: In the "Data" tab in the tables’ panel, select "Add Data Table" to add a data table
named "DataTable1". Add two integer properties: PartType, and Quantity. Complete the table
according to the data presented at the beginning.
3. Click the "Definitions" tab and select the States panel. Add a discrete state variable, name it
"Index" to specify the row index of the table that is currently under processing. Similarly, define
a second discrete variable named "Count" to specify the produced quantity.
4. Define the process shown in the figure below: In the process tab, create a new process named
Process1, Place a step "Decide" followed by "Assign" in the "True" side of output. On the
“False” side, place another "Assign", followed by "Decide" and "Assign".
EL MOUAYNI ISMAIL 5
5. Change the name of the first Decide to DecideIsCurrentRowDone, which will compare the
quantity produced to the desired quantity in the DataTable1 table. Set the Decide Type to
Conditional Based, and in the expression (Expression property) the formula Count <DataTable1
[Index] .Quantity.
6. Change the name of the "Assign" step from the output "True" to "AssignPictureAndCount". On
the Properties tab, assign the attribute "State Variable Name" to "ModelEntityPicture" which is
a predefined variable and contains the index of the image to be displayed for the model entity.
In the "New Value" attribute, set the expression DataTable [Index] .PartType. In the
"Assignments (More) attribute, put the expression Count = Count +1. Explain the role of this
Assign.
7. Rename the Assign step on the False output side of the first Decide to AssignRowAndCount. In
the Properties tab, assign the "Count" variable to the "State Variable Name" attribute, set the
value 0.0 to "New Value" and the expression Index = Index +1 to "Assignments (More). Explain
the role of this step.
8. Rename the second Decide to DecideIfEndOfTable. Assign ConditionalBased to the "Decide
Type" attribute and Index> = DataTable1.AvailableRowCount to the Expression attribute.
Explain the role of this step.
9. Rename the last Assign to AssignRestart. Set Index to "State Variable Name" and value 1 to
New Value. Explain the role of this step.
10. Go to the "Facility" tab, on the Properties tab, under Add-On Process Triggers, assign Process1
to the "Entered" attribute. Start simulation.
EL MOUAYNI ISMAIL 6
3. On the Data tab, click the Lookup Table panel, create a new table, name itTProcessingTimes. Put
values 1, 2, 3 in the X column and 3, 5, 6 in the Y column. Explain the role of this data structure.
4. In the ProcessingTime attribute of the fourth server, put the expression TProcessingTimes
[ModelEntity.Priotity]. Start simulation.
EL MOUAYNI ISMAIL 7