Skip to main content

Python version of the ParadisEO framework for metaheuristic optimization

Project description

pipeline status

Table of Contents

Installation

For now, PyParadiseo is only available for Python 3.6. You can install PyParadiseo with pip

pip install pyparadiseo

Getting Started

The documentation of PyParadiseo is available here

Example of running EO's simple GA (SGA) for the One-Max test problem

from pyparadiseo import Pop
from pyparadiseo.evaluator import FitnessEval,PopLoopEval

from pyparadiseo import evaluator
from pyparadiseo import operator
from pyparadiseo import population
from pyparadiseo import initializer

from pyparadiseo.eo import algo,select_one,continuator

import numpy as np

if __name__ == "__main__":
    #set solution type globally
    config.set_solution_type('bin')

    #make pyparadiseo evaluator from python function
    eval = evaluator.fitness(lambda sol: np.count_nonzero(sol))

    #generate and evaluate population
    init = initializer.random(size=20)
    pop = population.from_init(25, init)
    pop_eval=evaluator.pop_eval_from_fitness(eval)
    pop_eval(pop,pop)

    #assemble simple GA
    sga = algo.simpleGA(
        select_one.det_tournament(4),
        operator.OnePtBitCrossover(),.1,
        operator.DetBitFlip(),.7,
        eval,
        continuator.max_generations(self.NGENS)
    )

    #run algo on pop and print best individual
    sga(pop)
    print(pop.best())

Components

  • EO (Population-based single-objective)
  • MO (Trajectory-based single-objective)
  • MOEO (Multi-objective)
  • Encodings : Binary, Integer, Real, Permutation, Custom
  • Genetic Operators : ...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyparadiseo-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyparadiseo-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyparadiseo-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pyparadiseo-0.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pyparadiseo-0.3.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.9 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page