Download presentation

Presentation is loading. Please wait.

Published byCelia Hall Modified over 2 years ago

1
CSE 471-Project 3 Regression Planner using A* Sreelakshmi Vaddi

2
Example: Regression planner operator O1 prec: P Eff: R, ~S operator O2 prec: Q Eff: S operator O3 prec: P Eff: M operator O4 prec: R,S Eff: P,Q,R,S operator O5 prec: R,S Eff: P Initial: {P,Q} Goal: {P,Q,R,S} PQRS PQR RS QRS PQ O2 O4 O5 O1 G=0 h=0 G=1 h=1 H0: USING SET DIFFERENCE HEURISTIC – A* Goal: {P,Q} Initial: {P,Q,R,S} G=1 h=2 G=1 h=1 G=2 h=0 Number of elements {curr state MINUS Goal}

3
Example: Regression planner operator O1 prec: P Eff: R, ~S operator O2 prec: Q Eff: S operator O3 prec: P Eff: M operator O4 prec: R,S Eff: P,Q,R,S operator O5 prec: R,S Eff: P PQRS PQR RS QRS PQ O2 O4 O5 O1 G=0 h=0 G=1 h=1 H1: Heuristic function that computes the cost of a set as the sum of the levels of the individual elements of the set - A* Goal: {P,Q} Initial: {P,Q,R,S} G=1 h=2 G=1 h=2 G=2 h=0 P -> 0, Q -> 0, R -> 1, S-> 1 SUM (set-level-val-without-mutex (each condition))

4
Example: Regression planner operator O1 prec: P Eff: R, ~S operator O2 prec: Q Eff: S operator O3 prec: P Eff: M operator O4 prec: R,S Eff: P,Q,R,S operator O5 prec: R,S Eff: P PQRS PQR RS QRS PQ O2 O4 O5 O1 G=0 h=0 G=1 h=1 H2: Heuristic function that computes the cost of a set as the level at which that particular set occurs first– A* Goal: {P,Q} Initial: {P,Q,R,S} G=1 h=1 G=1 h=1 G=2 h=0 PQRS -> 1, PQR -> 1, RS -> 1, QRS-> 1, PQ->0 set-level-val-without-mutex (list of all conditions)

5
Example: Regression planner operator O1 prec: P Eff: R, ~S operator O2 prec: Q Eff: S operator O3 prec: P Eff: M operator O4 prec: R,S Eff: P,Q,R,S operator O5 prec: R,S Eff: P PQRS PQR RS QRS PQ O2 O4 O5 O1 G=0 h=0 G=1 h=1 H3: Heuristic function that computes the cost of a set as the level at which that particular set occurs first without any mutexes– A* Goal: {P,Q} Initial: {P,Q,R,S} G=1 h=2 G=1 h=2 G=2 h=0 PQRS -> 2, PQR -> 1, RS -> 2, QRS-> 2, PQ->0 set-level-val-with-mutex (list of all conditions)

6
What you need to get started Load the code given to you on Allegro You need not touch/modify this code at all Loading instructions on project webpage :problems file + graph plan code You will need from Project 1 – A* search Node structure Children function A* main function Trace path Display stats part Puzzle children F-value fn NEW FUNCTIONS: Heuristics: H0,H1,H2,H3 Goalp: (Actually initialp)

7
Heuristics and Goalp functions H0: Number of elements {curr state MINUS Goal} H1: SUM (set-level-val-without-mutex (each condition)) H2: set-level-val-without-mutex (list of all conditions) H3: set-level-val-with-mutex (list of all conditions) Goalp: find if current state is equal to the goal state Eg: {PQR} = {PQ} FALSE

8
Puzzle Children Function Generates the children of current state, by checking if there is an operator applicable to current state When can you apply an op to state s? None of effects of op negate conditions in S (Reason why we don’t apply O1 in Eg) At least one effect of op is in S (Reason why we don’t apply O3 in Eg) And May be more conditions Negative literals Op-adds, op-deletes

9
Puzzle Children Function Contd New state generation? op-preconditions U (parent state – op-effects) IMPORTANT: Handling negative literals ‘P is (:NOT (P)) (So check car of every condition to see if its negative literal and then *special*) Op-deletes, op-adds can be useful than op-effects PQR on o1 ? (operator O1 prec: P Eff: R, ~S) {p} U {{p,q,r}-{r,~s}}={p,q}

10
Useful functions-Graph Plan code (get-ground-operators ‘Eg-problem) : returns O1..O5 (op-name op1) : returns (UNSTACK A A) (op-preconditions op1) ((ON A A) (CLEAR A) (ARM-EMPTY)) (op-effects op1) ((HOLDING A) (CLEAR A) (:NOT (CLEAR A)) (:NOT (ARM-EMPTY)) (:NOT (ON A A))) (op-adds op1) ((HOLDING A) (CLEAR A)) (op-deletes op1) ((CLEAR A) (ARM-EMPTY) (ON A A))

11
Useful functions-Graph Plan code (problem-init 'class-problem) : Initial state of the problem ((OBJECT A) (OBJECT B) (ON-TABLE A) (ON-TABLE B) (CLEAR A) (CLEAR B) (ARM-EMPTY)) (problem-goal 'class-problem) : Goal state of the problem ((:NOT (CLEAR B)) (ARM-EMPTY)) Heuristic Functions (Compute-pg problem) : Has to be called in the beginning of every problem so that you can call all the above functions as well as heuristic functions.

12
Other functions Lisp set operations (list1 list2 :test #’equal) Set Difference Union Intersection

13
Possible Program Flow Call compute-gp, get-ground-operators, problem-init, problem-goal Make goal node from problem-init Call A*(list goal-node, goalp,…) Change puzzle-children function as discussed above Write Goalp function Write heuristic functions calling set-level functions from the given code

14
Progression Planner - Simpler When an OP can apply to state S? S contains OP-preconditions New child state (S Union OP-effects) Rest remain same And don’t forget to change the compute- pg code part as said by Dr.Rao in project description

15
Example: Progression planner operator O1 prec: P Eff: R, ~S operator O2 prec: Q Eff: S operator O3 prec: P Eff: M operator O4 prec: R,S Eff: P,Q,R,S operator O5 prec: R,S Eff: P Initial: {P,Q} Goal: {P,Q,R,S} PQRS PQR PQS PQM PQ O2 O3 O1 G=0 h=0 G=1 h=1 H0: Using Set difference heuristic G=1 h=1 G=1 h=2 G=0 h=0 O2 on PQ? Child : {P,Q} U {Q,S}={P,S} O4,O5 on PQ? NO R Not in PQ, S not in PQ

Similar presentations

OK

CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 17– Theorems in A* (admissibility, Better performance.

CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 17– Theorems in A* (admissibility, Better performance.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google