Professional Documents
Culture Documents
Lab No. 10: Search, Pickup and Dropoff Module
Lab No. 10: Search, Pickup and Dropoff Module
Lab No. 10: Search, Pickup and Dropoff Module
____________________________________________________________________________
LAB NO. 10
Search module:
Description:
The Search module searches a queue, a group (batch) or an expression to find the entity
rank (for entities in a queue or group) or the value of the global variable J that satisfies
the specified search condition. When searching a queue or group, the value of the global
system variable J is set to the rank of the first entity that satisfies Search Condition, or to
0 if Search Condition is not satisfied. When searching an expression, the global system
variable J is set to the value of the first index value that satisfies the search condition or
to zero if no value of J in the specified range satisfies search condition.
When an entity arrives at a Search module, the index J is set to the starting index and the
search condition is then checked. If the search condition is satisfied, the search ends and
the current value of J is retained. Otherwise, the value of J is increased or decreased and
the condition is rechecked. This process repeats until search condition is satisfied or the
ending value is reached. If the condition is not met or there are no entities in the queue
or group, J is set equal to 0.
TYPICALUSES:
PROMPT:
Prompt Description:
Queue Name—Name of the queue that will be searched. Applies only when the Type is
Search a Queue
82
Simulation and Modeling (CE-409) SSUET/QR/114
____________________________________________________________________________
Ending Value—Ending rank in the queue or group or ending value for J in an expression
Prompt Entry
Name Find Lightest Package
Type Search a Queue
Queue Name Package. Queue
Starting Value 1
Ending Value NQ
Search Condition MIN(Weight)
In this example, the Find Lightest Package module will search a queue. A search is
made of all entities in queue Package. Queue to find the entity that contains the
minimum value of attribute Weight
Pickup module:
Description:
The Pickup module removes a number of consecutive entities from a given queue starting
at a specified rank in the queue. The entities that are picked up are added to the end of
the incoming entity’s group. Entities that are picked up are added to the temporary group
of the incoming entity. Once an entity is added to the temporary group, it will have its time
and cost data updated automatically as it moves through an processing steps in the
simulation.
TYPICAL USES:
PROMPT:
Prompt Description:
83
Simulation and Modeling (CE-409) SSUET/QR/114
____________________________________________________________________________
Queue Name—Name of the queue from which the entities will be picked up, starting at
the specified rank.
Starting Rank—starting rank of the entities to pick up from the queue, Queue Name
Prompt Entry
Name Pickup Forms
Quantity 1
Queue Name Forms.Queue
Starting Rank 1
The entity entering this Pickup Forms module will pick up the first entity in queue
Forms.Queue and add the entity to the end of the group.
Prompt Entry
Name Get Red Ones
Quantity 1
Queue Name All
Colors.Queue
Starting Rank J
This module takes one entity from the All Colors.Queue and adds it to the group. The
rank of the entity that is selected is based on the value of the global system variable, J.
Typically, the value of J is set by using a Search module. The Search module will first
search the queue for a given set of conditions, such as for a specific value of an
attribute of an entity in the queue.
Dropoff module:
Description:
The Dropoff module removes a specified number of entities from the entity’s group
and sends them to another module, as specified by a graphical connection. Group user-
defined attribute value and internal attributes may be given to the dropped-off entities
based on a specified rule. There are two exit points from this module. Original incoming
entities will exit from the exit point at the middle right of the module. The entities that are
dropped off (members) from this module will exit from the bottom right of the module
84
Simulation and Modeling (CE-409) SSUET/QR/114
____________________________________________________________________________
TYPICAL USES:
Loading shelves with product
Separating a form for use in various departments
PROMPTS:
Prompt Description:
Starting Rank: Starting rank of the entities to be dropped off, based on the entities in
the
group.
NG Variable:
The variable NG evaluates the group size for the current entity. This value can be used
to drop off all entities in a group and have the representative entity continue elsewhere.
Other variables are available to find the entity number and attribute values of grouped
entities.
Example 1—One Entity/Retain Original Entity Values
Prompt Entry
Name To Accounting
Quantity 1
Starting Rank 1
Member Retain Original Entity
Attributes Values
In this example, the representative entity will drop off the first entity in the group to a
specified location. The entity will retain its original entity values, such as Entity.Type,
Entity.CreateTime and user-defined attributes. Cost attributes were updated as the entity
85
Simulation and Modeling (CE-409) SSUET/QR/114
____________________________________________________________________________
went through any processes while being a group member (see remarks below). Time
attributes will reflect any new times that the entity has incurred as a part of the group.
In this example, the representative entity will drop off all but one of the entities in the group
(NG is the number in the group), starting at rank 2 the second entity that entered the
group. The member entities that are dropped off will take on the "color" attribute of the
representative entity, but they will retain all of their other original entity values. As with
example 1, cost attributes were updated as the entity went through any processes while
being a group and time attributes will reflect any new times that the entities incurred as
parts of the group.
LAB TASK
Design a model of public bus transportation simulates a bus that moves between different
points, picking up and dropping off passengers.
86