collector#
Source code: tianshou/highlevel/params/collector.py
- class CollectorFactory[source]#
Bases:
ABC- abstract create_collector(algorithm: Algorithm, vector_env: BaseVectorEnv, buffer: ReplayBuffer | None = None, exploration_noise: bool = False) BaseCollector[source]#
Creates a collector for the given algorithm and vectorized environment.
- Parameters:
algorithm – the algorithm
vector_env – the vectorized environment
buffer – the replay buffer to be used by the collector; if None, a new buffer will be created with default parameters
exploration_noise – whether action shall be modified using the policy’s exploration noise
- Returns:
the collector
- class CollectorFactoryDefault[source]#
Bases:
CollectorFactory- create_collector(algorithm: Algorithm, vector_env: BaseVectorEnv, buffer: ReplayBuffer | None = None, exploration_noise: bool = False) BaseCollector[source]#
Creates a collector for the given algorithm and vectorized environment.
- Parameters:
algorithm – the algorithm
vector_env – the vectorized environment
buffer – the replay buffer to be used by the collector; if None, a new buffer will be created with default parameters
exploration_noise – whether action shall be modified using the policy’s exploration noise
- Returns:
the collector