Entity Batch Creator
Create batch of entities
Libraries:
SimEvents
Description
The Entity Batch Creator receives the expected number of entities and creates a batch entity that contains all these entities. The batched entity is an array of entities. Any acquired resources have to be released using a Resource Releaser block before batching an input entity.
To customize actions when entities enter, exit, or are batched or blocked, enter
MATLAB® code in the Entry action
, Exit
action
, Batch generate action
, or Blocked
action
field of the Event actions tab. For more
information about event actions, see Events and Event Actions.
You can write MATLAB code to manipulate the attributes of the batched entity. For example, to
access attributes after an entity batch is generated, select Batch generate
action
and use the code.
entity.batch
4
, then
entity.batch
is a
4
-by-1
structure array. To manipulate
Attribute1
of the third entity in the batch enter the
code.entity.batch(3).Attribute1
You can reference batched entity attributes in event actions. You cannot reference them in:
Priority queues — Do not set Priority source parameter to
PriorityAttribute
.Entity Server block — Do not set Service time source parameter to
Attribute
.Output Switch block — Do not set Switching criterion parameter to
From attribute
.
To output the batch as a bus object, select the Bus object parameter. Consider creating a bus object for the batched entity when:
Sending or receiving a batched entity to or from a MATLAB Discrete-Event System block.
Sending or receiving a batched entity to or from a Discrete-Event Chart block.
When passing full entity data to a Simulink Function block.
When converting a batched entity to a signal using the Message Receive block.
Examples
Ports
Input
Output
Parameters
Version History
Introduced in R2016b