Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Python Scenario We are on the way to setting foot on Mars. To do so , we need to refuel our space capsule in
Use Python
Scenario
We are on the way to setting foot on Mars. To do so we need to refuel our space capsule in a space station thousands of miles away from Earth.
We need to perform a docking operation similarly as shown in this video.
Goal
Build a reinforcement learning model to perfom the docking operation autonomously while respecting safety and time constraints.
Time constraint
The docking operation must be done in minutes s
Safety constraint
For the docking operation to be performed safely, the space capsule needs to be aligned cm from the docking center of the space station.
Actions
You only have actions: go left, do nothing, go right.
Observations
Space capsule alignment with the space station. It is assumed the alignment can range from m to m where m means perfect alignment. We also assume that negative values describe a misalignment to the left and positive values represent a misalignment to the right.
Tasks
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.
points Create a SpaceEnv class with the following function
pointsinitself an initilization function that defines the initial values for the environment.
points stepself action a step function that provides the next observation state of the system, a reward, and stopping criteria done given an action.
points resetself a function to reset the values of the environment after each epsiode.
points Discretize the alignment range in evenly spaced numbers over the interval cm and cm You should use the function nplinspace. Also, update the function getStateobservation
points Run SARSA algorithm with the SpaceEnv you've just created. You should save the plot containing the results.
points Change the learning rate parameter ALPHA to and then to and discuss your findings.
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