Deadlock Avoidance Module
For 4-way shuttle projects, at the heart of the router is a deadlock avoidance module. This module can also be used separately, through another WCS. This allows the WCS to plan routes whithout taking into account the possibility of deadlocks, which reduces the complexitiy of the WCS. This page explains the functioning of the deadlock avoidance module in general terms, and how to interact with it.
A route consists of a sequence of nodes. A node typically corresponds to a pallet location or a crossing between two corridors, marked by a bar code or otherwise. A node can be occupied by only one shuttle at a time.
After planner a new route, the WCS sends the route to the deadlock avoidance module. The first node corresponds to the current location of the shuttle. The WCS then asks the deadlock avoidance module, before moving the shuttle to the next node in the route, whether this move is at risk of causing a deadlock. The deadlock avoidance module will respond with either no, this will not cause a deadlock, or yes, this may cause a deadlock. The WCS then decides which move to make and informs the deadlock avoidance module.
To illustrate the process, let's look at a chess board with two kings, the white king needs to move from c4 to g1 via row 2, the black king needs to move from e4 to b 1, also via row 2. The WCS sends two routes to the deadlock avoidance module, called white and black. The white route is c4-c3-c2-d2-e2-f2-g2-g1, the black route is e4-e3-e2-d2-c2-b2-b1:

The WCS asks the deadlock avoidance module whether it is okay to move the white king to c3, the deadlock avoidance module answers yes. The WCS moves the white king to c3:

The WCS asks the deadlock avoidance module whether it is okay to move the black king to e3, the deadlock avoidance module answers yes (at this point the fact that two kings cannot be on adjacent fields is ignored, see also below). The WCS moves the black king to e3:

The WCS asks the deadlock avoidance module whether it is okay to move the white king to c2, the deadlock avoidance module answers yes. The WCS moves the white king to c2:

The WCS asks the deadlock avoidance module whether it is okay to move the black king to e2, the deadlock avoidance module answers no, because clearly this would cause a deadlock.
The WCS asks the deadlock avoidance module whether it is okay to move the white king to d2, then to e2, then to f2, the deadlock avoidance module answers yes three times and the WCS moves the king three times. When the WCS asks the deadlock avoidance module whether it is okay to move the black king to e2 before the white king reaches f2 the answer will be no:

The WCS asks the deadlock avoidance module whether it is okay to move the black king to e2, the deadlock avoidance module answers yes. The WCS moves the black king to e2:

And voilá, the kings can continue their journey to their respective target positions without running into a deadlock.
As stated above, a node in a route typically corresponds to a pallet location or a crossing between two corridors, and a node can be occupied by only one shuttle at a time. But it is not said that a shuttle occupies only one node at any one time. Some nodes may be so close to each other that a shuttle will occupy several nodes at once.
A node occupied by a shuttle is said to be claimed by the route. Before moving onto a node the route needs to claim the node. After leaving a node the route releases the node, liberating it for use by other routes. In the example routes above nodes are claimed and released but this is implicit. With explicit claims and releases the black king's route looks like this:
- start of route, claim e4
- claim e3, move to e3, release e4
- claim e2, move to e2, release e3
- claim d2, move to d2, release e2
- claim c2, move to c2, release d2
- claim b2, move to b2, release c2
- claim b1, move to b1, release b2
- end of route, release b1
In fact, claims and releases have to be explicitly included in a route. In the example routes above the fact that kings cannot be on adjacent fields was ignored. A proper king claims the next node in the route in addition to the node it is currently at. For the black king:
- start of route, claim e4, e3
- claim e2, move to e3, release e4
- claim d2, move to e2, release e3
- claim c2, move to d2, release e2
- claim b2, move to c2, release d2
- claim b1, move to b2, release c2
- move to b1, release b2
- end of route, release b1
With proper kings the board initially looks like this, with the white king claiming c4 and c3, and the black king claiming e4 and e3:

The WCS asks the deadlock avoidance module whether it is okay to move the white king to c3, the deadlock avoidance module answers yes. The WCS moves the white king to c3:

The WCS asks the deadlock avoidance module whether it is okay to move the black king to e3, the deadlock avoidance module answers no.
The deadlock avoidance module has a few more features:
- it maintains the order in which routes need to pass a particular node,
- it can direct a shuttle that is travelling along a cross corridor into a storage lane to let another shutlle pass,
- and it can choose between alternatives in a route, for example if there are two or more express lanes between cross corridors, or if a shuttle can access a lift from either side.