Package search.optimisation
Class GeneticAlgorithm
java.lang.Object
search.optimisation.GeneticAlgorithm
Implementation of a Genetic Algorithm to optimize weights for evaluating game states in a specific game scenario.
References: https://direct.mit.edu/books/book/4675/An-Introduction-to-Genetic-Algorithms, https://stackoverflow.com/a/1575995
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents an individual in the genetic algorithm population, with specific weights for evaluating game states. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
GeneticAlgorithm
public GeneticAlgorithm()
-
-
Method Details
-
playGame
public static double playGame()Simulates playing a full game using a specific set of weights for evaluation.- Returns:
- The score achieved in the simulated game.
-
main
Main method that executes the Genetic Algorithm to optimize weights. Outputs the best individual found after a number of generations to a text file.- Parameters:
args- Command-line arguments (not used).
-