def simulate(self, nsteps, epsilon, viz=False):
        simulator = self.evaluator # use a different simulator to prevent breaks 
        simulator.reset_episode()
        # add initial observation to observation history
        iobs = simulator.get_screenshot().copy()
        self.initial_eval_obs(iobs)

        if self.viz:
            simulator.init_viz_display()

        rtot = 0.0
        r_per_episode = 0.0
        episode_count = 0
        start_sim = timer()
        for i in xrange(nsteps):
            # generate reward and step the simulator
            ohist, ahist = self.eval_ohist, self.eval_ahist
            a = self.policy((ohist, ahist), epsilon)

            simulator.act(a)
            r = simulator.reward()
            rtot += r
            if simulator.episode_over():
                simulator.reset_episode()
                iobs = simulator.get_screenshot().copy()
                self.empty_eval_history()
                self.initial_eval_obs(iobs)
                episode_count += 1
                r_per_episode = rtot
            else:
                obsp = simulator.get_screenshot().copy()
                self.update_eval_history(obsp, a)
 
            if self.viz: # move the image to the screen / shut down the game if display is closed
                simulator.refresh_viz_display()

        print r_per_episode, episode_count
        if episode_count > 0:
            r_per_episode /= episode_count
        else:
            r_per_episode = rtot
        runtime = timer() - start_sim
        return rtot, r_per_episode, runtime
Send a start/end/no-change sync notification to the VSM.
dataset/ETHPy150Open sisl/Chimp/chimp/agents/dqn_agent.py/DQNAgent.simulate--crossover with--dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/n1kv/n1kv_client.py/Client.send_sync_notification