Inherits from Object
A class that provides properties and methods for monitoring and controlling a conveyor.
|acceleration||Gets the conveyor's acceleration.|
|currentSpeed||Gets the conveyor's current speed.|
|deceleration||Gets the conveyor's deceleration.|
|defaultSpeed||Gets the conveyor's default speed, which is the speed the conveyor starts with at the beginning of the simulation.|
|itemData||Accesses conveyor-specific data associated with items on the conveyor|
|length||Gets the conveyor's simulated length.|
|motor||Gets the conveyor's assigned motor.|
|slugBuilder||Gets data associated with the conveyor's slug-building status.|
|targetSpeed||Gets or sets the conveyor's current target speed.|
|width||Gets the conveyor's width.|
|estimateConveyTime||Estimates the time for an item to travel from one part of the conveyor system to another.|
|sendItem||Sets an item's target destination in the conveyor system.|
Accesses conveyor-specific data associated with items on the conveyor
This gives access to the set of Conveyor.Items associated with the items currently on the conveyor.
Use itemData.length to get the number of items on the conveyor.
Conveyor conveyor = param(1); int numItems = conveyor.itemData.length;
Note that itemData.length may be different than conveyor.subnodes.length, as some items may be partially on the conveyor, but not in the conveyor's subtree. conveyover.itemData.length should always be greater than or equal to conveyor.subnodes.length.
conveyor.subnodes.length; // the number of items in the conveyor's subtree conveyor.itemData.length; // the total number of all items partially-or-wholly on the conveyor.
To access item data by rank, you can index into conveyor.itemData with the [ ] operator.
conveyor.itemData; // gets the data associated with the most downstream item on the conveyor conveyor.itemData[conveyor.itemData.length]; // gets the data associated with the most upstream item on the conveyor
You can also access the itemData associated with a specific item, again using the [ ] operator.
Object item = param(2); Conveyor.Item conveyorItem = conveyor.itemData[item];
See Conveyor.Item for more information.
Gets or sets the conveyor's current target speed.
If you set this value, the conveyor's speed will change to the target speed. The conveyor's acceleration/deceleration will determine how long it takes to get to the target speed.
If you set a conveyor's targetSpeed to a non-zero negative value, the conveyor will reverse direction. When a conveyor's direction is reversed the following things happen.
The functionality for reversing conveyor direction is still in an early stage of maturity. It was designed with a very specific scenario in mind, which is to give modelers the ability to simulate accumulation buffers, where items can be pulled off a main conveyor line when the line gets backed up, and then moved back onto the line when it clears out. The functionality has been tested only for this scenario. Using reversible conveyors for other scenarios has not been tested and thus may not work perfectly.
Specific caveats that you should be aware of:
|static double estimateConveyTime( Object origin , double n_a , Object dest , double n_a , double itemLength , int flags = 0 )|
|origin||The origin point from which to estimate the convey time. This must be either a conveyor or a point on a conveyor, such as a decision point or photo eye.|
|dest||The destination point for the time estimation. This must be either a conveyor or a point on a conveyor, such as a decision point or photo eye.|
|n_a||Reserved for future use. Must be 0.|
|itemLength||Defines an item length for the estimation algorithm. This can affect the result depending on how speeds are defined in conveyor transfers.|
|flags||This can either be 0, or CONV_ESTIMATE_STANDARD_SPEEDS. If 0 (default), the estimation algorithm will assume slug-build conveyors will convey at their slug release speed. If CONV_ESTIMATE_STANDARD_SPEEDS is defined, the estimation algorithm will use normal conveying speeds.|
|double||The estimated simulation time it will take for an item of the given size to convey from the point where the item's center is at the origin point, to the point where the item's center is at the destination point, assuming no blockage.|
Estimates the time for an item to travel from one part of the conveyor system to another.
DecisionPoint src = current; DecisionPoint dest = current.outObjects; Object item = param(1); double conveyTime = Conveyor.estimateConveyTime(src, 0, dest, 0, item.size.x);
In making the estimation, the algorithm will always assume default conveyor speeds (not current conveyor speeds). Estimation speeds for slug-building conveyors are determined by the flags parameter.
|static void sendItem( Object item , Object dest )|
|item||The item whose target destination is to be set.|
|dest||The target destination. This must be a reference to a point within the conveyor system that is reachable from the item's current position on the conveyor system. This must either be a decision point, a photo eye, a station, or an exit transfer.|
Sets an item's target destination in the conveyor system.
Once an item's target destination is set, the item will take the shortest distance route, in the conveyor system, to that defined destination.