Skip to content

Instantly share code, notes, and snippets.

@addy1997
Created May 22, 2020 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save addy1997/25f79eda443543eecad4488d9dc7a593 to your computer and use it in GitHub Desktop.
Save addy1997/25f79eda443543eecad4488d9dc7a593 to your computer and use it in GitHub Desktop.
#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