Question: Create a new . py file called SpaceCapsuleEnvironment.py and build a model that keeps the space capsule in the safety range for as long as

Create a new .py file called SpaceCapsuleEnvironment.py and build a model that keeps the space capsule in the safety range for as long as possible using SARSA algorithm.
1)[15 points] Create a SpaceEnv() class with the following function
[5 points]__init__(self), an initilization function that defines the initial values for the environment.
[5 points] step(self, action), a step function that provides the next observation (state) of the system, a reward, and stopping criteria (done) given an action.
[5 points] reset(self), a function to reset the values of the environment after each epsiode.
2)[5 points] Discretize the alignment range in 100 evenly spaced numbers over the interval -200 cm and 200 cm. You should use the function np.linspace. Also, update the function getState(observation).
3)[10 points] Run SARSA algorithm with the SpaceEnv() you've just created. You should save the plot containing the results.
4)[10 points] Change the learning rate parameter ALPHA to 0.2 and then to 0.5, and discuss your findings.

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!