Entities and Values

Two general types of information are communicated between blocks: values and entities. Values can be numbers, strings, Boolean values, observation objects, or data model objects. Data model objects can be used to store SAS data sets and JMP tables in a simulation model during a simulation run, and they are also used to store data created within a simulation model run. Observation objects contain a row of information from a data model, SAS data set, or JMP table. Number and string values in Simulation Studio are often associated with state information or properties on blocks, whereas data model and observation object values contain a collection of related data values. Value ports are used to access or set value information associated with blocks.

As an example, the Queue block has a numeric property called capacity that represents the maximum number of entities the queue can hold at one time. Although you can use the properties dialog box of a Queue to set its capacity, you can also connect the InCapacity port (as shown in Figure 4.5) to a numeric output port of another block that sends out a numeric value while the simulation is running. The Queue block also has a numeric value output port called OutLength. Every time the number of entities in the queue changes, the length of the queue is pushed out its OutLength port. It is also possible to query the length of the queue via a connection to the OutLength port.

Figure 4.5: Queue Block


Although most values are simply numbers or strings, as mentioned previously, values can also be Java objects such as an observation object or data model object. Some blocks collect information or statistics and store the data in a custom Java object called a data model object. This data model object can be shared with other blocks. An example of this functionality is the Number Holder block. The Number Holder block provides an option to store data values that pass through the block in a data model object, and the Number Holder block has an output port called OutCollected to provide access to this data model object. For example, you might be interested in displaying the values being collected in the Number Holder block while the simulation is running, so you could connect the DataIn input port (of value type Object) of a Histogram block to the OutCollected port of the Number Holder block. The Histogram block would then display a representation of the data passing through the Number Holder block when the simulation is running.

The second type of information passed between blocks is called an entity. Entities are special objects in Simulation Studio and have a unique role in this discrete-event simulation application. Although value information tends to flow between two blocks and is immediately consumed, entities usually flow through the model and have a much longer life span. Entities can have properties or attributes assigned to them, and these properties might be modified during the simulation execution. Blocks can use property information assigned to entities in their internal processing and logic to affect simulation execution.

Consider the simple M/M/1 example presented in Chapter 2: Overview of SAS Simulation Studio. Suppose this example represents customers waiting to check out at a cashier, and the entities that flow through the model represent customers. You could modify this model to assign a property to the customers (entities) to represent how many items the customer is purchasing and then use this information to determine how long it takes the customer to check out at the cashier.

Additional information about entities and their role in Simulation Studio is given in Chapter 8: Entities.