import tensorflow as tf

                episode[i]=[];
            total_step+=1;
            if Done:
                break
            
        # Print out which step we're on, useful for debugging. (average recent 10 episode scores)
        if(i_episode>=10):
          print("Episode {}/{} ({})".format(i_episode + 1, num_episodes, np.max(np.mean(stats["episode_rewards"][:,i_episode-10:i_episode - 1],axis=1))))
    
    return stats

tf.reset_default_graph()

global_step = tf.Variable(0, name="global_step", trainable=False)
policy_estimator = np.zeros(n_particles,dtype=object);
value_estimator = np.zeros(n_particles,dtype=object);

# call proper policy and value estimators for each envs
for i in range(n_particles):
  if(ENV_NAME=="Pendulum-v0"):
    policy_estimator[i] = PolicyEstimator_Pendulum(entropy_beta=ENTROPY_BETA,learning_rate=POLICY_LR,par_idx=i)
    value_estimator[i] = ValueEstimator_Pendulum(learning_rate=VALUE_LR,par_idx=i)
  if(ENV_NAME=="MountainCarContinuous-v0"):
    policy_estimator[i] = PolicyEstimator_MountainCarContinuous(entropy_beta=ENTROPY_BETA,learning_rate=POLICY_LR,par_idx=i)
    value_estimator[i] = ValueEstimator_MountainCarContinuous(learning_rate=VALUE_LR,par_idx=i)

