Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c) Complete the following pseudocode that will implement the desired rational agent function. AgentProgram will return one of the following actions; Suck, Left, Right, NoOp

c) Complete the following pseudocode that will implement the desired rational agent function.

AgentProgram will return one of the following actions; Suck, Left, Right, NoOp.

  • Format/language does not matter.
  • Dont forget that return exits the code!
  • Copy-Paste the code (skip comments) and write your code as cleanly and compactly as possible.

 

bool isAClean = False

bool isBClean = False

action AgentProgram([location,status]) // returns an action

{

// isBClean and isAClean can be accessed here. They are global variables that keep their values through different calls to the function.

// I.e. if you set one to Clean now, next time you will find it as Clean.

// write your code below.

...

...

....

}

// Main code that calls the agent function forever

do{

percept = GetPercept();

action = AgentProgram(percept)

ApplyAction(action);

}while (action != NoOp);

image text in transcribed

c) Complete the following pseudocode that will implement the desired rational agent function. Agent Program will return one of the following actions; Suck, Left, Right, Noop. Format/language does not matter. Don't forget that return exits the code! Copy-paste the code (skip comments) and write your code as cleanly and compactly as possible. bool isaClean = False bool isBClean = False action Agent Program([location,status]) // returns an action { // isBClean and isaClean can be accessed here. They are global variables that keep their values through different calls to the function. // I.e. if you set one to Clean now, next time you will find it as Clean, // write your code below. 3 // Main code that calls the agent function forever do { percept - Get Percept(); action = Agent Program percept) ApplyAction(action); }while (action ! - Noop); c) Complete the following pseudocode that will implement the desired rational agent function. Agent Program will return one of the following actions; Suck, Left, Right, Noop. Format/language does not matter. Don't forget that return exits the code! Copy-paste the code (skip comments) and write your code as cleanly and compactly as possible. bool isaClean = False bool isBClean = False action Agent Program([location,status]) // returns an action { // isBClean and isaClean can be accessed here. They are global variables that keep their values through different calls to the function. // I.e. if you set one to Clean now, next time you will find it as Clean, // write your code below. 3 // Main code that calls the agent function forever do { percept - Get Percept(); action = Agent Program percept) ApplyAction(action); }while (action ! - Noop)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Discuss the various types of leasing.

Answered: 1 week ago

Question

Define the term "Leasing"

Answered: 1 week ago

Question

What do you mean by Dividend ?

Answered: 1 week ago

Question

What is database?

Answered: 1 week ago