Help / Vehicle Attributes and Expressions
Vehicle Attributes and Expressions
5 GRS reference entries.
Vehicle Attributes
- 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
- 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
- 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
- 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
- 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