
5 Designing Paths for Entities
5-8
Use an Attribute to Select an Output Port
Consider the situation in which parcels are sorted among several delivery vehicles based
on the locations of the specified recipients. If each parcel is an entity, then you can attach
data to each entity to indicate the location of its recipient. To implement the sorting, set
the Switching criterion parameter in the Output Switch block to From attribute.
The example below illustrates the sorting process (but not the delivery process itself),
partitioning the delivery area into three geographic zones. An entity generator represents
sources of parcels addressed to one of the zones. After being marked with a randomly
chosen zone 1, 2, or 3 via the Set Attribute block, the parcels advance to the queue to
wait for sorting. The Single Server block models the small delay incurred in the sorting
process and sends each parcel through the Output Switch block to one of three entity
output ports. From there, the example merely counts the sorted entities destined for each
zone, but your own simulation might do something interesting with the outputs from the
switch.
Comentários a estes Manuais