ResourceType getResourceType() - Returns the type of resource (RESOURCE_STATIC, RESOURCE_MOVING, RESOURCE_PORTABLE).
boolean isBusy() - Tests if the resource unit is currently busy: seized, moving to usage location or home location. Returns true if the unit is busy, otherwise false.
boolean isIdle() - Tests if the resource unit is currently idle and ready to be used. Returns true if the unit is idle, otherwise false.
boolean isReserved() - Returns true if this unit is reserved by some request (note that it may be idle - this means that request isn't completed - or it may be busy with other task, which will be interrupted and preempted when request is completed).
Agent getReservedBy() - Returns the agent which reserved this unit or null (if this unit is not currently reserved, see isReserved()).
Agent getServicedEntity() - Returns the agent which currently possesses this resource unit. Returns null if this unit is either idle or is busy with some not agent-related task (e.g. resource maintenance).
double getUtilization() - Returns the unit utilization: the fraction of time the unit was busy. The returned unit utilization value lies in the range [0..1]. If the availability of the resource unit is defined in the ResourcePool block by a schedule, utilization will be calculated only for the operating hours of the resource unit.
state) - Returns the time the unit
has spent in the given "usage state" so far.
Parameter: state - the state (ResourceUsageState.USAGE_IDLE or ResourceUsageState.USAGE_BUSY)
state, TimeUnits units) - Returns the time the unit
has spent in the given "usage state" so far (in the specified time units).
Parameters: state - the state (ResourceUsageState.USAGE_IDLE or ResourceUsageState.USAGE_BUSY)
units - a constant defining time units
void resetStats() - Resets the unit utilization statistics.
void setAttached( boolean attached ) - Attaches or detaches a
resource unit to/from an agent that possesses it. May be called
only for units that are seized by agents, otherwise an
error will be thrown.
Parameter: attached - pass true value to attach; false - to detach
boolean isAttached() - Tests if the resource unit is attached to the agent. Returns true if the unit is attached, otherwise returns false.
ResourceTaskType currentTaskType() - Returns the type of current task, or null if the unit is idle.
ResourceUnitTask currentTask() - Returns current task of this unit, or null if the unit is idle. Please note that there is a special task when unit's shift ends.
INode getHomeLocation() - Returns a network node that is set as the home location for this resource unit.
void setHomePosition( double x, double y, double z ) - Sets the coordinates of the
resource unit's home position.
Parameters: x - the X-coordinate
y - the Y-coordinate
z - the Z-coordinate
double getHomeX() - Returns the X-coordinate of the resource unit's home position.
double getHomeY() - Returns the Y-coordinate of the resource unit's home position.
double getHomeZ() - Returns the Z-coordinate of the resource unit's home position.
double getHomeRotation() - Returns the rotation angle of the resource unit's home position.