class_docstr: The rollout generation is bound to a single worker environment by implementing it as a Wrapper class.
class_docstr_tok: ["The","rollout","generation","is","bound","to","a","single","worker","environment","by","implementing","it","as","a","Wrapper","class","."]
docstr: Generate a single evaluation rollout.
  
  :param policy: Multi-step policy encapsulating the policy networks
  
  :return A result set with a single evaluation rollout
docstr_tok: ["Generate","a","single","evaluation","rollout",".",":","param","policy",":","Multi-step","policy","encapsulating","the","policy","networks",":","return","A","result","set","with","a","single","evaluation","rollout"]
code: def generate_evaluation(
      self, policy: Union[Policy, TorchModel]
  ) -> ESRolloutResult:
      """Generate a single evaluation rollout.
  
      :param policy: Multi-step policy encapsulating the policy networks
  
      :return A result set with a single evaluation rollout
      """
      self.rollout(policy)
  
      r = ESRolloutResult(is_eval=True)
      aggregator = self.get_stats(LogStatsLevel.EPISODE)
      r.episode_stats.append(aggregator.last_stats)
  
      return r
  
imports: import itertools
  import logging
  import time
  from typing import TypeVar, Union
  import numpy
  import torch
  from maze.core.agent.policy import Policy
  from maze.core.agent.torch_model import TorchModel
  from maze.core.env.structured_env import StructuredEnv
  from maze.core.log_stats.log_stats import LogStatsLevel
  from maze.core.log_stats.log_stats_env import LogStatsEnv
  from maze.core.wrappers.wrapper import Wrapper
  from maze.perception.perception_utils import convert_to_numpy
  from maze.train.trainers.es.distributed.es_distributed_rollouts import ESRolloutResult
  from maze.train.trainers.es.es_shared_noise_table import SharedNoiseTable
  from maze.train.trainers.es.es_utils import get_flat_parameters, set_flat_parameters
label_desc: Use image node_id 5 for calling the ESRolloutWorkerWrapper obj's underlying member method code with example usage: obj.generate_evaluation(policy) and returns: r