transferTo

abstract suspend fun transferTo(conveyorRequest: ConveyorRequestIfc, nextConveyor: Conveyor, entryLocation: String, exitPriority: Int = CONVEYOR_EXIT_PRIORITY, requestPriority: Int = CONVEYOR_REQUEST_PRIORITY, requestResumePriority: Int = RESUME_PRIORITY, suspensionName: String? = null): ConveyorRequestIfc(source)

Causes the entity to transfer from one conveyor to another.

The entity suspends while it gains access to the entry cell of the next conveyor. Access follows that conveyor's rules: requests at an entry are served in turn, and riding items go first unless entering priority is set there. On an accumulating conveyor access may be granted while the item covering the entry cell leaves it on that conveyor's next move; on a non-accumulating conveyor the entry cell must be empty.

The item then leaves its current conveyor, and its move off that conveyor is its move onto the next. It is pushed off as an exiting item is, but it leaves only when it can land: if the entry cell is still covered when its push-off would end, it waits on its current conveyor, holding the exit cell, until the cell is free.

After this function returns, the entity blocks the entry cell of the next conveyor and must then execute a rideConveyor() function to move on the new conveyor (or exitConveyor() to leave without riding). When it rides, the item lands at once on the entry cell and, if it needs more than one cell, on the free cells ahead of it, up to its length: it spends no further moves getting on. A transfer therefore costs the push-off from the current conveyor and any waiting for the entry cell, and a line of conveyors passes items at the rate of its slowest conveyor. A transfer onto a non-accumulating conveyor stops that conveyor while the item is pushed across, as any blockage of a non-accumulating conveyor does.

Pre-conditions for this function:

  • the entity must currently be on a different conveyor than the one to which it is transferring

  • the entity must currently be occupying an exit cell of its current conveyor

  • the exit location of the entity's current conveyor must correspond to the entry location for the next conveyor

Return

the returned item encapsulates what happened during the transfer and contains information about the origin point, and can be used by the entity to control its movement on the new conveyor.

Parameters

conveyorRequest

the entity's current conveyor request. This is required to exit the current conveyor.

nextConveyor

the conveyor to transfer to

entryLocation

the entry location on the conveyor to access

exitPriority

the priority associated with exiting the current conveyor

requestPriority

the priority associated with the conveyor access request

requestResumePriority

the priority for resuming after accessing the conveyor

suspensionName

the name of the suspension point the entity is experiencing if there are more than one delay suspension points within the process. The user is responsible for uniqueness.


open suspend fun transferTo(nextConveyor: Conveyor, entryLocation: String, exitPriority: Int = CONVEYOR_EXIT_PRIORITY, requestPriority: Int = CONVEYOR_REQUEST_PRIORITY, requestResumePriority: Int = RESUME_PRIORITY, suspensionName: String? = null): ConveyorRequestIfc(source)

Causes the entity to transfer from its current conveyor to another.

The entity suspends while it gains access to the entry cell of the next conveyor. Access follows that conveyor's rules: requests at an entry are served in turn, and riding items go first unless entering priority is set there. On an accumulating conveyor access may be granted while the item covering the entry cell leaves it on that conveyor's next move; on a non-accumulating conveyor the entry cell must be empty.

The item then leaves its current conveyor, and its move off that conveyor is its move onto the next. It is pushed off as an exiting item is, but it leaves only when it can land: if the entry cell is still covered when its push-off would end, it waits on its current conveyor, holding the exit cell, until the cell is free.

After this function returns, the entity blocks the entry cell of the next conveyor and must then execute a rideConveyor() function to move on the new conveyor (or exitConveyor() to leave without riding). When it rides, the item lands at once on the entry cell and, if it needs more than one cell, on the free cells ahead of it, up to its length: it spends no further moves getting on. A transfer therefore costs the push-off from the current conveyor and any waiting for the entry cell, and a line of conveyors passes items at the rate of its slowest conveyor. A transfer onto a non-accumulating conveyor stops that conveyor while the item is pushed across, as any blockage of a non-accumulating conveyor does.

Pre-conditions for this function:

  • the entity must currently be on a different conveyor than the one to which it is transferring

  • the entity must currently be occupying an exit cell of its current conveyor

  • the exit location of the entity's current conveyor must correspond to the entry location for the next conveyor

Return

the returned item encapsulates what happened during the transfer and contains information about the origin point, and can be used by the entity to control its movement on the new conveyor.

Parameters

nextConveyor

the conveyor to transfer to

entryLocation

the entry location on the conveyor to access

exitPriority

the priority associated with exiting the current conveyor

requestPriority

the priority associated with the conveyor access request

requestResumePriority

the priority for resuming after accessing the conveyor

suspensionName

the name of the suspension point the entity is experiencing if there are more than one delay suspension points within the process. The user is responsible for uniqueness.