I am having difficulty learning by connecting the external API and the unity environment I have created.
I was looking at the previous ml-agent version of DQN code and wanted to use the following code. How should I use this in the current version?
# send the action to the environment and receive resultant environment information
env_info = env.step(action)[brain_name]
next_state = env_info.vector_observations[0] # get the next state
reward = env_info.rewards[0] # get the reward
done = env_info.local_done[0] # see if episode has finished
and
# reset the unity environment at the beginning of each episode
env_info = env.reset(train_mode=True)[brain_name]
# get initial state of the unity environment
state = env_info.vector_observations[0]
Like this.
I am trying to change it to the current version while watching the official documentary, but it is not clearly resolved.
How should I use this in the current ml-agents version? And what exactly does this mean? I mean, why is that becoming a 'state' of Environment?
The code below was written after watching the official documentary, but I don't know if this is the right way and I don't know the meaning.
decision_steps, terminal_steps = env.get_steps(behavior_name)
state = decision_steps.obs[index][0,:]