alan-turing-institute / p2lab-pokemon

A Python library for running genetic algorithms to optimize Pokemon teams!
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link
genetic-algorithms pokemon python showdown

p2lab logo

GitHub Workflow Status

An interface for optimising Pokémon teams using genetic algorithms!

Installation

git clone git@github.com:alan-turing-institute/p2lab-pokemon.git
cd p2lab-pokemon
git submodule update --init --recursive
git clone git@github.com:smogon/pokemon-showdown.git
cd poke-env
pip install -e .
cd ..
pip install -e .
cd pokemon-showdown
npm install  # -g flag sometimes solved problems on our machines
cd ..

Running

To run locally start the pokemon showdown server:

node pokemon-showdown start --no-security

In another terminal, from this project's root directory run:

p2lab <args>

Additional arguments for p2lab

usage: p2lab [-h] [--generations GENERATIONS]
             [--team-size TEAM_SIZE] [--teams TEAMS]
             [--seed SEED] [--unique UNIQUE]

options:
  -h, --help            show this help message and
                        exit
  --generations GENERATIONS
                        Number of generations to
                        iterate over
  --team-size TEAM_SIZE
                        Number of pokemon per team
                        (max 6)
  --teams TEAMS         Number of teams i.e.,
                        individuals per generation
  --seed SEED           Random seed to use
  --unique UNIQUE       Determines if a team can have
                        duplicate pokemon species

Docker:

Alternatively, using docker: docker build -t p2:latest . docker run -it p2:latest docker exec -it your_container_id /bin/bash

Run docker build with --no-cache to rebuild with newer versions of the repos.

Components used

Pokemon showdown engine:

smogon/pokemon-showdown

Poke-env