Skip to content

Resource Queries

Resource queries read the state of a resource. Name the resource in quotes.

QueryWhat it returns
Resource('X').FreeUnitsUnits currently free.
Resource('X').Available1 if any unit is free, 0 if none.
Resource('X').UtilizationFraction of time in use, from 0 to 1.
Resource('X').OnShift1 if the resource is on shift, 0 if off.
Resource('X').QtyUnits of the resource the current entity holds.
Resource('X').WaitCountEntities waiting for the resource.
Resource('X').DownQtyUnits currently down.

Take a shortcut only when a specialist is free:

IF Resource('Specialist').FreeUnits > 0 THEN GET 1, Specialist ENDIF

Record a resource’s utilization for reporting:

SET v_DoctorUse TO Resource('Doctor').Utilization
LegacyHow this worked in the previous version

Returns the free units of an activity or resource (an integer).

Example

The example below demonstrates the use of the FREEUNITS() function to adjust the processing time for an entity based on the number of units of a resource available to process it. Once a Plane arrives at a passenger gate, it captures a certain number of resources named BH (Baggage Handlers). Operation logic at the gate determines how many BH resources have been captured and, accordingly, how long it will take to service the Plane. The more Baggage Handlers a Plane captures, the less time it takes to service it.

V0hJTEUgRlJFRVVOSVRTKEJIKSA8MwoJewoJRE8gVElNRSgyIG1pbikKCX0KSUYgRlJFRVVOSVRTKEJIKT49NSBUSEVOIHtHRVQgNSBCSH0KRUxTRQoJewoJR0VUIEZSRUVVTklUUyhCSCkgQkgKCVRJTUUoNjAvUkVTUVRZKEJIKSBtaW4pCgl9

Returns the number of units of a specific resource that the current entity owns. You can use RESQTY() to determine the amount of time necessary to process an entity based on the number of units of a resource the entity owns.

Example

The example below demonstrates the use of RESQTY() to adjust the processing time for an entity based on the number of resources available to process it. Once a Plane arrives at a passenger gate, it captures a certain number of resources named BH (Baggage Handlers). Operation logic at the gate determines how many BH resources have been captured and, accordingly, how long it will take to service the Plane. The more Baggage Handlers a Plane captures, the less time it takes to service it.

SUYgRlJFRVVOSVRTKEJIKT49NSBUSEVOIHtHRVQgNSBCSH0KRUxTRQoJewoJR0VUIEZSRUVVTklUUyhCSCkgQkgKCX0KVElNRSg0NS9SRVNRVFkoQkgpIG1pbik=

The percent function allows you to execute one or more statements only a certain percentage of the time. Used in an IF…THEN statement, the function returns a TRUE or FALSE.

To use the percent function, enter PERCENT(n) where n is the percentage of the time that the statement will return a TRUE condition in an IF…THEN statement.

Example

In the first example, logic following the THEN statement is executed 21.5% of the time. In the second, logic following the THEN statement is executed 35% of the time and the logic following the ELSE statement is executed 65% of the time.

MSkgSUYgUEVSQ0VOVCgyMS41KSBUSEVO4oCmCjIpIElGIFBFUkNFTlQoMzUpIFRIRU7igKYKRUxTReKApg==