Planning with Feasbl
AI planning is a field of operations research concerned with how we reason about producing plans that achieve a goal. In simple terms, a plan is a set of actions we take to go from the "current state" of the world, to the desired (goal) state. For a trivial example, lets say we have a truck and package at location A, and we want to the package delivered to location B. A plan might be: put package on truck, move truck from A to B, unload package.
The rest of this section breaks that idea into smaller pieces:
- When to use planning
- PDDL Basics
- PDDL with the Feasbl SDK
- Planning Outputs
- Classical Planning
- Temporal Planning
Why use planning?
Planning is useful when the order of steps matters. If you know where you start and what you want to end up with, planning helps figure out what has to happen in between.
That matters in workflows with prerequisites and branches. A deployment may need checks before rollout. A logistics flow may need loading before transit. A repair process may need access, tools, and diagnostics before the fix can be done.
How do I write a planning problem?
You describe three things: what is true at the start, what should be true at the end, and what actions are allowed along the way.
Each action also says when it can happen and what it changes. The solver uses those rules to work out a valid sequence for the specific situation you gave it.
PDDL
PDDL is the common file format for planning problems. It keeps the reusable part of the model separate from the specific problem you want to solve.
Here is a very small example based on the truck and package problem from the introduction:
(:action load-package
:parameters (?loc)
:precondition
(and
(truck-at ?loc)
(package-at ?loc))
:effect
(and
(package-loaded)
(not (package-at ?loc))))
(:action move-truck
:parameters (?from ?to)
:precondition
(and
(truck-at ?from)
(road ?from ?to))
:effect
(and
(not (truck-at ?from))
(truck-at ?to)))
(:action unload-package
:parameters (?loc)
:precondition
(and
(truck-at ?loc)
(package-loaded))
:effect
(and
(package-at ?loc)
(not (package-loaded))))
In this example, the predicates are the facts the planner can talk about:
truck-atsays where the truck isroadsays which locations can be driven betweenpackage-atandpackage-loadedwould describe where the package is and whether it has been loaded
The load-package action tells the planner that the package can only be loaded
when the truck and package are at the same location. Its effect makes
package-loaded true, which is important because unload-package needs that
fact later.
The move-truck action tells the planner both when a move is allowed and what
changes after it happens. The precondition says the truck must already be at
?from and there must be a road from ?from to ?to. The effect says the
truck is no longer at ?from and is now at ?to.
The unload-package action shows how the earlier steps connect. It can only
run after the truck has moved to the delivery location and the package is still
loaded. In other words, load-package makes the package available for transport,
and move-truck makes unload-package possible at the destination.
The initial state might look like this:
(:init
(truck-at A)
(package-at A)
(road A B))
If the goal is to deliver the package from A to B, the resulting plan could be something like this:
load-packagemove-truck A Bunload-package
That is the basic shape of a planning problem: define the facts, define the actions, give the starting state, and let the planner find an order that gets you to the goal.
Planning with Feasbl
With Feasbl, you provide the planning model, submit the job, and get back a plan. The result is an ordered list of actions that fits the rules you defined.
The Feasbl SDK also makes it easy to construct PDDL problems programmatically when you do not want to write the files by hand.
That lets Feasbl handle the sequencing logic while your application focuses on using the result: running the steps, showing the plan, or checking whether the goal is still reachable.
Next Steps
Continue with the solver overview or the Jia getting started guide.