ray.rllib.evaluation.rollout_worker.RolloutWorker.foreach_env_with_context#
- RolloutWorker.foreach_env_with_context(func: Callable[[Any | gymnasium.Env, EnvContext], T]) List[T] [source]#
Calls given function with each sub-env plus env_ctx as args.
- Parameters:
func – The function to call for each underlying sub-environment and its EnvContext (as the args).
- Returns:
The list of return values of all calls to
func([env, ctx])
.