Skip to main content

A computational intelligence library for Python.

Project description

cilpy logo

cilpy: A Computational Intelligence Library for Python.

PyPI Version License: MIT


cilpy is a Python library for computational intelligence, with a focus on nature-inspired optimization algorithms. It provides a flexible and extensible framework for researchers and practitioners to experiment with various optimization problems, including constrained, multi-objective, and many- objective optimization.

cilpy is structured into distinct components for problem generation (cilpy.problem), solving (cilpy.solver), and algorithm comparison (cilpy.compare). Users can easily introduce new problems or solvers by implementing the provided abstract interfaces. These interfaces were designed with the ability to solve a wide variety of optimization problems in mind, including:

  • Single and multi-objective optimization
  • Constrained and unconstrained problems
  • Static and dynamic optimization problems

Installing cilpy

cilpy can be installed using pip:

pip install cilpy

Usage Example

Here is a basic pseudocode example of how to set up and run an experiment with cilpy. This demonstrates how to define a problem, configure a solver, and use the ExperimentRunner (which orchestrates interaction between the problem and the solver) to execute the optimization task.

from cilpy.runner import ExperimentRunner
from cilpy.problem import SomeProblem
from cilpy.solver import SomeSolver

# --- 1. Define the Problems ---
dim = 3
dom = (-5.12, 5.12)
problems_to_run = [
    SomeProblem(dimension=dim, domain=dom)
]

# --- 2. Define the Solvers and their parameters ---
# Note: Although the `solver` interface requires the `problem` to be specified
# during solver initialization, it is omitted here as the runner will assign it.
solver_configs = [
    {
        "class": SomeSolver,
        "params": {
            "name": "MySolver",
            # Other solver parameters
        }
    },
]

# --- 3. Define the Experiment parameters ---
number_of_runs = 30 # how many times an experiment should be repeated
max_iter = 5000     # how many iterations per experiment

# --- 4. Create and run the experiments ---
runner = ExperimentRunner(
    problems=problems_to_run,
    solver_configurations=solver_configs,
    num_runs=number_of_runs,
    max_iterations=max_iter
)
runner.run_experiments()

See examples for actual examples of how cilpy is used.

Documentation

The full documentation can be found in the docs/ folder and can be served locally:

mkdocs serve

Contributing

We welcome contributions to cilpy! If you are interested in contributing, please read our contributing guidelines for details on our code of conduct and the process for submitting pull requests.

Project details


Download files

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

Source Distribution

cilpy-0.0.2.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cilpy-0.0.2-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file cilpy-0.0.2.tar.gz.

File metadata

  • Download URL: cilpy-0.0.2.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for cilpy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 284a8fa0bb953976cec7d912b245da2d23106a37ebcb9258ada1014c08ce6124
MD5 74751e382a3dd74b87c5a2fc9ad83f3b
BLAKE2b-256 4dc6f39db0a62ed7c6c421097815536da17aae2797850de61e3711629d80d2a2

See more details on using hashes here.

File details

Details for the file cilpy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: cilpy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for cilpy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6bbe7666463108f20a454684f181b282be622326cc32d256e119e0f1b2c2e83d
MD5 05264b650af239a7cd4d139076119426
BLAKE2b-256 34f1d1947b564fb287da326cd9984343b9253c83b6c457bfc9b7ef1272704000

See more details on using hashes here.

Supported by

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