Entity Store
Store entities
Libraries:
SimEvents
Description
The Entity Store block serves as a container or bin to store unordered entities. The entities are ready to leave the block immediately provided they are accepted by the next block. The Entity Store block attempts to forward an entity immediately upon its arrival. If the attempt fails, the block puts the entity in a pending state. The entity can then leave when the next block can start accepting it.
To customize actions when entities enter, exit, or are blocked, enter MATLAB® code in the Entry action
, Exit
action
, or Blocked action
field of the Event
actions tab.
Examples
Match Entities Based on Attributes
Build a model to store and match entities representing bicycle components. The model uses an Entity Store block for storage and an Entity Selector block to match a set of bicycle wheels to the corresponding size frame for assembly.
Inventory Management
Build a simple inventory management system for a retail store. This example includes:
Job Scheduling and Resource Estimation for a Manufacturing Plant
Model a manufacturing plant. The plant consists of an assembly line that processes jobs based on a pre-determined schedule. This example walks you through a workflow for:
Ports
Input
Port_1 — Input entity
scalar | vector | matrix
Input entity port for entities entering the storage.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| enumerated
| bus
| fixed point
Output
Port_1 — Output entity
scalar | vector | matrix
Output entity port for entities exiting the storage.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| enumerated
| bus
| fixed point
Port_d — Number of entities that have departed the block
scalar
Number of entities that have departed the block.
Dependencies
To enable this port, click the Statistics tab and select the box labeled Number of entities departed, d.
Data Types: double
Port_n — Number of entities that have not yet departed the block
scalar
Number of entities that have not yet departed the block.
Dependencies
To enable this port, click the Statistics tab and select the box labeled Number of entities in block, n.
Data Types: double
Port_w — Average wait time for entities in the block
scalar
Average wait time for entities in the block.
Dependencies
To enable this port, click the Statistics tab and select the box labeled Average wait, w.
Data Types: double
Port_l — Average store size
scalar
Average size of the store.
Dependencies
To enable this port, click the Statistics tab and select the box labeled Average store size, l.
Data Types: double
Port_ex — Number of entities extracted
scalar
Number of entities that are pulled out of this block.
Dependencies
To enable this port, click the Statistics tab and select the box labeled Number of entities extracted, ex.
Data Types: double
Parameters
Capacity — Specify the capacity of the storage
25
(default) | scalar
Specify the maximum number of entities contained in the storage.
Programmatic Use
Block Parameter:
Capacity |
Type: character vector |
Values: '25'
| scalar |
Default:
'25' |
Number of entities departed, d — Outputs the number of entities that have departed the block
off
(default) |
on
Selecting this check box outputs the number of entities that have exited the block.
Programmatic Use
Block Parameter:
NumberEntitiesDeparted |
Type: character vector |
Values: 'on'
| 'off' |
Default:
'off' |
Number of entities in block, n — Outputs the number of entities present in the block, which have yet to depart
off
(default) |
on
Selecting this check box outputs the number of entities present in the block, which have yet to depart.
Programmatic Use
Block Parameter:
NumberEntitiesInBlock |
Type: character vector |
Values: 'on'
| 'off' |
Default:
'off' |
Average wait, w — Outputs the average wait time
off
(default) |
on
Sum of the wait times for entities departing the block divided by their total number. Wait time is the duration between the Entity Store block entry and exit of an entity. For more information, see Interpret SimEvents Models Using Statistical Analysis.
Programmatic Use
Block Parameter:
AverageWait |
Type: character vector |
Values: 'on'
| 'off' |
Default:
'off' |
Average store size, l — Outputs the average store size
off
(default) |
on
Accumulated time-weighted average store size. Store size is the number of entities stored in the block. The block computes average store size by:
Multiplying the store size by its duration to calculate time-weighted store size
Summing up all time-weighted store sizes and averaging them over total time
For more information, see Interpret SimEvents Models Using Statistical Analysis.
Programmatic Use
Block Parameter:
AverageStoreSize |
Type: character vector |
Values: 'on'
| 'off' |
Default:
'off' |
Number of entities extracted, ex — Number of entities extracted from this block
off
(default) | on
Outputs the number of extracted entities which are pulled out from this block by the Entity Find block. When an entity is extracted, Number of entities departed, d, Number of entities in block, n, Average wait, w, and Average store size, l statistics are updated accordingly. For more information about finding and extracting entities, see Find and Extract Entities in SimEvents Models.
Programmatic Use
Block Parameter:
NumEntitiesExtracted |
Type: character vector |
Values: 'on'
| 'off' |
Default:
'off' |
Version History
Introduced in R2018a
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)