Git Product home page Git Product logo

player-build-optimizer-genetic-algorithm's Introduction

Optimizing player builds with Genetic Algorithms

Project for "Sistemas de inteligencia artificial" @ITBA, written in Java This is a university project done in collaboration with Ximena Zuberbuhler, Martin Victory and Segundo Fariña. The project follows the guidelines and objectives presented in "Enunciado.pdf"

Objective

Implement a genetic algorithm engine in Java, capable of using different replacing, selection and mutation methods. The objective is optimizing a players build (items and height) so that it performs better (given by a pre-defined fitness function).

Requisites

  • Java

Running the GA

We decided not to include the fulldata files in this repository. So, to run just put the fulldata folder in the configFolder folder.

Note: the configFolder is in the root folder, but to run the already compiled binary, you need to copy the fulldata folder also inside the binaries folder.

To run it again you can just press ENTER on the console (all parameters can be modified between runs, exept the data path). This loop was done to avoid data load times between runs.

Build code

An already builded jar is provided in the binaries folder. But if you want to build it yourself, you can just run in the root folder:

$ mvn clean package

The generated jar with the configuration files will be created inside the target folder.

Running the jar

Move to the folder containing the jar, check that the fulldata folder, and the parameters.json is at the same level of the jar. Then run:

$ java -jar <jarName>

Arguments

Configuration is done in the parameters.json file.

  • crossing: ONE_POINT, TWO_POINT, ANULAR or UNIFORM.

  • selection: ELITE, ROULLETE, BOLTZMANN, TOURNAMENT or RANKING.

    • The selection for the crossover is done by A * selection1 + (1 - B) * selection2.
    • The selection for the replacement is done by B * selection13 + (1 - B) * selection4.
  • replacement: FIRST_REPLACER, SECOND_REPLACER or THIRD_REPLACER.

  • mutation: GENE or MULTI_GENE

  • characterModifier: (CHARACTER CLASS) + (character number)

  • mutationCriteria:

    • minHeight and maxHeight: interval of heights a character can have.
    • uniform: if the mutation is uniform or not (boolean).
    • probability: probability for uniform mutation.
    • minProbability and maxProbability: interval of probabilities for the non uniform mutation.
  • endCriteria:

    • type: MAX_GENERATIONS, STRUCTURE, CONTENT or LOCAL_OPTIMUM.
    • maxGenerations: max amount of generations to run for MAX_GENERATIONS end criteria.
    • contentK: max amount of generations without the best fitness changing for CONTENT end criteria.
    • structurePercentage: max percentage of the population that doesn't change for STRUCTURE end criteria.
    • expectedFitness: max fitness for LOCAL_OPTIMUM.
  • dataPath: path to the file containing the items' data.

  • replacementK: number of children created for repacement methods 2 and 3.

  • populationSize: amount of individuals per generation.

  • A and B: percentages for selection.

  • boltzmannTemperature: staring temperature for the BOLTZMANN selection.

  • turnamentProbability: if the TOURNAMENT selection is deterministic (false) or probabilistic (true).

  • tournamentPlayerSize: amount of characters compared simultaneously for the TOURNAMENT selection.

  • deterministic: if true, uses prefixed seed for random operations.

player-build-optimizer-genetic-algorithm's People

Contributors

sebasfavaron avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.