Agents
DynaSchedBench agents implement a small interface: reset for a new episode,
read the current observation and legal actions, then return one legal action.
Agents can be used from Python or through dsbx-agent run.
Discover Available Agents
dsbx-agent list-agents
Built-in names include:
Agent |
Description |
|---|---|
|
Shortest Processing Time baseline. |
|
Uniform random legal-action baseline. |
|
Priority dispatching rule with explicit operation and machine rules. |
|
GP-based dispatching rule extracted from a fixed best-of-run expression. |
|
Genetic Algorithm online rescheduling agent. |
|
Differential Evolution online rescheduling agent. |
|
Particle Swarm Optimization online rescheduling agent. |
|
CMA-ES action scoring agent. |
|
Simulated Annealing online rescheduling agent. |
|
Tabu Search online rescheduling agent. |
|
MOEA/D-style multi-objective online agent. |
|
NSGA-II multi-objective online agent. |
|
LLM-assisted heuristic code generation agent. |
|
LLM scheduling policy with cognitive prompts. |
PDR Agents
PDR agents encode their behavior in the agent name:
dsbx-agent run -d runs/minimal -o runs/minimal/pdr_spt_lit -a pdr:SPT:LIT
Operation rules:
Rule |
Meaning |
|---|---|
|
Shortest Processing Time. |
|
Longest Processing Time. |
|
Most Work Remaining. |
|
Least Work Remaining. |
|
Most Operations Remaining. |
|
Least Operations Remaining. |
|
First In First Out. |
|
Last In First Out. |
Machine rules:
Rule |
Meaning |
|---|---|
|
Least Idle Time, usually earliest available. |
|
Least Workload. |
|
Shortest Processing Time on the machine. |
Evolutionary And Local Search Agents
Use agent-help to show relevant options:
dsbx-agent agent-help ga
dsbx-agent agent-help de
dsbx-agent agent-help pso
dsbx-agent agent-help cmaes
dsbx-agent agent-help sa
dsbx-agent agent-help ts
dsbx-agent agent-help moea
dsbx-agent agent-help nsga2
Example:
dsbx-agent run \
-d runs/minimal \
-o runs/minimal/ga \
-a ga \
--ga-population-size 16 \
--ga-generations 8 \
--ga-rollout-steps 3 \
--ga-random-seed 42
The rollout-step options control whether the agent evaluates candidate actions with a short environment rollout or with the faster one-step score estimate. Use small budgets for smoke tests and larger budgets for final experiments.
LLM Agents
LLM agents can be configured from environment variables:
export DYNA_SCHEDBENCH_LLM_PROVIDER=openai
export DYNA_SCHEDBENCH_LLM_API_KEY=your_api_key
export DYNA_SCHEDBENCH_LLM_MODEL=gpt-4o-mini
Common CLI overrides:
dsbx-agent run \
-d runs/minimal \
-o runs/minimal/llm_scheduler \
-a llm-scheduler \
--llm-provider openai \
--llm-model gpt-4o-mini \
--llm-temperature 0.2 \
--llm-sched-info-level L2 \
--llm-sched-mode direct \
--llm-sched-max-candidates 8
LLM scheduler options group into:
provider and transport:
--llm-provider,--llm-model,--llm-base-url,--llm-timeout;sampling:
--llm-temperature,--llm-top-p,--llm-top-k;prompt context:
--llm-sched-info-level,--llm-sched-mode,--llm-sched-use-few-shot,--llm-sched-max-examples;action selection:
--llm-sched-max-candidates,--llm-sched-select-machine;refinement:
--llm-sched-refinement,--llm-sched-reflection-rounds,--llm-sched-voting-n.
LLMCoder has additional candidate-generation and sandbox-evaluation options:
dsbx-agent agent-help llm-coder
If no LLM API key is available, DynaSchedBench uses a null client or fallback heuristic behavior where implemented. This keeps local tests reproducible while making it clear in logs that no real LLM call was made.
Python Agent Interface
Custom agents can follow dsbx.Agents.Base.BaseAgent:
from typing import Any
class MyAgent:
def reset(self, scenario_info: dict[str, Any] | None = None) -> None:
self.num_decisions = 0
def act(self, obs: dict[str, Any], legal_actions: list[dict[str, Any]], env: Any):
self.num_decisions += 1
if not legal_actions:
return None
return min(legal_actions, key=lambda a: a.get("process_time", 0.0))
Use the environment loop shown in Quickstart to evaluate custom agents.