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 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started