Skip to main content
Resume
← All projects

Simulation and optimization

Genetic Algorithm Putt Optimizer

A parallel genetic algorithm that selects one initial velocity vector to sink a simulated golf putt on procedurally generated greens.

Procedurally generated Isaac Lab golf green used for putt optimization
Isaac Lab putting environment used to evaluate candidate shots.
Status Completed · 2025
Technologies
  • Python
  • NVIDIA Isaac Lab
  • Isaac Sim
  • PyTorch
  • Genetic algorithms
  • GPU simulation
  • TensorBoard

Overview

This project frames putting as a one-shot continuous-control problem. A candidate consists of a three-dimensional initial ball velocity; the simulator applies it once, runs the rolling physics, and evaluates the final result.

NVIDIA Isaac Lab provides procedurally generated heightfield greens, randomized ball-to-cup distances, and parallel simulation so an entire genetic-algorithm population can be tested together.

Problem and context

A useful optimizer must first discover any shot that reaches the cup, then distinguish a controlled putt from a high-speed collision or skip. The search space is continuous, the surface changes between runs, and each fitness evaluation requires a physics rollout.

The implementation also had to avoid unstable ball-to-terrain contact on overly dense meshes and keep generation results reproducible enough to compare configuration changes.

Technical approach

Each episode has setup, action, and roll phases. The environment generates the green, places the cup and ball, applies one velocity vector, simulates 500 steps, then checks distance, cup radius, and entry speed.

A population of 2,048 candidates evolves through five-percent elitism, selection from the stronger half of the remaining population, weighted continuous crossover, and Gaussian mutation on ten percent of child genes.

Key engineering details

Two-phase fitness

Unsuccessful shots are ranked by final distance to the cup. Once a shot is sunk, the score favours lower entry speed so the optimizer does not settle for unrealistic high-speed solutions.

Parallel evaluation

Isaac Lab evaluates thousands of independent candidate velocities in one generation, turning simulation throughput into search throughput.

Stopping criteria

Evolution stops on a high-quality sink, ten generations without improvement, or the configured maximum of 25 generations.

Experiment records

Per-generation CSV and TensorBoard logging capture fitness, shot parameters, and run context; code snapshots support later reproduction.

Results and outcomes

Across 800 documented runs, the genetic algorithm consistently found valid putts on varied randomized greens, typically within 5–15 generations.

The two-phase objective shifted optimization from merely reaching the cup toward controlled entry speed, while terrain-resolution testing identified a practical contact-stability constraint.