Planning

#DigitalGarden

What is planning?

Important

Planning regards the process of computing multiple steps in a process before executing the task such that it's planned out. These steps in a plan take into regard a sequence of actions to achieve a given goal

Some of the main issues in carrying out a "standard search" to solve an issue is that its very time consuming and tends to propose a lot of problem/issues before reaching the goal. Besides that, finding a good heuristic function can be difficult.

Take the following illustration as an example:
Pasted image 20250315163002.png

You can derive the following for the image:

The main difference between planning and problem solving is that a planning agent is capable of representing goals, states and actions while using explicit logical representations. Hence, this makes planning more powerful given its ability to utilize representation and methods.

Pasted image 20250315163505.png

Now when it comes to defining your planning system your going to need a:

There are two approaches to take if you want to plan a algorithm:

STRIPS

Definition

The Standford Research Institute Problem Solver is an automated planning technique that uses a classical approach which enables users to create a plan to move an agent from one state to another in an algorithm. STRIPS defines problems as a state space search where an agent transitions between different states using a set of predefined actions.

In other words, STRIPS is a planning language used in the development of an AI, it treats the problem as a "state space search" as to where the agent present in the task environment transitions from one state to another through the use of pre-defined actions. There are three main states in a STRIPS approach to creating a plan for an AI:

Now each action in a plan has three main parts:

STRIPS is a restrictive way to express states, actions and goals, but leads to more efficiency.

Refer to the following image to see an example of how STRIPS can be implemented:

Pasted image 20250315184851.png

STRIPS Action Schema

Important

An action schema is simply a blueprint that defines the parameters and effects of an action. It includes the preconditions, effects and name of the action

Here's an example of an action schema:

The schema here specifies that in order to sell P at location X, the agent must be at X and have P (conjunction of two sub actions), thereafter the after effect of selling P at X leads to P being sold and the agent having Money (another conjunction)

An example of an implementation of STRIPS may be seen in the following image:

Pasted image 20250316100759.png

Here you can see the following is specified:

The goal here is to place block A on block B using the moves Move(X,Y). However, in order to use this move there should be a precondition where when moving onto the next block it must be empty and the table that the block moved out of has an after effect of being empty.

The goal can be achieved like so:

  1. Move(A,B)EMPTYTOP(B) - Move A onto B with the precondition empty top
  2. ON(A,B)ON(B,TABLE)EMPTYTOP(A)¬EMPTYTOP(B)
    1. States that A is On B
    2. B is on Table
    3. Top of A is empty
    4. Top of B is not empty (represented through negation sign ¬)

If you wanted to treat the start conditions as a goal state the preconditions that must me met are like so:

EMPTYTOP(A)EMPTYTOP(B)ONTABLE(A,TABLE)ONTABLE(B,TABLE)
Thereafter ensuring that he conditions are met the add table and delete table may look like this:

In terms of adding data to the add and delete list, you should put the new statements and conditions into the add list and the old no longer true conditions into the delete list. So:

What is a state space?

Important

A state space is a representation of all the possible combinations of a system representing all the possible states an algorithm may exist in

Key Components of a State Space:

  1. States – Each state represents a unique configuration of the system at a given point.
  2. Initial State – The starting point in the state space.
  3. Goal State(s) – The desired outcome(s) that the system aims to reach.
  4. Actions (Operators) – The set of valid transitions that move from one state to another.
  5. State Transition Function – Defines how actions change the current state to a new state.

There are two methods to create state spaces:

There is another planning method known as Partial Order Planning. Here, there is an option to achieve a state with any means possible assuming that the pre-conditions were already satisfied.