Created
May 22, 2020 07:35
-
-
Save addy1997/25f79eda443543eecad4488d9dc7a593 to your computer and use it in GitHub Desktop.
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
#fetching agent states | |
def get_agent_states(self): | |
start_state = None | |
target_state = None | |
start_state = list(map(lambda x:x[0] if len(x) > 0 else None, np.where(insert_grid_map==4))) | |
target_state = list(map(lambda x:x[0] if len(x) > 0 else None, np.where(insert_grid_map==3))) | |
if (start_state == [None, None] or target_state == [None, None]): | |
sys.exit('Start or Target state not specified') | |
if (start_state == self.obstacle_mask): | |
sys.exit('Obstacle encountered GAME OVER !!!') | |
return start_state, target_state | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment