Add a plugin
The experiment registry accepts five plugin types: method, environment, metric, visualization, and obstacle generator.
Method example
from genedynamics.experiments.framework import MethodPlugin
class MyPlannerPlugin(MethodPlugin):
@property
def name(self):
return "my_planner"
def create_planner(self, env, energy, config):
return MyPlanner(env=env, energy=energy, **config)
def plan(self, planner, initial_state, rng):
result = planner.plan(initial_state, rng)
return {
"states": result.states,
"actions": result.actions,
"initial_state": initial_state,
}
Register the instance in register_all_plugins, add the method name to the V1
catalogue only when it is intended for release, and create one recipe that
proves the complete path.
Required checks
- Keep optional dependencies lazy and raise an install command that names the correct extra.
- Return JSON-serializable result metadata and arrays with stable dimensions.
- Accept the seed/random key supplied by the runner.
- Add a unit test for the adapter boundary and an integration smoke test for the runner path.
- Record device, compile/warm-up policy, and task dimensions in benchmarks.
- Update configuration validation, compatibility, and user docs.
Environment plugins additionally define environment creation, energy creation,
state dimension, position extraction, and optional task-owned reset/execution
environment behavior. Metric plugins must keep scalar outputs serializable and
may expose separate artifacts through pop_artifacts().
Based on the framework documentation · docs/guides/adding-a-plugin.md · main · View source