Skip to main content
This is a real case that we tackled for a manufacturing company. This company devises supply chains to make pieces of medical equipments. A supply chain consists of independent robotized units/cells, which realize specific operations on the pieces: cleaning, checking, marking, assembling etc. The pieces are put on trays, and mobile robots are programmed to take and to transport the trays between the different units. The image below illustrates this process: Robotics Use Case There are different symbolType of pieces at the beginning of the supply chain. A tray contains only one symbolType of pieces, and, each piece undergoes a sequence of operations from the beginning to the end of the supply chain. At the beginning of the supply chain, a unit is used to store all the trays. The units can have several inputs named “conveyors”. The conveyors and the units are specific to a set of pieces: pieces are admissible to identified conveyors and units. Initially, every processing (unit loading/unloading, robot movements etc.) was hard-coded in a database by human operators. Automated planning is now used to optimize unit/robot scheduling and to increase production efficiency.

Defining the Domain

Requirements

Let start by creating the domain file. For instance, rsc-domain.pddl write the following PDDL to give a name to this domain and specify the requirements of the domain.
rsc-domain.pddl

Types

Then, define the set of objects (types) that will be used in this domain. Quite obviously, we will have the types robot (mobile robots), conveyor, unit, piece, etc.
rsc-domain.pddl

Constants

We also declare a dummy operation called stop as a constant of the domain which will be used in one action:
rsc-domain.pddl

Predicates

Now it is time to think to a model for the domain. It is based on the following ideas: * Producer/consumer: the trays are resources consumed by the conveyors and produced by the units. A “one-to-many” relation is created between each unit and the conveyors. A tuple conveyors/unit is like a (Petri Net) “machine” that consumes and produces trays. The conveyors are the inputs and the unit is the output. Each input/output’s capacity is one, * Operation stacks: each tray is associated to a stack of operations that have to be performed on the pieces of the tray. The last operation of the stack is always _stop. Each time a machine consumes a tray, the associated stack is pulled, * Goal: to empty all the stacks by connecting the machines with robots transporting trays from units (outputs) to conveyors (inputs). The capacity of the robots is one. Here is the vocabulary (“predicates”) that will be used by the actions:
rsc-domain.pddl
For instance, in the problem file, you can now specify an initial state beginning by:
This means that the sequence op10, op20, op30 of operations is scheduled on tray32. Likewise,
means that unit1 has two inputs conv1 and conv2.

Operators

The new step is to define all the actions. For this domain, we will need 6 actions:
rsc-domain.pddl
Action pickup_tray_on_unit allows a robot to pickup a tray on a unit provided the robot is available and located at this unit. The effects are that the tray is no more on the unit, the tray is on the robot and the robot is not available to pickup another tray. The unit becomes available to process another tray.
rsc-domain.pddl
Action drop_tray_on_conveyor is the counterpart of pickup_tray_on_unit. It allows a robot to put a tray on a conveyor. The preconditions are that the robot and the conveyor are in the same place, the conveyor is available and it accepts the same type of pieces than the tray. The effects are that the conveyor is no more available, the tray is no more on the robot (it is on the conveyor) and the robot is now available.
rsc-domain.pddl
Action robot_move is trivial: it moves a robot from location ?from$ to location $?to. Locations are either a conveyor or a unit (see :types keyword).
rsc-domain.pddl
Action conveyor_load_tray_in_unit consumes a tray that is loaded on a conveyor linked to a unit provided the pieces of the tray are accepted by this unit. As a consequence, the tray is no more one the conveyor, the unit is not available and the tray is on the unit, ready for processing.
rsc-domain.pddl
Action unit_execute_operation applies the operation pending on top of the tray’s stack. The preconditions are that the unit is able to perform this operation, the tray is in the unit and this operation operation is on top of the stack. The effects are that the operation is pulled from the stack and the next operation becomes the top of the stack.
rsc-domain.pddl
Action tray_completed is a dummy action which purpose is to check that all the scheduled operations on a tray have been done (stop operation on top of the tray’s stack). It is used to build a goal state and to terminate the planning procedure for a given tray. Here we suppose that an operator picks up the tray once all the operations have been done and the unit becomes available to process another tray.

Defining the problem

Let start by creating the problem file, e.g., rsc_problem_easy.pddl. The problem we wish to define is a simple problem with one type of pieces, a single tray, robot and conveyor; two units, a stocker storing this tray at the initial state and a processing unit. The goal is for the unit to perform three operations (op10 > op20 > op30) on the tray.

Objects

Hence, the types and objects are as follows:
rsc_problem_easy.pddl

Initial State

This snippet of code is the initial state:
rsc_problem_easy.pddl

Goal Description

The goal is simply the completion of tray1:
rsc_problem_easy.pddl