The majority of the discrete functions provide information about the internal workings of the Queue, Conveyor and Oven stock types. These Builtins (CAP, COOKTIME, OSTATE, QELEM, QLEN, TRANSTIME) tell you what a particular discrete stock is doing, as the simulation progresses. The DELAY function, on the other hand, simply delays its input signal by a fixed amount of time.
The CAP function returns the capacity associated with a conveyor or an oven, where conveyor is defined as a "Conveyor" stock type, and oven is defined as an "Oven" stock type. Often, you will want to use an Oven's capacity as an input to other model variables. Similarly, you may want to use a Conveyor's capacity as an input to other model variables. The CAP function allows you to accomplish these tasks.
Example:
Capacity = CAP(Mixer) will return the capacity you have specified for the Oven Mixer.
The COOKTIME function samples the cook time associated with an oven, where oven is a discrete "Oven" stock. Often, you will want to know the cook time of a given Oven in your model. The COOKTIME function allows you to do so. It samples and holds the Oven's cook time, while the Oven is cooking. While the oven is filling and emptying, COOKTIME returns a value of 0.
Example:
processing_time= COOKTIME(Processor) will sample the cook time being used for the Oven Processor.
The DELAY function returns a delayed value of input, using a fixed lag time of delay duration and an optional initial value initial for the delay. If you do not specify an initial value initial, DELAY assumes the value to be the initial value of input. If you specify delay duration as a variable, the DELAY function will use the initial value for its fixed lag time.
Example:
Shipments = DELAY(Orders,5) will cause shipments to lag behind orders by 5 time units. For the first 5 time units of the simulation, the delay will return the initial value for orders - since no initial value was specified.
The OSTATE function returns the status of an Oven, where oven is a discrete "Oven" stock. If the Oven is filling, OSTATE returns a "0." If it is "cooking," OSTATE returns a "1." If it is "emptying," OSTATE returns a "2." When the Oven is simultaneously emptying current contents, and filling with new contents, OSTATE will return a "2". See Chapter 4 for further details on Ovens.
Example:
Status = OSTATE(Mixer) will return the status of Mixer, where Mixer is a discrete Oven stock.
-or-
The QELEM function returns the value contained in the specified element, or "slot," of the specified queue or conveyor discrete stock. Elements are numbered sequentially, beginning with the "next" element to flow out of the Queue or Conveyor. See Chapter 4 for further details on Queues and Conveyors.
Example:
Next_to_be_served = QELEM(Service_Queue,1) returns the value of the first element in the discrete stock Service Queue.
-or-
The QLEN function returns the total number of elements or slots contained in the specified queue or conveyor discrete stock. See Chapter 4 for further details on Queues and Conveyors.
Example:
Line_Length = QLEN(Checkout_Queue) will return the length - in terms of the number of orders - in the discrete stock Checkout Queue.
The TRANSTIME function returns the transit time associated with the flow of material that is currently entering a conveyor, where conveyor is a discrete "Conveyor" stock type. The TRANSTIME function thus tells you how much time will be spent in the Conveyor, by stuff that is currently entering the Conveyor. When the inflow goes to zero, the TRANSTIME function will hold the value of transit time from the most recent inflow.
Example:
Transit_time = TRANSTIME(Work_in_Process) will return the transit time associated with material that is currently entering the Conveyor Work in Process.