Views
No views yet
deathenv)gymnasium.Env and integrates seamlessly with gym.make()..record() method to evaluate policies and save MP4 demonstrations.pip install git+https://huggingface.co/minzSleeps/TransportEnergyGridEnv.gitpip install git+https://github.com/Minz-sleeps/DeathEnv.git1git clone https://github.com/Minz-sleeps/DeathEnv.git
2cd DeathEnv
3pip install -e .1import gymnasium as gym
2import deathenv
3
4env = gym.make("TransportEnergyGrid-v0", grid_size=20, n_obstacles=10)
5
6obs, info = env.reset(seed=42)
7done = False
8
9while not done:
10 action = env.action_space.sample()
11 obs, reward, terminated, truncated, info = env.step(action)
12 done = terminated or truncated
13
14env.close()1from src.env import TransportEnergyGridEnv
2
3env = TransportEnergyGridEnv(grid_size=20)
4env.record("demo.mp4", model=None, seed=42)
5env.close()DeathEnv/
├── pyproject.toml # Package configuration and dependencies
├── README.md # Documentation
├── requirements.txt # Core dependencies
├── src/
│ ├── __init__.py # Package exports & Gymnasium registration
│ └── env.py # TransportEnergyGridEnv implementation
└── examples/
├── train.py # Example: Train DQN agent via Stable-Baselines3
├── evaluate.py # Example: Evaluate model & record video0: Move Up1: Move Down2: Move Left3: Move Rightrewards argument (a dictionary overriding default values):1custom_rewards = {
2 "step": -0.05, # Step penalty
3 "collision": -2.0, # Obstacle or grid boundary collision
4 "cargo_pickup": 30.0, # Cargo pickup reward
5 "delivery": 100.0, # Successful delivery to destination
6 "barrel": 20.0, # Collecting energy barrel
7 "enemy_collision": -50.0, # Collision with an enemy
8 "energy_exhaustion": -30.0 # Running out of energy
9}
10
11
12env = gym.make("TransportEnergyGrid-v0", rewards={"delivery": 200.0, "step": -0.1})python examples/train.py --timesteps 1000000 --grid-size 30python examples/evaluate.py --model-path dqn_transport_agent --output demo.mp4