Skip to content

Resources in Logic

These statements seize and release the resources an entity needs. For the resources themselves, see Resources.

StatementWhat it doesExample
GETSeize units of a resource; the entity waits if none are freeGET 1, Nurse
FREERelease units it holdsFREE Nurse · FREE ALL
USESeize a resource and release it automatically after a timeUSE Machine FOR 10 min

Chain requirements with AND to seize more than one resource together, or with OR to take whichever is free first:

GET 1, Doctor AND 1, Room
GET 1, Nurse OR 1, Aide

Add a priority number to jump the queue for a busy resource, for example GET 1, Nurse, 5. The older JOINTLYGET statement is replaced by GET … AND ….

LegacyHow this worked in the previous version

The **Get **statement enables an entity to obtain a resource. In addition to being short and easy to use for capturing a single resource. The Get statement has one primary function - When capturing multiple resources, hold on to any requested resource available while waiting for the remaining to become available. In all other instances of requesting a resource a JointlyGet is preferred.

If you get and free your resources in action logic (rather than with a connector line), the entity must enter the activity before it knows whether a resource is available or not. Therefore, if the resource is not available and the entity must wait “in” the activity for the resource to be available as compared to the GET/FREE route where the entity will wait at the input queue for the resource to be available before entering the activity.

To have the GET/ FREE action logic to behave in the same manner as the GET / FREE routes, add an extra activity that will server as the input queue, before the the activity where you want the resource to work. Remove the input/output queue from the new activity as well as the working activity. Change the capacity of the new activity to the input queu size for the work activity and GET the resource at the new activity.

R0VUIFsgcXVhbnRpdHkgXSByZXNvdXJjZSwgWyBwcmlvcml0eSBdCkdFVCBbIHF1YW50aXR5IF0gcmVzb3VyY2UsIFsgcHJpb3JpdHkgXSBBTkQgWyBxdWFudGl0eSBdIHJlc291cmNlLCBbIHByaW9yaXR5IF0KR0VUIFsgcXVhbnRpdHkgXSByZXNvdXJjZSwgWyBwcmlvcml0eSBdIE9SIFsgcXVhbnRpdHkgXSByZXNvdXJjZSwgWyBwcmlvcml0eV0=

[quantity] You can optionally specify the number of resources to get if the resource has multiple units defined for it. (The square brackets illustrate only that this element is optional.)

  • By default, quantity is equal to one unit of the resource.

**resource **The name of the resource to be captured.

**AND **Used to capture more than one resource as each becomes available.

**OR **Used to capture one resource or the other. Useful for situations where one of several resources could be used to accomplish the same thing.

[priority] You can optionally specify the priority level to get the resource (0-99). The higher the number, the higher priority. A priority above 99 will become an interrupt priority, to learn more see What is a Resource Priority (The square brackets illustrate only that this element is optional.)

Example

The following examples demonstrate the use of the GET statement. The first shows a simple request for a resource called Operator . The second tests the Size attribute to determine whether or not the Operator and Helper are needed. Notice the Helper lists first, and is captured even if the operator remains busy. And the third requests three units of the resource called Operator.

  • GET Operator

  • IF Size > 10 THEN GET Helper AND Operator

  • GET 3 Operator

  • Connected resources capture before resources specified in a GET statement. On the other hand, resource connections that free a resource occur after any Action logic for the activity.

The free statement allows you to free a resource (or resources) used by the current entity.

RlJFRSBbIHF1YW50aXR5IF0gcmVzb3VyY2UKRlJFRSBbIHF1YW50aXR5IF0gcmVzb3VyY2UgLCBbIHF1YW50aXR5IF0gcmVzb3VyY2UgLCDigKYKRlJFRSBBTEw=

[quantity] The number of units of the following resource to free. If no quantity is used, the quantity is assumed to be one. (The square brackets illustrate only that this element is optional.)

**resource **The name of the resource or list of resource names to be freed. If any resource specified is not being used by the current entity, it is simply ignored.

**ALL **The keyword used to free all captured resources currently used by the entity crossing the FREE statement. When one of many resources could be selected, the FREE ALL is especially useful to release whichever selected resource.

Example

In the following example, an entity, which earlier captured the resource Operator, frees the Operator after a three-minute activity time. This action is followed by an increment of the variable called v_TimesUsed.

VElNRSAzIG1pbgpGUkVFIE9wZXJhdG9yCklOQyB2X1RpbWVzVXNlZA==

[

Logic Statements](/help/statements/)

The **JointlyGet **statement enables an entity to obtain a resource. The **JointlyGet **performs the same function as the Get except when capturing multiple resources - no resource is captured until all required are available. The capability of this statement make it the preferred method of capturing single or multiple resources, because it fulfills the need 99% of the time. In addition, waiting to capture any resource until all are available helps to reduce resource waiting time (the resource isn’t working but is held for another resource to become free.)

Sk9JTlRMWUdFVCBbIHF1YW50aXR5IF0gcmVzb3VyY2UsIFsgcHJpb3JpdHkgXQpKT0lOVExZR0VUIFsgcXVhbnRpdHkgXSByZXNvdXJjZSwgWyBwcmlvcml0eSBdIEFORCBbIHF1YW50aXR5IF0gcmVzb3VyY2UsIFsgcHJpb3JpdHkgXQpKT0lOVExZR0VUIFsgcXVhbnRpdHkgXSByZXNvdXJjZSwgWyBwcmlvcml0eSBdIE9SIFsgcXVhbnRpdHkgXSByZXNvdXJjZSwgWyBwcmlvcml0eV0=

[quantity] Optionally specify the number of units of the resource that you want to capture. (The square brackets illustrate only that this element is optional.)

  • By default, quantity is equal to one unit of the resource.

resource The name of the resource you want to capture.

**AND **Used to capture more than one resource once they all become available. To capture multiple resources as each one becomes available, use the GET statement.

**OR **Used to capture one resource or the other. Useful for situations where one of several resources could be used to accomplish the same thing.

[priority] You can optionally specify the priority level to get the resource (0-999). The higher the number, the higher priority. (The square brackets illustrate only that this element is optional.)

Example

The following examples demonstrate the use of the JOINTLYGET statement. The first shows a simple request for a resource called Operator and a resource called Helper. The second tests the a_ Size attribute to determine whether or not the Operator needs two Helper resources. The third example requests the Operator and three units of the resource called Helper. If three helpers are not available, the statement may get two operators and two helpers.

  • JOINTLYGET Operator AND Helper
  • IF a_Size > 10 THEN JOINTLYGET Operator AND 2 Helper
  • JOINTLYGET (Operator AND 3 Helper) OR (2 Operator AND 2 Helper)