Skip to main content

Python of the ParadisEO framework for heuristic optimization

Project description

pipeline status

Table of Contents

Installation

You can install pyParadiseo with pip

pip install pyparadiseo

Getting Started

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

# problem dependent
from pyparadiseo import Pop
from pyparadiseo.evaluator import FitnessEval,PopLoopEval
# encoding dependent
from pyparadiseo.initializer import BinaryInit
from pyparadiseo.operator import OnePtBitCrossover,DetBitFlip
# independent
from pyparadiseo.eo import algo,selector,continuator

import numpy as np

if __name__ == "__main__":
    #make pyparadiseo evaluator from python function
    eval = FitnessEval(lambda sol: np.count_nonzero(sol))
    #generate and evaluate population
    pop = Pop(25, BinaryInit(20))
    PopLoopEval(eval)(pop,pop)
    #assemble simple GA
    sga = algo.SGA(
        selector.DetTournamentSelect(),
        OnePtBitCrossover(),.2,
        DetBitFlip(),.6,
        eval,
        continuator.GenContinue(100)
    )
    #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.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pyparadiseo-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pyparadiseo-0.2.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.2.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view hashes)

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

pyparadiseo-0.2.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 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