Giter Site home page Giter Site logo

ex-12_monkeybanana's Introduction

Ex.No: 12 Planning โ€“ Monkey Banana Problem

DATE: 13.04.2024

REGISTER NUMBER : 212221040145

AIM:

To find the sequence of plan for Monkey Banana problem using PDDL Editor.

Algorithm:

Step 1: Start the program
Step 2 : Create a domain for Monkey Banana Problem.
Step 3: Create a domain by specifying predicates.
Step 4: Specify the actions GOTO, CLIMB, PUSH-BOX, GET-KNIFE, GRAB-BANANAS in Monkey Banana problem.

Step 5: Define a problem for Monkey Banana problem.
Step 6: Obtain the plan for given problem.
Step 7: Stop the program.

Program:

(define (domain monkey) (:requirements :strips)
(:constants monkey box knife bananas glass waterfountain) (:predicates (location ?x)
(on-floor)
(at ?m ?x) (hasknife) (onbox ?x) (hasbananas) (hasglass) (haswater))
;; movement and climbing
(:action GO-TO
:parameters (?x ?y)
:precondition (and (location ?x) (location ?y) (on-floor) (at monkey ?y))
:effect (and (at monkey ?x) (not (at monkey ?y)))) (:action CLIMB
:parameters (?x)
:precondition (and (location ?x) (at box ?x) (at monkey ?x))
:effect (and (onbox ?x) (not (on-floor)))) (:action PUSH-BOX
 
:parameters (?x ?y)
:precondition (and (location ?x) (location ?y) (at box ?y) (at monkey ?y) (on-floor))
:effect (and (at monkey ?x) (not (at monkey ?y)) (at box ?x)	(not (at box ?y))))
;; getting bananas (:action GET-KNIFE
:parameters (?y)
:precondition (and (location ?y) (at knife ?y) (at monkey ?y))
:effect (and (hasknife) (not (at knife ?y)))) (:action GRAB-BANANAS
:parameters (?y)
:precondition (and (location ?y) (hasknife)
(at bananas ?y) (onbox ?y))
:effect (hasbananas))
;; getting water (:action PICKGLASS
:parameters (?y)
:precondition (and (location ?y) (at glass ?y) (at monkey ?y))
:effect (and (hasglass) (not (at glass ?y)))) (:action GETWATER
:parameters (?y)
:precondition (and (location ?y) (hasglass) (at waterfountain ?y)
(at monkey ?y) (onbox ?y))
:effect (haswater)))

Input

Problem :

(define (problem pb1)
(:domain monkey)
(:objects p1 p2 p3 p4 bananas monkey box knife) (:init (location p1)
(location p2) (location p3) (location p4) (at monkey p1) (on-floor)
(at box p2)
(at bananas p3) (at knife p4)
)
(:goal (and (hasbananas)))
)

Output/Plan:

image

Result:

Thus the plan was found for the initial and goal state of given problem.

ex-12_monkeybanana's People

Contributors

militantvlr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.