Table of Contents

Table of Contents

FlexScript Class - AGV

AGV

Description

Provides access to data and methods related to AGVs.

Properties

accumAheadAGV Gets the next AGV on an accumulating path.
ampHours Gets the number of amp hours remaining in the AGV's battery.
batteryLevel Gets or sets the ratio of (amp hours remaining)/(total amp hours) as a percentage.
currentCP Gets or sets the current control point for this AGV.
destination Gets the current destination of the AGV.
destinationCP Gets the current desination control point of the AGV.
finalDestinationCP Gets the final destination control point of the AGV.
originCP Gets the origin control point of the AGV.
proximityState Gets the current proximity state of the AGV.
speed Gets the current speed of the AGV.
te Provides access to Object methods and properties for this AGV.

Methods

attachTrailer Attaches the given object as a trailer on the AGV.
detachTrailer Detaches the given trailer from the AGV.
redirect Redirects the AGV to a new destination, based on the given mode.
startRecharge Begins recharging the AGV's battery.

Static Methods

AGV Creates an AGV object based on the given TaskExecuter.

Details

Do no remove, this fixes the anchor on doc.flexsim.com

AGV.accumAheadAGV

readonly AGV accumAheadAGV

Description

Gets the next AGV on an accumulating path.

If there is no AGV ahead of the current one, or if the path type is not accumulating, this property returns a null value.
AGV agv2; 
if (agv1.accumAheadAGV) 
	agv2 = agv1.accumAheadAGV;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.ampHours

readonly double ampHours

Description

Gets the number of amp hours remaining in the AGV's battery.

double ampHoursLeft = agv.ampHours;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.batteryLevel

double batteryLevel

Description

Gets or sets the ratio of (amp hours remaining)/(total amp hours) as a percentage.

double batteryLevel = agv.batterLevel;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.currentCP

treenode currentCP

Description

Gets or sets the current control point for this AGV.

treenode cp = agv.currentCP;
agv.currentCP = Model.find("MyCP");
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.destination

readonly treenode destination

Description

Gets the current destination of the AGV.

If the destination is a FixedResource connected to a ControlPoint, this property will return the FixedResource treenode destination = agv.destination;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.destinationCP

readonly treenode destinationCP

Description

Gets the current desination control point of the AGV.

treenode destinationCP = agv.destinationCP;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.finalDestinationCP

readonly treenode finalDestinationCP

Description

Gets the final destination control point of the AGV.

The final destination control point can be changed when redirect() is called with REDIRECT_AS_FINAL. treenode finalDest = agv.finalDestinationCP;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.originCP

readonly treenode originCP

Description

Gets the origin control point of the AGV.

treenode originCP = agv.originCP;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.proximityState

readonly int proximityState

Description

Gets the current proximity state of the AGV.

A 0 indicates unrestricted. A 1 indicates that the AGV is stopped because of the AGV ahead of it.
if (agv.proximityState) {
// handle a stopped agv
...
}
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.speed

readonly double speed

Description

Gets the current speed of the AGV.

double agvSpeed = agv.speed;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.te

readonly treenode te

Description

Provides access to Object methods and properties for this AGV.

treenode te = agv.te;
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.attachTrailer()

attachTrailer( treenode trailer , double gap , int behind , int detachRule )

Parameters

trailer The object that will trail the AGV
gap The trailer's distance from the next trailer or AGV
behind Sets the position of the trailer. Can be 0 or 1: 0 is ahead, 1 is behind
detachRule Sets the detach mode of the AGV. Can be 0 or 1: 0 is manual, 1 is automatic

Description

Attaches the given object as a trailer on the AGV.

If you attach the trailer using the manual detach mode, you must call detachTrailer() to detach the trailer. agv.attachTrailer(trailerObj, 0.1, 1, 0);
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.detachTrailer()

detachTrailer( treenode trailer )

Parameters

trailer The trailer to detach from the AGV

Description

Detaches the given trailer from the AGV.

agv.detachTrailer(trailerObj);
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.redirect()

redirect( Object newDest , int mode )

Parameters

newDest The new desination for the AGV to travel to
mode Determines what happens on redirect. Can have one of 4 values:

REDIRECT_AND_WAIT - if not redirected before arrival, the agv will wait at the destination until redirected
REDIRECT_AS_FINAL - the destination becomes the new final destination for the agv
REDIRECT_AND_CONTINUE_ON_ARRIVAL - the agv will continue to the final destination after arriving at the intermediate destination
REDIRECT_AND_CONTINUE_ON_PRE_ARRIVAL - the agv will continue to the final destination after pre-arriving at the intermediate destination (it will not decelerate to a stop)

Description

Redirects the AGV to a new destination, based on the given mode.

agv.redirect(newDest, REDIRECT_AS_FINAL);
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.startRecharge()

double startRecharge( )

Returns

double The amount of time a full recharge will take

Description

Begins recharging the AGV's battery.

The battery recharges at the rate defined by the AGV type. Once the battery is fully recharged, recharging stops.
Do no remove, this fixes the anchor on doc.flexsim.com

AGV.AGV()

static AGV AGV( treenode te )

Parameters

te A TaskExecuter that is connected to the AGV network as an AGV Traveler.

Returns

AGV An AGV object

Description

Creates an AGV object based on the given TaskExecuter.

An AGV object can only be accessed by calling this method. Casting from a treenode is not correct.
AGV agv = AGV(te); // correct
AGV agv = te; // incorrect