0% found this document useful (0 votes)
4 views23 pages

Lecture 5 - Elements II - January 27th

The document provides an introduction to a General Template by Dr. Estacio Pereira, outlining basic elements such as Set Attribute, Conditional Branch, and Trace. It explains the use of global attributes, statistics, valves, activators, and batching/unbatching entities in modeling. Each element is detailed with examples and specifications for their implementation.

Uploaded by

omkar patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views23 pages

Lecture 5 - Elements II - January 27th

The document provides an introduction to a General Template by Dr. Estacio Pereira, outlining basic elements such as Set Attribute, Conditional Branch, and Trace. It explains the use of global attributes, statistics, valves, activators, and batching/unbatching entities in modeling. Each element is detailed with examples and specifications for their implementation.

Uploaded by

omkar patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Copyright Notice

Please do not copy or distribute without the written consent of the author.

Introduction to the General


Template

Dr Estacio Pereira
January 2024.
Schedule

3
Outline

• Basic elements

• Entities attributes

4
5

Elements
General Template Elements III

SET ATTRIBUTE: Sets the value of one or more of


an entity’s attributes.

CONDITIONAL BRANCH: Routes entities


depending on the result of an If…Then…Else
decision.

TRACE: Writes output to the trace window.

6
The Set Attribute Element

Double-click to open the attribute editor:

Opens the
formula editor

7
The Set Attribute Element
Attribute values can be specified using a formula:

• The formula above sets LS(1) to "Big" if LX(1) is bigger


than 9, and to "Small" otherwise.
8
The Conditional Branch Element
Double-click to open the formula editor:

• The formula above routes an entity through the True branch if


the value of LS(1) = “Big”; otherwise, the entity exits through the
False branch.
9
The Trace Element
Double-click to open the formula editor:

• The formula above writes the value of the LX(1) attribute to the trace
window.
10
Global Attributes
• Every model has a collection of attributes that are shared
among the entities.

• A change made by one entity is visible to the others.

• In an earthmoving model, a global attribute may be used to


store:
• The amount of dirt remaining to move.
• Weather information (e.g., wet/dry conditions).

11
Global Attributes

The three main sets of global attributes are:


• GN(𝑖) — Integer attribute 𝑖.
• GX(𝑖) — Floating point attribute 𝑖.
• GS(𝑖) — Text attribute 𝑖.

12
Cost Element

STATISTIC:
Defines a custom statistic.

STATISTIC COLLECT:
Adds an observation to a statistic when
an entity passes through.

13
The Statistic Element
No. Time Observation
• A Statistic Element is a container for 1 0 1
a sequence of time-stamped 2 0 0
observations. 3 3 1

• How those observations are 4 3 0


5 5 1
interpreted is up to you (the 6 7 2
modeller). 7 8 1
8 10 0
For example:
9 16 1
The observations to the right may be
interpreted as the length of a file (queue). 10 16 0
11 20 0
12 20 0

14
The Statistic Element

15
The Statistic Collect Element

• Adds an observation to a statistic when an entity passes


through.

• You need to specify:


• The statistic to which observations will be collected.
• The value to collect.

• The value will normally be a formula. For example:


' Collect the Cycle Time.
Return LX(0) - TimeNow
17
Valves and Activators

VALVE:
Blocks or unblocks a stream of entities.

ACTIVATOR:
Opens or closes a valve when an entity
passes through.

18
Valves and Activators
• A Valve Element must specify:
• The initial state of the valve (open vs. closed).
• AutoClose: the number of entities to allow through the
valve before it is automatically shut; or, zero if there should
be no restriction on entity flow.

• An Activator Element must specify:


• The valve to be modified.
• The action to take when an entity passes (open +, close –,
or formula ?).

19
Valves and Activators

(Open)
(Closed)

Example
20
Batching and Unbatching Entities

BATCH:
Creates a batch from a sequence of
entities.

UNBATCH:
Restores a sequence of entities from a
batch.

21
Batching and Unbatching Entities

Example

22
Batching and Unbatching Entities
• A Batch Element must specify:
• The quantity of entities per batch.
• The entity whose attributes will be echoed by the batch
entity (first vs. last).

• An Unbatch Element must specify:


• The order in which entities should be unbatched (FIFO vs.
LIFO).

23
Batching and Unbatching Entities
WARNING!

DO NOT DO THIS!
24

You might also like