ctm-dqn/config.yaml

73 lines
3.1 KiB
YAML

# CTM-DQN Configuration File
# Environment Parameters
environment:
# CTM Model Parameters
num_cells: 10 # Number of road cells
cell_length: 500.0 # Length of each cell (meters)
free_flow_speed: 30.0 # Free flow speed (m/s)
congestion_wave_speed: 5.0 # Congestion wave speed (m/s)
max_density: 180.0 # Maximum density (vehicles/km)
critical_density: 30.0 # Critical density (vehicles/km)
jam_density: 180.0 # Jam density (vehicles/km)
# Traffic Demand
demand_mean: 1800.0 # Mean demand (vehicles/hour)
demand_std: 300.0 # Demand standard deviation
demand_pattern: "random" # Demand pattern: constant, sine, random, csv
demand_csv_path: null # Path to CSV file with demand data (for csv pattern)
demand_csv_column: "demand" # Column name in CSV file containing demand values
# Speed Limit Control
min_speed_limit: 15.0 # Minimum speed limit (m/s)
max_speed_limit: 30.0 # Maximum speed limit (m/s)
num_speed_actions: 5 # Number of discrete speed limit actions
# Simulation
time_step: 10.0 # Time step (seconds)
episode_length: 360 # Episode length (time steps)
# DQN Agent Parameters
agent:
# Network Architecture
hidden_layers: [256, 256] # Hidden layer sizes - INCREASED for high traffic
learning_rate: 0.0001 # Learning rate
# Training Parameters
gamma: 0.99 # Discount factor
epsilon_start: 1.0 # Initial exploration rate
epsilon_end: 0.05 # Final exploration rate - HIGHER for more exploration
epsilon_decay: 0.997 # Epsilon decay rate - SLOWER decay
# Experience Replay
buffer_size: 100000 # Replay buffer size - DOUBLED
batch_size: 128 # Training batch size - DOUBLED
# Target Network
target_update_freq: 10 # Target network update frequency (episodes)
# Device
device: "cuda" # Device: cuda or cpu
# Training Parameters
training:
num_episodes: 1000 # Number of training episodes
save_freq: 50 # Model save frequency (episodes)
log_freq: 10 # Logging frequency (episodes)
checkpoint_dir: "checkpoints" # Checkpoint directory
log_dir: "logs" # Log directory
random_seed: 42 # Random seed for reproducibility
train_freq: 5 # Train every N steps (higher = faster but less stable)
# Testing Parameters
testing:
num_episodes: 10 # Number of testing episodes
render: true # Whether to render/visualize
model_path: null # Path to trained model (null for latest)
# Reward Function Weights
reward:
throughput_weight: 1.0 # Weight for throughput reward
speed_weight: 0.5 # Weight for average speed reward
density_weight: 0.3 # Weight for density penalty
action_change_weight: -0.1 # Weight for action change penalty