Last active
August 18, 2021 19:53
-
-
Save alinazhanguwo/0ef4ad31b4675b032c549a892f914cf7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Encourage lander to use as little fuel as possible | |
# i.e. 0.85, or 0.32 | |
fuel_conservation = fuel_remaining / total_fuel | |
if distance_to_goal is decreasing: | |
if speed < threshold: | |
if position is on landing pad: | |
# Land successfully; give a big reward | |
landing_reward = 100 | |
# Multiply percentage of remaining fuel | |
reward = landing_reward * fuel_conservation | |
else: | |
# Landing outside of landing pad | |
reward = -10 | |
else: | |
# Crashed | |
reward = -100 | |
else: | |
# Encourage agents to approach the surface instead of | |
# hanging in the air | |
distance_reward = 1 - (distance_to_goal / distance_max)**0.5 | |
reward = distance_reward * fuel_conservation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment