Transporter functions

All transporters operating in a Material Handling Library flowchart provide the following functions:

TransporterFleet getFleet() - Returns the TransporterFleet block this transporter belongs to.

TransporterState getState() - Returns the current state of the transporter. Valid values are: TransporterState.DELIVERING, TransporterState.GOING_AGENT, TransporterState.GOING_HOME, TransporterState.IDLE, TransporterState.PROCESSING.

ILocation getCurrentLocation() - Returns the current location of the transporter. Via ILocation interface you can access information about the space, network and the type of location (e.g. path offset, node, coordinates or attractor) of the transporter. For detailed information on this function, please, refer to the corresponding article of AnyLogic Help.

Speed

double getMaximumSpeed(SpeedUnits units) - Returns maximum speed value of the transporter.
Parameterunits - a constant defining the speed units.

void setMaximumSpeed(double speed, SpeedUnits units) - Sets a new maximum speed value of the transporter.
Parametersspeed - a new maximum speed value;
                   units - a constant defining the speed units.

Acceleration, deceleration

double getAcceleration(AccelerationUnits units) - Returns the acceleration value of the transporter.
Parameterunits - a constant defining the acceleration units.

void setAcceleration(double acceleration, AccelerationUnits units) - Sets the new acceleration value of the transporter.
Parameters: acceleration - a new acceleration value;
          units
- a constant defining the acceleration units.

double getDeceleration(AccelerationUnits units) - Returns the deceleration value of the transporter.
Parameterunits - a constant defining the acceleration units.

void setDeceleration(double deceleration, AccelerationUnits units) - Sets the deceleration value of the transporter.
Parameters: deceleration - a new deceleration value;
                   units - a constant defining the acceleration units.

Material item position

Position getCargoPosition() - Returns the position of the material item in relation to the center point of the transporter (in the specified length units).

void setCargoPosition(double dx, double dy, double dz, LengthUnits units) - Sets the position of the material item in relation to the center of the transporter (in the specified length units).
Parameters: dx - distance to the point on X axis;
                   dy - distance to the point on Y axis;
                   dz - distance to the point on Z axis;
                   units - a constant defining the length units.

void setCargoPosition(double dx, double dy, double dz, LengthUnits units, double rotation, double verticalRotation) - Sets the position of the material item in relation to the center of the transporter including its horizontal and vertical orientation.
Parameters: dx - distance to the point on X axis;
         
dy - distance to the point on Y axis;
          dz
- distance to the point on Z axis;
          units - a constant defining the length units;
                    rotation - horizontal orientation of the material item;
          verticalRotation - vertical orientation of the material item.

void resetCargoPosition() - Resets the position of the material item back to its default value (to the center point of the transporter).

Routing

void recalculateRoute() - Recalculates the current route of the transporter. If you have previously specified a custom route in TransporterControl block, the route will be recalculated taking into account the conditions you have set. You can call this function when the transporter is already in movement and an obstacle appears that will prevent the transporter to reach its destination.

RouteData getRouteData() - Returns the information about the remaining route for the transporter (from its current location to the destination). The information is returned as a list of movement tasks that the transporter will accomplish on its way to the destination. The movement tasks are listed in consecutive order from current location to target. Each task contains the information about the path and the movement type. Valid movement types are: PLAIN - movement from point node to path or within network node; PATH - movement along the network path; PORT - movement between two network ports.