POMDPPlanners.simulations.simulations_deployment.tasks package

Submodules

POMDPPlanners.simulations.simulations_deployment.tasks.environment_visualization_task module

Task that renders one environment’s visualizations on a worker.

The task wraps an ExperimentVisualizer along with the per-environment inputs it needs. Dispatched via the simulator’s task manager (Dask, Joblib, PBS, Sequential), it runs on a worker process. The worker writes artifacts into a local scratch directory it creates itself, then returns a mapping from POSIX-style relative path to file bytes. The simulator (parent process) materializes those bytes on its own filesystem and handles MLflow logging.

This contract is OS-agnostic: no filesystem path crosses the wire, so a Linux client can dispatch tasks to Windows workers and vice versa.

Each task instance carries a unique config id so the cache-backed managers (Joblib, PBS) never serve a stale return from a previous run.

class POMDPPlanners.simulations.simulations_deployment.tasks.environment_visualization_task.EnvironmentVisualizationTask(visualizer, env_name, environment, policy_results, policies, cache_visualizations)[source]

Bases: SimulationTask

Per-environment visualization unit dispatched through the task manager.

The task is intentionally a self-contained value object: it holds the visualizer, the environment, and the per-policy results. Workers pickle and execute it without needing a back-reference to the simulator (which would drag the live task-manager client into the pickle stream and break Dask dispatch) and without any client-supplied filesystem path (which would either fail to unpickle on a foreign OS or point at a directory the worker cannot reach).

Parameters:
visualizer

Strategy that renders the artifacts.

env_name

Name of the environment, used as the task identifier.

environment

Environment instance for which artifacts are rendered.

policy_results

Mapping from policy name to histories.

policies

Policy instances corresponding to policy_results keys.

cache_visualizations

Whether to render per-episode env-specific caches.

get_config_id()[source]

Return a unique identifier for this visualization task.

The id includes a per-instance UUID so the cached managers (Joblib, PBS) never serve a stale return from a previous run.

Return type:

str

run()[source]

Render the environment’s visualization artifacts on the worker.

The worker creates a private scratch directory via tempfile.mkdtemp, invokes the visualizer there, reads every produced file into memory, cleans up the scratch directory, and returns the bytes dict.

Return type:

Dict[str, bytes]

Returns:

Mapping from POSIX-style relative file path to file bytes.

POMDPPlanners.simulations.simulations_deployment.tasks.episode_simulation_task module

POMDPPlanners.simulations.simulations_deployment.tasks.hyper_parameter_tuning_simulation_task module