Skip to content
Lunar Lander: Three Agents, One Landing

Lunar Lander: Three Agents, One Landing

Three reinforcement learning agents learn to land a spacecraft between two flags in the LunarLander environment. Each one comes from a different family of methods, and all three face the same task, the same scoring, and the same 30 test landings.

PyTorchDQNDouble DQNPPOGymnasium

135,816

steps for Double DQN to solve

239

DQN test average

80%

landing rate, DQN and PPO

9

PPO configurations tested

Problem

Understanding the challenge and user needs

Algorithm comparisons in textbooks rarely share conditions. Whether value-based or policy-gradient methods learn faster, land more reliably, or overestimate their own performance depends on measuring them side by side.

Approach

Strategy and methods used to address the problem

DQN, Double DQN, and PPO each trained until solving the task, with environment steps counted to the point of solution. A sensitivity study varied nine PPO configurations, and a separate analysis tracked how far each value-based agent overestimated its returns.

Training reward curves for DQN, Double DQN, and PPO (opens in a new tab)
Training reward for each agent, with the solved threshold of 200 marked.
Plotted against environment steps, the two value-based agents reach the threshold sooner than PPO.
DQN's predicted action values run above Double DQN's, the overestimation that the second network corrects.
The sensitivity study varies one PPO setting at a time across nine configurations.

Final Solution

The final design and outcome

Double DQN solved the task soonest, at 135,816 environment steps, against 144,933 for DQN and 225,280 for PPO. On 30 test landings DQN averaged 239 points and PPO 216, each landing successfully 80 percent of the time, while Double DQN averaged 167 and landed 47 percent.

The trained DQN agent lands between the flags.
The Double DQN agent flies the same approach.
The PPO agent descends under a policy learned without a value table.
Test reward and landing rate over 30 episodes separate the agents more than their training curves do.

Three agents on the same task

AgentSolved atSteps to solveTest averageLanding rate
DQNEpisode 270144,933239.280%
Double DQNEpisode 256135,816166.547%
PPOIteration 110225,280215.780%

Test figures cover 30 landings per agent.

Impact & Validation

Results, learnings, and outcomes

Fastest to train did not mean most reliable to fly. The comparison separates sample efficiency from test performance, a distinction that matters whenever a model moves from training to use.