Skip to main content

cgpy

A Python library for Cartesian genetic programming.

Unit tests

Run python -m unittest discover -v in the root folder.

Getting Started

Install the package using pip pip install cgpy

The following code creates a random CGP and evaluates its function

op_table = [Operation("+"), Operation("*"), Operation("sin")]

dims = 2
nr_of_parameters = 0
nr_of_nodes = 5
cgp = create_random_cgp(dims, nr_of_parameters, op_table, nr_of_nodes)

pnt = [0.5, 1.5]
print(cgp.eval(pnt))

See more examples in the example folder and the documentation at www.cgpy.org

Cgpy is developed by Viktor Wase with contributions and assistance from John Brynte Turesson and Johannes Wennberg.

Release files for cgpy 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cgpy 0.0.6
File Size Uploaded
cgpy-0.0.6.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cgpy 0.0.6
File Interpreter ABI Platform
cgpy-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 20.6 kB

Release files / cgpy-0.0.6.tar.gz

Download URL cgpy-0.0.6.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f3ac65b5c40abc4f73e887b676f0bcbcecea250fac9b3334ab295f0a2108b404
BLAKE2b-256 checksum
How to use checksums
4fbfec73343c0767ee8e1283a11745821c3cd440b4e743933a886b2b831aa79f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.7

Release files / cgpy-0.0.6-py3-none-any.whl

Download URL cgpy-0.0.6-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67c0ab4eef2cfd06005d7c13c0908f1374db3277e864170646d2bee81c258c39
BLAKE2b-256 checksum
How to use checksums
4d6818058034b575c8f0fa8434977fedc69bfa869068449205178fb158c1d1db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.7

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page