Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyparadiseo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyparadiseo

Python version of the ParadisEO framework for metaheuristic optimization

  • 0.5
  • PyPI
  • Socket score

Maintainers
1

pipeline status

For the documentation of PyParadiseo see this.

This README only gives a very short introduction.

Table of Contents

Installation

The easiest way to get pyparadiseo is to install it via pip. Currently the following Python versions are supported: 3.6, 3.7, 3.8, 3.9, 3.10

You can install pyParadiseo with pip

    pip install pyparadiseo

2) Build from source

To build pyParadiseo, you'll need to have a few prerequisites installed on your system and set the corresponding paths in setup.py and CMakeLists.txt

To compile the binary extension you need:

  • cmake >= 3.14
  • python3 >= 3.6
  • boost-python
  • boost-numpy

If you want to build pyparadiseo from source, the easiest should be to use this manylinux2014_x86_64 Docker image with installed prerequisites.

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 config

# problem dependent
from pyparadiseo import population
from pyparadiseo import initializer
from pyparadiseo import evaluator
from pyparadiseo import operator

from pyparadiseo.eo import algo,select_one,continuator

DIM=20
POP_SIZE=25
MAX_GEN=100

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

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

    #generate and evaluate population
    pop=population.from_init(POP_SIZE,initializer.random(DIM))
    evaluator.pop_eval_from_fitness(eval)(pop,pop)

    #assemble simple GA
    sga = algo.simpleGA(
        select_one.det_tournament(4),
        operator.OnePtBitCrossover(),.1,
        operator.DetBitFlip(),.7,
        eval,
        continuator.max_generations(MAX_GEN)
    )
    # #run algo on pop and print best individual
    sga(pop)
    print(pop.best())

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc