Skip to main content

This package contains several tools for quickly setting up worlds and agents for Grammatical Evolution Projects.

Project description

Grammatical Evolution Tools

Python Version Version GitHub License Documentation Tests


Table of Contents


Introduction

GrammaticalEvolutionTools is a Python package designed to simplify the setup and execution of Grammatical Evolution (GE) and other Agent-Based Modeling (ABM) projects. It provides a suite of tools for quickly spinning up worlds, defining grammars, setting up agents, and running and animating simulations. It includes a number of abstract classes you can easily inherit from and customize, with much of the underlying functionality already implemented.

Whether you're building complex simulation environments or simple test cases, getools streamlines the boilerplate, enabling faster iteration and more effective research in grammatical evolution.

Note: This project is still in development. Code has been refactored and not all docstrings may reflect this yet.

Features

Currently Available:

  • World Environment Setup: Easily define and configure custom environments for GE agents.
  • Grammar Definition: Inherit from common classes to create custom grammars with specific functionalities.
  • Agent Management: Logic for running Agent programs and having them interact with their world.
  • Evolution: Common methods for cross over and mutation, built to work with program trees.
  • Animation: Create customizable animations for simulations.

Coming Soon:

  • Asynchronous Behavior Trees!

Installation

Since this package is not yet published to PyPI, you will need to clone the repository and install it locally.

Prerequisites

This project uses Poetry for dependency management and packaging. Before installing the package, ensure you have Poetry installed on your system.

The recommended way to install Poetry is using pipx, which installs Python applications in isolated environments.

# 1. Install pipx (if you don't have it)
python -m pip install --user pipx
python -m pipx ensurepath

# 2. Install Poetry using pipx
pipx install poetry

You can find more detailed installation instructions for Poetry on their official website: Poetry Installation Guide

Core Package

To install the core package with only its essential dependencies (for integrating it into your own projects):

# Clone the repository first
git clone [https://github.com/n-smith-byu/getools.git](https://github.com/n-smith-byu/GrammaticalEvolutionTools.git)
cd getools

# Install the core package in editable mode
poetry install

To Run Notebooks and Examples

If you plan to explore the provided examples or run the Jupyter notebooks, you'll need to install the package with the examples dependency group.

# If you haven't already, clone the repository and navigate into it
# git clone [https://github.com/n-smith-byu/getools.git](https://github.com/n-smith-byu/GrammaticalEvolutionTools.git)
# cd getools

# Install the package with examples dependencies
poetry install --with examples

For Development

If you intend to modify the code, run tests, or build the documentation, install with the dev dependency group.

# If you haven't already, clone the repository and navigate into it
# git clone [https://github.com/n-smith-byu/getools.git](https://github.com/n-smith-byu/GrammaticalEvolutionTools.git)
# cd getools

# Install in editable mode with dev dependencies
poetry install --with dev

Examples

The examples/ directory in this repository contains various Jupyter notebooks and scripts demonstrating how to use getools for different scenarios.

To run these examples, make sure you have installed the package with the examples dependency group:

# Ensure you are in the project root directory
cd examples/
jupyter lab # or jupyter notebook

Examples include an implementation of the Santa Fe problem and a basic grammatical evolution algorithm.


Running Tests

NOTE: Incomplete

If you are developing the package, you can run the test suite using pytest. Ensure you have installed the dev dependencies.

# From the project root directory
pytest

Documentation

NOTE: Incomplete

The project's documentation is built using Sphinx. To generate the HTML documentation locally, ensure you have installed the dev dependencies.

First, navigate to the docs/ directory from the project root:

cd docs/

Then, run the appropriate command for your operating system:

For Linux / macOS / WSL:

make html

For Windows (Command Prompt / PowerShell):

poetry run sphinx-build -b html . _build/html

The generated HTML documentation will be located in docs/_build/html/index.html. You can open this file in your web browser to view the documentation.


License

This project is licensed under the MIT License.


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

grammaticalevolutiontools-1.1.0a1.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

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

grammaticalevolutiontools-1.1.0a1-py3-none-any.whl (71.1 kB view details)

Uploaded Python 3

File details

Details for the file grammaticalevolutiontools-1.1.0a1.tar.gz.

File metadata

File hashes

Hashes for grammaticalevolutiontools-1.1.0a1.tar.gz
Algorithm Hash digest
SHA256 4661bc993ce569634e3122102dd77272feedaa25447a442f9406aef4eb0601bb
MD5 06911a41851f6ea5332bd575c3b2d21c
BLAKE2b-256 3d7584193b2fce126c9d242928da117dab6e84ebcdb9348d6cbee7c2c2f13826

See more details on using hashes here.

Provenance

The following attestation bundles were made for grammaticalevolutiontools-1.1.0a1.tar.gz:

Publisher: python-publish.yml on n-smith-byu/GrammaticalEvolutionTools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file grammaticalevolutiontools-1.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for grammaticalevolutiontools-1.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd86de61887f4d4b163e3823d9789884c119f8bd4c67f11bebc4fb74f463ca5a
MD5 5d12d53eceaa77885884025c6d5ea2b4
BLAKE2b-256 4bd0defaf32207b386dc23f1941981a1328a1ad27b8ac4fc53dcb3ab214a580f

See more details on using hashes here.

Provenance

The following attestation bundles were made for grammaticalevolutiontools-1.1.0a1-py3-none-any.whl:

Publisher: python-publish.yml on n-smith-byu/GrammaticalEvolutionTools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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