Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

this is a python program CS1311-Introduction to computing with python Due Date:

ID: 3738099 • Letter: T

Question

this is a python program

CS1311-Introduction to computing with python Due Date: 11:59 pm of 03/27/2018 In this assignment, you will simulate the motion of a robot inside a 20 x 20 two-dlmensional grid (20 units length and 20 units width). Depending on location of the robot, its motion is governed by different rules as describecd below: At time O, the robot is randomly positioned inside the grid (excluding the boundary and corners). The first step of the robot is randomly chosen between four possible directions (left, right, forward, and backward) After the first step: . if the robot is away from the boundary (meaning at least one unit away from the boundary), it has a 50% chance of moving in the same direction as the direction it was moving in the previous step or 50% chance of randomly choosing from the remaining three directions. Note here that to choose the direction at a time point, the robot needs to remember what direction it moved in the previous time step. In some sense, the robot has a short-term memory and is not a completely random robot. If the robot is on the boundary inot the corner), it chooses a direction randomly from three possibilities. In the boundary, there are only three possibilities because the robot is not allowed to move outside of the grid. o o If the robot is at the corners, it chooses a direction randomly from two possibilities. In the corners, there are only two possibilities because the robot is not allowed to move outside of the grid nor it can move diagonally o The robot is not allowed to take diagonal steps First, write a python code to simulate the movement of a robot for 1000 steps. Keep track of how many times the robot positions in the 9 different regions illustrated below. Each of the four corners (c1, C2, C3, and C4) regions are square of of 10 x 5 units. The remaining region is the central region (O) Once you are able to simulate the movement of the 100 robots. Now perform simulations of movements for 1000 robots (each robot moves 1000 steps). Now display the average time the spends in the 9 different regions 5 by 5 units; each of the four border regions (81. 82. 83, and B4) are rectangular regions The average should be computed over the 100 robots.

Explanation / Answer

here is the python code for the given problem and with a little enhancement it can recognize audio and responds accordingly

Let's create a Python file for our application and give it execution rights:

The first step is to check if everything is in place. Write the following in the simple_app.py file:

If everything was set-up correctly the NAO robot should talk and say "Hello there!" to you. If not, one of the aforementioned instructions was not performed correctly

Now for the real application, you can use any of the documented API calls that exist here. Insert the following in the simple_app.py file: