25 lines
1000 B
Python
25 lines
1000 B
Python
"""Template agent configs keep the log name and mutable values per run."""
|
|
|
|
import pytest
|
|
|
|
pytest.importorskip("mjlab")
|
|
|
|
from tasks import load_agent_cfg, load_runner_cls, registry
|
|
from tasks.robot_spec import scaffold_robot_spec
|
|
|
|
|
|
def test_onboarded_robot_gets_independent_agent_configs(neutral_robot, tmp_path, monkeypatch):
|
|
from mjrl.tasks.runner import CurriculumRunner
|
|
|
|
monkeypatch.setattr(registry, "_REGISTRY", {})
|
|
scaffold_robot_spec(neutral_robot, tasks_root=tmp_path)
|
|
registry.discover_robots(tmp_path)
|
|
first = load_agent_cfg(neutral_robot.robot_id)
|
|
first.actor.distribution_cfg["init_std"] = 99.0
|
|
first.algorithm.learning_rate = 99.0
|
|
next_run = load_agent_cfg(neutral_robot.robot_id)
|
|
assert next_run.actor.distribution_cfg["init_std"] != 99.0
|
|
assert next_run.algorithm.learning_rate != 99.0
|
|
assert first.experiment_name == next_run.experiment_name == neutral_robot.robot_id
|
|
assert load_runner_cls(neutral_robot.robot_id) is CurriculumRunner
|