Example #1
0
    def __init__(
        self,
        input_queue: Queue,
        output_queue: Queue,
        seed_seq: np.random.SeedSequence,
        store_class: Type[BaseExperienceStore],
        warmup_steps: int = 0,
        store_config: Dict = {},
        global_config: Dict = {},
        index: int = 0,
        **kwargs,
    ):
        super().__init__()

        self.input_queue = input_queue
        self.output_queue = output_queue
        self.seed_seq = seed_seq

        validate_subclass(store_class, BaseExperienceStore)
        self.store_class = store_class
        self.store_config = store_config

        self.warmup_steps = warmup_steps

        self.global_config = global_config
        self.index = index
Example #2
0
    def __init__(
        self,
        input_queue: Queue,
        output_queue: Queue,
        seed_seq: np.random.SeedSequence,
        env_class: Type[BaseEnvironment],
        num_envs: int = 2,
        env_config: Dict = {},
        global_config: Dict = {},
        index: int = 0,
        **kwargs,
    ):
        super().__init__()

        self.input_queue = input_queue
        self.output_queue = output_queue
        self.seed_seq = seed_seq

        validate_subclass(env_class, BaseEnvironment)
        self.env_class = env_class
        self.num_envs = num_envs
        self.env_config = env_config

        self.global_config = global_config
        self.index = index
Example #3
0
  def __init__(
    self,
    registry: WorkerRegistry,
    seed_seq: np.random.SeedSequence,
    pipeline_class_configs: List[Tuple[Type[BasePipeline], Dict]],
    global_config: Dict = {},
  ):
    super().__init__()
    self.registry = registry
    self.seed_seq = seed_seq

    for pipeline_class, _ in pipeline_class_configs:
      validate_subclass(pipeline_class, BasePipeline)
    self.pipeline_class_configs = pipeline_class_configs
    self.global_config = global_config
Example #4
0
    def __init__(
        self,
        input_queue: Queue,
        output_queue: Queue,
        seed_seq: np.random.SeedSequence,
        actor_class: Type[BaseActor],
        actor_config: Dict = {},
        global_config: Dict = {},
        index: int = 0,
        **kwargs,
    ):
        super().__init__()

        self.input_queue = input_queue
        self.output_queue = output_queue
        self.seed_seq = seed_seq

        validate_subclass(actor_class, BaseActor)
        self.actor_class = actor_class
        self.actor_config = actor_config

        self.global_config = global_config
        self.index = index