Help / Vehicle Attributes and Expressions

Vehicle Attributes and Expressions

5 GRS reference entries.

Vehicle Attributes

vehicle.id

Purpose
Dense Vehicle identifier for the current Vehicle actor.
Syntax
vehicle.id
Example
print(vehicle.id);
Notes
Read-only physical identity.
Related
vehicle.station, vehicle.phase

vehicle.station / from / destination

Purpose
Reads the current Station, job source and job destination from the SimulationEngine snapshot.
Syntax
vehicle.station
vehicle.from
vehicle.destination
Example
print(vehicle.station, vehicle.destination);
Notes
Returns null when the corresponding Station is invalid/unset.
Related
vehicle.phase

vehicle.phase / status

Purpose
Returns the current physical phase as a string: idle, retrieving, pickup, moving or setdown.
Syntax
vehicle.phase
vehicle.status
Example
if vehicle.phase = "idle" then begin
    print "idle vehicle ", vehicle.id to log
end
Notes
SimulationEngine remains the physical truth owner.
Related
vehicle.station

Expressions

operators

Purpose
Arithmetic, remainder, comparison and boolean operators.
Syntax
+ - * / %
= <> != < <= > >=
and or not
Example
set r = 7 % 3
if r = 1 and vehicle.id > 0 then begin
    print "remainder ", r to log
end
Notes
% is the remainder (modulo). Division or remainder by zero stops the current event with an error. In conditions = is comparison.
Related
if, while, set

vehicle / self

Purpose
Provides the current Vehicle actor surface and current actor custom-attribute surface.
Syntax
vehicle.id
vehicle.station
vehicle.phase
self.<custom_attribute>
Example
set(self.priority, 3);
print(self.priority);
Notes
Custom modeling state is script-side and does not overwrite physical Vehicle state.
Related
set, configure, Vehicle Attributes