Last active
January 17, 2023 22:01
-
-
Save antigones/bb483f282c2600eb7076680902fe4953 to your computer and use it in GitHub Desktop.
Reward function
This file contains 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
def get_reward(self, state): | |
# GOAT and WOLF cannot be left unsupervised together | |
# GOAT and CABBAGE cannot be left unsupervised together | |
if state[2] == self.goal_state[2]: | |
return 100 | |
if {'🐐', '🐺'} <= state[0] and '⛵' not in state[0]: | |
return -100 | |
if {'🐐', '🥦'} <= state[0] and '⛵' not in state[0]: | |
return -100 | |
if {'🐐', '🐺'} <= state[2] and '⛵' not in state[2]: | |
return -100 | |
if {'🐐', '🥦'} <= state[2] and '⛵' not in state[2]: | |
return -100 | |
return -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment