Main Content

Entity Replicator

Replicate entities

  • Entity Replicator block

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

Ports

Input

expand all

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

expand all

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

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

expand all

Choose if the replicas depart from separate output ports or a single output port.

  • Separate output ports — Outputs one replica entity from each output port

  • Single 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'

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'

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'

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'

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