Skip to content

rrocketmann/gym-lunar-lander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gymnasium Lunar Lander DQN

This repository contains two different approaches to solving the Gymnasium Lunar Lander environment: a simple rule-based algorithm and a Machine Learning (Reinforcement Learning) model.

Demonstration

1. Machine Learning Model (DQN)

The ML implementation uses a Deep Q-Network (DQN) algorithm written with PyTorch.

Usage:

  • Train the Model (Headless):

    python main.py

    This trains the model over 1000 fast episodes and saves the progress to lunar_lander_model.pth.

  • Watch the Trained Model (Visual):

    python main.py play

    This will open a render window and let the built-in trained agent attempt to land the craft based on its network weights.


2. Rule-Based Algorithm (If-Statement Logic)

This was the initial approach containing hand-tuned conditions (if/elif/else) that manually monitor position, velocity, and tilt to guide the module.

Usage:

  • Watch the Rule-Based Control:
    python rule_based.py

About

This is my progress towards creating a model capable of landing Gymnasium's lunar lander environment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages