Entity Replicator
Replicate entities
Libraries:
SimEvents
Description
The Entity Replicator block duplicates entities. It outputs replica entities and can also output the original entity. The block provides an output port for the original entity.
If the original entity departs the block before the replicas, then its replicas are destroyed. Selecting the Hold original entity until all replicas depart check box ensures that the replicas depart the block before the original entity.
An original entity can be extracted from this by block by the Entity Find block. If an original entity waiting in the Entity Replicator block is extracted, all the replicas are destroyed. Only the original entities can be extracted because the replicas can not acquire resources in this block. For more information about finding and extracting entities, see Find and Extract Entities in SimEvents Models.
Examples
Comparing Queuing Strategies
Have you ever been in a supermarket checkout and wondered why you are in the slowest line? This example shows how queuing systems can be modeled in SimEvents for this type of application. Two parallel versions of a simple model of a four register supermarket counter are presented - one that uses four separate queues and one with a single "serpentine" queue that feeds all registers.
Using Entity Priority to Sequence Departures
Use entity priority to sequence entity departures when multiple entities are available to depart. The example models an airport check-in counter where passengers arrive to be checked in. Passengers can have either First-Class, Business Class, or Economy Class reservations, modeled using entity priority values 1, 2 and 3 respectively.
Inventory Management
Build a simple inventory management system for a retail store. This example includes:
Ports
Input
Port_1 — Input entity
scalar | vector | matrix
Input entity port for entities entering the block.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| enumerated
| bus
| string
| fixed point
Output
Port_1 — Output replica entity
scalar | vector | matrix
Output entity port for replica entities exiting the block.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| enumerated
| bus
| string
| fixed point
Port_2 — Output the entity that is replicated
scalar | vector | matrix
Output entity port for original entities exiting the block.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| enumerated
| bus
| string
| fixed point
Parameters
Replicas depart from — Choose how replicas depart
Separate output ports
(default) | Single output port
Choose if the replicas depart from separate output ports or a single output port.
Separate output ports
— Outputs one replica entity from each output portSingle output port
— Outputs all replicas from a single output port
Programmatic Use
Block Parameter:
ReplicasDepartFrom |
Type: character vector |
Values: 'Separate
output ports' | 'Single output
port'
|
Default: 'Separate
output ports' |
Replication amount source — Specify source of replica number
Dialog
(default) | Attribute
Specify the source of replica number.
Select
Dialog
to specify the number of replicas in the dialog box.Select
Attribute
to select an attribute that specifies the number of replicas.
Dependencies
This parameter is visible when you set Replicas depart
from to Single output
port
.
Programmatic Use
Block Parameter:
ReplicationAmountSource |
Type: character vector |
Values:
'Dialog' | 'Attribute'
|
Default:
'Dialog' |
Number of replicas — Specify the number of replicas
1 (default) | scalar
Specify the number of replicas. If you select Single output
port
, all replicas depart from this output port. If you
select Separate output ports
, each replica has
its own port.
Dependencies
This parameter is visible when you set Replicas depart
from to Separate output ports
or Single output port
and
Replication amount source to
Dialog
.
Programmatic Use
Block Parameter:
NumberReplicas |
Type: character vector |
Values: '1'
| scalar |
Default:
'1' |
Replicate attribute name — Specify the attribute that determines the number of replicas
ReplicateAttribute
(default) | character vector
Dependencies
Specify the attribute that determines the number of replicas. This
parameter is visible when you set Replicas depart
from to Single output port
and
Replication amount source to
Attribute
.
Programmatic Use
Block Parameter:
ReplicateAttributeName |
Type: character vector |
Values:
'ReplicateAttribute' | character
vector |
Default:
'ReplicateAttribute' |
Hold original entity until all replicas depart — Choose how replicas depart
off
(default) |
on
Select this check box to hold the original entity until all the replicas have departed. The block first attempts to send all the replicas before it sends out the original entity. Selecting this check box prevents destruction of replica entities when they do not depart the block before the original entity.
Programmatic Use
Block Parameter:
HoldOriginalEntityUntilAllReplicasDepart |
Type: character vector |
Values: 'on'
| 'off' |
Default:
'off' |
Version History
Introduced in R2016a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)