[docs]classVanillaRunGovernorTerminationCondition(TerminationCondition):""" A combination of environment and max episodes flow control. This :class:`~TerminationCondition` uses the :py:class:`EnvironmentTerminationCondition` and :py:class:`MaxEpisodesTerminationCondition` to end an *episode* when the environment terminates, and the *phase* when all workers have reached the maximum number of episodes limit. Example ------- The following excerpt from a phase configuration shows an example of using this termination condition to end the phase once both workers have experienced 10 episodes each, where each episode runs until the environment terminates:: schedule: - phase_0: # (Definition of environment and agents omitted.) simulation: name: palaestrai.simulation:Vanilla conditions: - name: palaestrai.simulation:VanillaSimControllerTerminationCondition params: {} phase_config: # Additional config for this phase mode: train worker: 2 episodes: 10 run_config: condition: name: palaestrai.experiment:VanillaRunGovernorTerminationCondition params: {} """def__init__(self):self._max_episode_tc=MaxEpisodesTerminationCondition()self._env_tc=EnvironmentTerminationCondition()