Question: #PLEASE WRITE A PYTHON CODE FOR THIS HOMEWORK You have an environment . Also, you are going to work with same probabilistic actions: Diagram showing

#PLEASE WRITE A PYTHON CODE FOR THIS HOMEWORK

You have an environment .

#PLEASE WRITE A PYTHON CODE FOR THIS HOMEWORK You have an environment

Also, you are going to work with same probabilistic actions:

. Also, you are going to work with same probabilistic actions: Diagram

Diagram showing the probability of action result, when you choose to move in a direction you might end up at your desired location at %80 percent chance only, and side positions both have 10% chance.( In our example, if our agent chooses the action UP, it will have 80% chance of moving up, and 10% chance of moving either left or right. If the agent chooses the action RIGHT, it has an 80% chance of moving right, and 10% chance of either moving up or down.)

Same rules also apply to actions of other directions.

1. At every empty and non-terminal cell, there are four possible actions corresponding to four cardinal directions: Right, up, left, down.

2. If your movement direction is blocked or out of grid bounds, you still considered as performed that action but your next state remains the same.

3. Values of terminal states will not change, they will remain same during whole process.

4. Actions are not deterministic, as mentioned before, when you choose a direction to move you have 10% chance to move to left or right side respectively. If you move to a blocked cell during this, rule 2 applies.

5. your step cost is -0.04 and your discount rate is 1.0.

You are going to implement value iteration algorithm on this grid environment and show final values of each state .When you complete the assignment and run the code, you should get an output like this (values may differ a little):

showing the probability of action result, when you choose to move in

end +1 end -1 start Grid Board 0.8 0.1 Utilities with discount factor 1 3 0.812 0.868 0.918 + 1 N 0.762 0.660 1 0.705 0.655 0.611 0.388 1 2 3 3 4

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!