docstr: ensemble_pop_size trajectories will be sampled to evaluate a
  CEM solution. Each trajectory is generated by one world model
  
  :param init_state: its shape is (state_dim, )
  :param solution: its shape is (plan_horizon_length, action_dim)
  :param solution_idx: the index of the solution
  :return reward: Reward of each of ensemble_pop_size trajectories
docstr_tok: ["ensemble_pop_size","trajectories","will","be","sampled","to","evaluate","a","CEM","solution",".","Each","trajectory","is","generated","by","one","world","model",":","param","init_state",":","its","shape","is","(","state_dim",",",")",":","param","solution",":","its","shape","is","(","plan_horizon_length",",","action_dim",")",":","param","solution_idx",":","the","index","of","the","solution",":","return","reward",":","Reward","of","each","of","ensemble_pop_size","trajectories"]
code: def acc_rewards_of_one_solution(
      self,
      init_state: torch.Tensor,
      solution: torch.Tensor,
      solution_idx: int,
  ):
      """
      ensemble_pop_size trajectories will be sampled to evaluate a
      CEM solution. Each trajectory is generated by one world model
  
      :param init_state: its shape is (state_dim, )
      :param solution: its shape is (plan_horizon_length, action_dim)
      :param solution_idx: the index of the solution
      :return reward: Reward of each of ensemble_pop_size trajectories
      """
      reward_matrix = np.zeros(
          (self.ensemble_pop_size, self.plan_horizon_length)
      )
  
      for i in range(self.ensemble_pop_size):
          state = init_state
          mem_net_idx = np.random.randint(0, len(self.mem_net_list))
          for j in range(self.plan_horizon_length):
              # state shape:
              # (1, 1, state_dim)
              # action shape:
              # (1, 1, action_dim)
              (
                  reward,
                  next_state,
                  not_terminal,
                  not_terminal_prob,
              ) = self.sample_reward_next_state_terminal(
                  state=rlt.FeatureData(
                      state.reshape((1, 1, self.state_dim))
                  ),
                  action=rlt.FeatureData(
                      solution[j, :].reshape((1, 1, self.action_dim))
                  ),
                  mem_net=self.mem_net_list[mem_net_idx],
              )
              reward_matrix[i, j] = reward * (self.gamma**j)
  
              if not not_terminal:
                  logger.debug(
                      f"Solution {solution_idx}: predict terminal at step {j}"
                      f" with prob. {1.0 - not_terminal_prob}"
                  )
  
              if not not_terminal:
                  break
  
              state = next_state
  
      return np.sum(reward_matrix, axis=1)
  
imports: import itertools
  import logging
  import random
  from typing import List, Optional, Tuple
  import numpy
  import scipy.stats
  import torch
  import torch.nn
  from reagent.core import types
  from reagent.core.parameters import CONTINUOUS_TRAINING_ACTION_RANGE
  from reagent.models.base import ModelBase
  from reagent.models.world_model import MemoryNetwork
  from reagent.training.utils import rescale_actions
  from torch.distributions.bernoulli import Bernoulli
  from torch.distributions.categorical import Categorical
  from torch.distributions.normal import Normal
label_desc: Use image node_id 3 for calling the CEMPlannerNetwork obj's underlying member method code with example usage: obj.acc_rewards_of_one_solution(init_state, solution, solution_idx) and returns: np