Question: 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);

 c) Complete the following pseudocode that will implement the desired rational

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!