Config Recipes¶
Common experiment configurations. Copy the relevant sections into your YAML files.
Fully blind agents (local position only)¶
Agents see only their own [x, y]. No information about other agents or obstacles. Maximally challenging for learning.
Full global view (default)¶
Each agent sees Euclidean distances to all other agents and all obstacles.
Partial observability — radius-based¶
Agents see other agents and obstacles within Manhattan radius r. Good balance between tractability and realism.
Larger radius = more information = slower Q-table growth. Keep radius ≤ 4 for tabular methods on a 10×10 grid.
Egocentric (relative) view¶
All positions expressed relative to the observing agent. Agent always sees itself at [0, 0].
observations:
type: relative
params:
include_agents: true
include_obstacles: true
include_walls: false
distance_type: manhattan # or "euclidean"
Sparse reward only (capture/death signals)¶
No step cost, no shaping. Pure capture-based signal. Hardest for learning, most informative for ablation.
Note: base reward always includes a −5 step cost for predators. To remove it, you'd need a custom reward function wrapping base_reward() with modified values — currently the step cost is hardcoded.
Dense shaping — predator distance¶
Predators get negative reward proportional to distance to nearest prey. Encourages approach.
Tune weight up if predators are not approaching; tune down if they learn approach but not capture.
Prey survival reward¶
Prey get +weight per step for staying alive. Adds an explicit survival incentive.
Dense for both sides¶
rewards:
base:
enabled: true
shaping:
- name: predator_distance
weight: 0.5
- name: survival
weight: 1.0
Long episodes (exploration-heavy)¶
Good for large grids or sparse reward settings.
Short episodes (fast iteration)¶
Good for debugging and hyperparameter search.
Multi-capture termination¶
Episode continues until N captures. Useful for studying predator coordination.
Obstacle-free grid¶
Remove all obstacles. Cleaner dynamics for baseline experiments.
High obstacle density¶
Dense obstacle grid. Tests path planning and obstacle-avoidance incidentally learned through capture rewards.
With
block_agents_by_obstacles: true(default), 40% obstacles on a 10×10 grid leaves 60 traversable cells for 6 agents — very tight.
Asymmetric team sizes¶
One predator versus three prey. Predator must learn to corner. Prey can disperse.
CQL — keep state space small¶
CQL scales as action_dim^n_agents per joint state. On a large grid with many agents, the table becomes huge. Recommended settings for tabular CQL:
With size=6, 1 pred, 1 prey, 5 actions: joint action space = 5^2 = 25 per state. Manageable.
Speed asymmetry (predator faster than prey)¶
Requires speed_discrete_5 or any action space paired with SpeedWrapper's sub-stepping (speed comes from agents.yaml, not from the action space itself):
# agents.yaml
agents:
predators:
speed: 2 # via SpeedWrapper: up to 2 sub-steps per logical turn
preys:
speed: 1
See plug-and-play/configs/dqn_speed1, dqn_speed2, dqn_speed3 for a ready-made 1/2/3 speed sweep, and concepts/wrappers.md for the mechanics.
Diagonal-only movement¶
Remember to update action_dim in your experiment YAML (still 5, since cross is also a 5-action space) if it's set explicitly.
Double DQN + Dueling DQN¶
# experiment_dqn.yaml
experiment:
algorithm:
name: dqn
params:
double_dqn: true # decouples action selection (online net) from evaluation (target net)
dueling: true # splits the network into value + advantage streams
See plug-and-play/configs/dqn_1v1/experiment_dqn.yaml for a working example with both enabled.