code: def __init__(
      self, space: SpaceWrapper, population_size: int, sample_size: int
  ):
      super().__init__(space)
  
      self.population_size = population_size
      # list of object,
      self.population = collections.deque()
      # list of str, for duplicate checking
      self.population_model_ids = collections.deque()
  
      self.space = space
      self.sample_size = sample_size
      self.current_sampled = 0
  
      # id here is to match the outside value.
      self.current_arch_id = None
      self.current_arch_micro = None
  
      # use the visited to reduce the collapse
      self.visited = {}
      self.max_mutate_time = 2
      self.max_mutate_sampler_time = 2
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/src/controller/sampler_ea/regularized_ea.py
imports: import collections
  from src.search_space.core.model_params import ModelMicroCfg
  from src.controller.core.sample import Sampler
  import random
  from src.search_space.core.space import SpaceWrapper
label_desc: Use image node_id 1 to create a new RegularizedEASampler object from inherited base classes: Sampler with example: obj = RegularizedEASampler(space, population_size, sample_size)