Giter Club home page Giter Club logo

sia's Introduction

sia

TP3

Archer3

Requirements

Python3.6 is required to run the project.

Matplotlib dependency is required as well. Installation:

pip3 install -r requirements.txt

If pip3 fails try with pip3.6 or python3.6 -m pip install -r requirements.txt. Finally, if an error of python3-tk package if missing occurs, execute python3.6 -m pip install python3.6-tk.

Items

Inside the Items directory the test (10 items) items may be found. They may be replaced by the fulldata items data set or any other desired.

How to run

Set the desired params in config.json and:

python3 main.py

If python3 fails, try with python or python3.6 depending on your installation. When the search finishes it is possible to edit config.json and run the search again with the new params, avoiding having to load the items all over again.

Config

  • soldier: (warrior1 | warrior2 | warrior3 | archer1 | ...)
  • N: amount of individuals per generation
  • selectors: array which corresponds to selector methods 1 and 2 for the selection phase, and selector method 3 and 4 for the replacement phase. Selection methods: (elite | random | roulette | universal | boltzmann | tournament_det | tournament_prob | ranking)
  • A: percentage (0.0 <= x <= 1.0) of individuals selected by method 1. Method 2 percentage would be (1 - A).
  • B: percentage of individuals selected by method 3. Method 4 percentage would be (1 - B).
  • select_params.m: tournament_det m parameter for the selection phase.
  • replace_params.m: tournament_det m parameter for the replacement phase.
  • pairs: (random | roulette)
  • crossover: (one_point | two_point | anular | uniform)
  • cross_prob: probability of crossing each selected pair
  • replacer: (select_parents | select_total). Note select_parents corresponds to replacement method 2 and select_total to method 3. If generation gap is 1.0, method 2 would behave as method 1.
  • mutate_prob: mutation probability. If the mutation probability is NOT uniform, this corresponds to the initial mutation probability or the maximum mutation probability, depending on increasing_mutation.
  • uniform_mutate: (true | false). If true mutation probability does not change.
  • increasing_mutation: (true | false). If true, mutation probability scales up from 0 to a maximum of mutate_prob. If false it scales down from mutate_prob to 0.
  • generation_gap: generation gap.
  • should_continue: cut condition. (generations | target_fitness | content | structure)
  • cut_conditions: params for each cut condition.
  • max_generations: amount of generations to execute for cut condition generations.
  • target_fitness: fitness to achieve for cut condition target_fitness.
  • content_pct_difference: percentage max fitness that must change before max_content_steps generations for cut condition content.
  • max_content_steps: amount of generations max fitness may not change before content cut condition becomes true.
  • population_pct_change: percentage of population that must change for max_structure_steps generations for cut condition structure.
  • max_structure_steps: amount of generations population may not change before structure cut condition becomes true.
  • seed: random seed.
  • realtime: plot realtime (true | false)
  • refresher: period of generations for plotting if plotting realtime true.

Code Organization

Inside the Engine directory implementations for each stage of the algorithm may be found and the core flow may be found in Engine/GeneticAlgorithm.py.

Inside the Problem directory implementations for each soldier may be found. The core class corresponds to Soldier.py which receives the multipliers corresponding to each soldier type. Important to notice that the mutate functions from ItemGen.py and HeightGen.py are immutable.

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.