Question

In: Computer Science

Write a pseudo code program for a goal-based agent. The goal of the agent is to...

Write a pseudo code program for a goal-based agent. The goal of the agent is to find the exit of a labyrinth.

  • The agent is not omniscient
  • The agent can sense if it is next to a wall (in front, left or right)
  • The agent can turn 90 degrees to the right or left
  • The agent can drive 1unit forward

The maze is constructed of paths that are 1 unit across (wide)

Show a maze of your choosing and illustrate the path taken from start to exit according to your program (example shown here).

Solutions

Expert Solution

PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE, IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU

1. What we will do is go to every way where we can, and in this cycle of setting off to all ways, in the event that we experience last objective directions we will return 1 .

2. Else we will restore 0 on the off chance that we have not discovered any way or we have arrived at an impasse state a divider we will backpedal on the way we have come and attempt another chance.

3. At every crossing point, we have 3 prospects, to go straight or to take left or go right.

/we are putting away an extra 2d cluster path_till_now as should be obvious in work definition func(path_till_now). So this exhibit will contain the way we have continued as far as the x and y organizes the robot followed till now.

func(path_till_now)

{

if(exit found)

stop and print leave found

if(can push ahead)

push 1 stride ahead

else

backpedal on same way we have taken

if(can move left)

move left 1 unit to the bearing u are confronting

else

backpedal on a similar way we have come till now

if(can move right)

move right 1 unit to the course u are confronting

else

backpedal on a similar way we have come till now

}

4. Anytime in the event that we arrive at an impasse state divider we backpedal on the way we have followed to the latest choice. let's assume we took 1 chance say going straight and now we have arrived at a divider after this progression, we backpedal on a similar way for example we go the retrogressive way and now attempt the second chance that is going the left way.

5. In the event that we get another divider after this progression, at that point we again return to our past position and will presently attempt our third chance for example going right.

6. In any of the ways on the off chance that we arrive at our objective, we stop and state we discovered our exit.


Related Solutions

Write the pseudo code for this problem based on what you learned from the video. The...
Write the pseudo code for this problem based on what you learned from the video. The purpose is to design a modular program that asks the user to enter the length and width, and then calculates the area. The formula is as follows: Area = Width x Length
For the following program descriptions, write step by step pseudo code that shows you understand the...
For the following program descriptions, write step by step pseudo code that shows you understand the problem and what it takes to solve it. The first one is done for you as an example. Please answer the questions in the same format as the example problem below so it is the same. Example #1 Problem A customer is purchasing five items. Design a program where you collect the amount of each item, calculate the subTotal of the items, the tax...
Write a MIPS assembly language program that implements the following pseudo-code operation: result = x +...
Write a MIPS assembly language program that implements the following pseudo-code operation: result = x + y – z + A[j] x and y should be in reserved memory words using the .word directive and labeled as x and y. Initialize x=10 and y=200. Read in z from the console. Input the value -8. This is the value for z, not for –z. Store this value in memory with the label z. To begin, you could just initialize z to...
Write a pseudo code for an O (n7log3n) algorithm. Please write in C++.
Write a pseudo code for an O (n7log3n) algorithm. Please write in C++.
1. Write an algorithm to calculate the Matrix multiplication (or write with pseudo code) 2. Write...
1. Write an algorithm to calculate the Matrix multiplication (or write with pseudo code) 2. Write an algorithm to calculate the recursive Matrix multiplication (or write with pseudo code) 3. Find the time complexity of your pseudo code and analyze the differences
A customer in a grocery store is purchasing three items. Write the pseudo code that will:...
A customer in a grocery store is purchasing three items. Write the pseudo code that will: • Ask the user to enter the name of the first item purchased. Then ask the user to enter the cost of the first item purchased. Make your program user friendly. If the user says the first item purchased is milk, then ask: “What is the cost of milk.” [This should work no matter what item is entered by the user. I might buy...
Given a BST and a sum, write pseudo code to determine if the tree has a...
Given a BST and a sum, write pseudo code to determine if the tree has a root- to-leaf path such that adding up all the values along the path equals the given sum. Given the below BST and sum = 49, the array is (8, 4, 10, 1, 0, 3, 9, 15, 16). Return true, as there exist a root-to-leaf path 8− > 10− > 15− > 16 which sum is 49.
Write an algorithm in pseudo code to find one element and delete it in a doubly...
Write an algorithm in pseudo code to find one element and delete it in a doubly linked list. Your algorithm will print the original list, request the user to put in an element to be deleted, then print the final list after the deletion is done. If the element doesn’t exist in the list, print "XXX is not in the list" where "XXX" should be the one you received from the user. Use the following as your test cases to...
Write a recursive algorithm in pseudo-code to compute the “power list” of a given list of...
Write a recursive algorithm in pseudo-code to compute the “power list” of a given list of integers. Assume that the List type has members: int List.length returns the length of the list. void List.push(T n) pushes an element n to the front of the list T List.pop() pops an element from the front of the list. List$$ List$$.concat(List$$ other) returns the concatenation of this list with other. Explain in plain English the reasoning behind your algorithm. Power Lists should be...
Write a Pseudo Code to send an Array of 20 elements from 8051 to the computer...
Write a Pseudo Code to send an Array of 20 elements from 8051 to the computer via serial port at maximum baud rate possible with XTAL=11.0592MHz.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT