Skip to content

Entity Properties

An entity property is a value carried by the entity that is currently being processed. Unlike an attribute, which you define yourself, these are built in and always available.

PropertyWhat it returns
Entity.AgeTime since the entity was created, in minutes.
Entity.TimeSinceEntryTime since it entered the current activity.
Entity.TotalCostCost accumulated so far. It moves with the parts, as described below.
Entity.VATimeMinutes spent at value-added activities.
Entity.NVATimeMinutes spent at non-value-added activities and in queues.
Entity.RNVATimeMinutes spent at required non-value-added activities.
Entity.TypeNameThe entity’s type, for example "Order".
Entity.NameIts name. After NEWNAME it is the name of the entity type the entity was renamed to.
Entity.IdIts unique number (also available as the bare Id).
Entity.GroupQtyHow many entities the current group holds. An entity traveling on its own is a group of one, so this is never 0.
Entity.HeldResourceCountHow many resource units it currently holds.
Entity.HeldResourceName()The name of a resource it holds (see below).
Entity.CycleStartThe time the entity was created, in minutes. You can set it.
Entity.PriorityThe priority its resource requests carry when they name none. Higher is more urgent. You can set it.
Entity.CapacityHow many children it can carry, 0 for no limit. You can set it.
Entity.LoadedCountHow many children it is carrying now.

Entity.TypeName and Entity.Name are text, so compare them with quotes: IF Entity.TypeName = "Rush" THEN .... The value-added timers (VATime, NVATime, RNVATime) can also be set, to start an entity as though it had already spent time in the model.

Entity.TotalCost moves with the parts. A part loaded by an attach route set to Keep, or by a pickup route, reads 0, because its cost is now in the entity carrying it. When the parts are detached, each one reads an equal share of what the carrier holds. An unbatch leaves the batch container at 0 and shares its cost over the members.

Entity.Priority, Entity.CycleStart and Entity.Capacity can be set, as the value-added timers can, with SET Entity.Priority TO 5 or Entity.Priority = 5.

  • Entity.Priority is the priority the entity’s requests for a resource carry when the request, from a GET or a connection, names none of its own. Higher is more urgent. It is read when the request is made, so setting it does not reorder a wait the entity is already in.
  • Entity.CycleStart is the time the entity was created, in minutes. Setting it moves the starting point of Entity.Age and of the entity’s time in the model, so Clock() - Entity.CycleStart always equals Entity.Age.
  • Entity.Capacity is the entity’s carrying capacity, set here for one entity (see Carrying capacity). It is rounded to a whole number and cannot go below 0.
  • Entity.LoadedCount reads how many children the entity carries after an attach route set to Keep. It cannot be set, and neither can Entity.Id, Entity.Name or Entity.TypeName: setting one gives a warning.

Each example below is a complete piece of action logic, with a // note saying what it does.

How long the entity has been around:

// Minutes since this entity was created
SET a_AgeNow TO Entity.Age
// Minutes since it entered the activity it is in now
IF Entity.TimeSinceEntry > 30 THEN
DISPLAY "Held here over half an hour"
ENDIF

What it has cost, and where that time went:

// Cost the entity has picked up so far
SET v_RunningCost TO Entity.TotalCost
// Split its time three ways for a value-stream summary
SET a_Value TO Entity.VATime
SET a_Waste TO Entity.NVATime
SET a_Needed TO Entity.RNVATime

Which entity this is:

// Branch on the entity type; TypeName is text, so quote the comparison
IF Entity.TypeName = "Rush" THEN
GET 1, Expert
ENDIF
// Its current name, which NEWNAME may have changed along the way
IF Entity.Name = "Expedited" THEN
DISPLAY "An expedited entity reached inspection"
ENDIF
// Its unique number, the reliable way to trace one entity through a run
DISPLAY "Now at inspection: {Entity.Id}"
// Entities in the group, so a check can take longer for a bigger batch; 1 on its own
SET a_BatchSize TO Entity.GroupQty

Two properties read what the entity is currently holding:

// How many resource units it holds at this moment
SET a_Held TO Entity.HeldResourceCount
// The name of the one it captured most recently, handed straight to a FREE
FREE Entity.HeldResourceName()

Entity.HeldResourceName() comes in two forms:

FormWhich resource it names
Entity.HeldResourceName()The one captured most recently.
Entity.HeldResourceName(n)The nth by how long it has been held: (1) is the longest-held, (2) the next, and so on up to Entity.HeldResourceCount.
// Release the resource it has held longest, keeping the rest
FREE Entity.HeldResourceName(1)

Both forms hand back empty text when there is no resource to name: when the entity is holding nothing at all, and when n is past Entity.HeldResourceCount. Read the count first whenever the logic that follows depends on getting a name back:

// Only free a resource when the entity is actually holding one
IF Entity.HeldResourceCount > 0 THEN
FREE Entity.HeldResourceName()
ENDIF

Use Entity.HeldResourceName() whenever your logic needs the name of a resource the entity is holding.

LegacyHow this worked in the previous version

Returns the number of entities in a batched or loaded entity (a loaded entity is an entity with other entities attached to it). If the entity is a loaded entity, it will return only the number of loaded entities, not the base entity. For example, if you attach four Castings to a Pallet, the GroupQty() will return the number of Castings (i.e. 4), which does not include the entity Pallet.

In the case of multiple levels of groups and loads, GroupQty() returns the number of entities in the uppermost level only.

Example

A group of documents called Folder arrives at the Secretary in-box and is processed for some amount of time according to the number of documents in the folder. Each document takes 3.0 minutes to process.

VElNRSAoR1JPVVBRVFkoKSAqMy4wIG1pbik=

[

Functions

](/help/functions/)

Returns the n th resource currently being used by the entity. Each resource is referenced according to the order it was put into use so that the longest held resource is OwnedResource(1). The most recently captured resource can be referenced by omitting the number: OwnedResource().

Example

The **OwnedResource() **function is useful when a decision must be made based on the resource that was captured. For example, suppose an entity captures either Worker_1 or Worker_2 in order to perform an activity. If Worker_1 is used, the activity takes 5 minutes. If Worker_2 is used, the activity takes 6.5 minutes. This can be defined using the following Action logic.

R0VUIFdvcmtlcl8xIE9SIFdvcmtlcl8yCklGIE9XTkVEUkVTT1VSQ0UoKSA9IFdvcmtlcl8xIFRIRU4ge1RJTUUoNS4wIG1pbil9CkVMU0Uge1RJTUUoNi41IG1pbil9CkZSRUUgT1dORURSRVNPVVJDRSgp

  • This function cannot be assigned a resource name in Action logic. For example, an assignment statement like OwnedResource() = Worker_1 will generate an error.

Functions

](/help/functions/)