AI Chapter4
AI Chapter4
COLLEGE OF ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING
ARTIFICIAL INTELLIGENCE
Chapter 4
Planning
By: Bereket M.
What is AI Planning ?
● Classic planning in AI refers to the process of generating a sequence of
actions to achieve specific goals in an environment with known dynamics and
rules. It is a fundamental problem in artificial intelligence.
● It is used in various applications, including robotics, game playing, logistics,
and automated decision-making systems.
What is AI Planning ?
● In response to the challenges and complexities of planning problems, planning researchers have
adopted a factored representation approach. In this approach, a state of the world is represented by
a collection of variables, each of which captures a specific aspect or dimension of the state.
Variables:
Action(Eat (Cake)
PRECOND : Have(Cake)
Action(Bake(Cake)
PRECOND : ¬ Have(Cake)
EFFECT : Have(Cake))
● To avoid redundant states and actions, planning graphs often employ pruning
techniques such as mutex relations. (red curve lines)
● Mutex relations identify mutually exclusive states or actions that cannot coexist or
be applied together.
Planning with Propositional Logic
● State Representation: In a planning problem, a state represents the current
configuration of the world. We can use propositional logic to represent the
state by defining propositions that capture relevant aspects of the world. For
example, in a navigation problem, we might have propositions like "At(A)",
"At(B)", where A and B represent different locations.
Planning with Propositional Logic
● Action Representation: Actions represent the operations or steps that can
be taken to change the state of the world. Each action has preconditions
(conditions that must be true for the action to be applicable) and effects
(changes it brings about in the state variables). We can represent actions
using propositional logic by defining propositions for the preconditions and
effects of each action.
Planning with Propositional Logic
● Let's consider a simple planning problem where we have two locations, A and
B, and a robot that can move between these locations. Our goal is to move
the robot from location A to location B.
○ Initial State: At(A)
○ Goal State: At(B)
○ Action: Move(robot, from, to)
○ We can represent this problem using propositional logic:
○ Propositions:
■ At(A), At(B): Represent the current location of the robot.
○ Actions:
■ Move(robot, A, B): Preconditions: At(robot, A), Effects: ¬At(robot, A) ∧ At(robot, B)
Time, Schedules and Resources
● The classical planning representation talks about what to do, and in what
order, but the representation cannot talk about time: how long an action takes
and when it occurs.
● For example:
○ the planners of an airline that says which planes are assigned to which flights, but we really
need to know departure and arrival times as well.
● This is the subject matter of scheduling. The real world also imposes many
resource constraints;
● This section covers methods for representing and solving planning problems
that include temporal and resource constraints.
Time, Schedules and Resources
“plan first, schedule later”
● we have a planning phase in which actions are selected, with some ordering
constraints, and a later scheduling phase, in which temporal information is
added to the plan.
○ The notation A ≺ B means that action A must precede action B.
Time, Schedules and Resources
Jobs({AddEngine1 ≺ AddWheels1 ≺ Inspect1 },
{AddEngine2 ≺ AddWheels2 ≺ Inspect2 })
Resources(EngineHoists(1), WheelStations (1), Inspectors (2), LugNuts(500))
Action(AddEngine1 , DURATION :30,
USE :EngineHoists(1 ))
Action(AddEngine2 , DURATION :60,
USE :EngineHoists(1 ))
Action(AddWheels1 , DURATION :30,
CONSUME :LugNuts(20), USE :WheelStations(1))
Action(AddWheels2 , DURATION :15,
CONSUME :LugNuts(20), USE :WheelStations(1))
Action(Inspect i , DURATION :10,
USE :Inspectors (1))
Solving scheduling problems
● Applying Critical path method to determine the possible start and end times of each action.
○ critical path is that path whose total duration is longest; the path is “critical” because it
determines the duration of the entire plan.
● On the example the top job is having a slack of 15 which is LS-ES
○ ES:The Earliest Start Time (ES) of a task is the earliest point in time at which the task
can begin while still satisfying all constraints and dependencies.
○ LS:The Latest Start Time (LS) of a task is the latest point in time at which the task can
begin without delaying the project's completion.
Solving scheduling problems
● Resource allocation is not taken into
consideration.
● The tasked on the top job have a slack of
15.
Solving scheduling problems
● When considering the use of EngineHost in this example. The time allocated
for the use have to be with out no overlap when scheduling.
● This is 30 minutes longer than the 85 minutes required for a schedule without
resource constraints.Notice that there is no time at which both inspectors are
required.
Reading assignment
● Hierarchical Planning
● Conditional Planning