Skip to main content

Simulator interface library for Bonsai AI platform v2

Project description

A python library for integrating data sources with Bonsai BRAIN.


To install the current release version:
$ pip install bonsai-ai


Clients will subclass bonsai.Simulator and implement the required methods.


#!/usr/bin/env python3

import sys
from bonsai_ai import Simulator, Brain, Config

class MySim(Simulator):
    def episode_start(self, parameters):
        initial = {"value": 1.0}
        return initial

    def simulate(self, action, objective):
        terminal = True
        state = {"value": 1.0}
        return (state, 1.0, terminal)

Then, the simulator is configured and assigned a BRAIN and run.

def example():
    config = Config(sys.argv)
    brain = Brain(config)
    sim = MySim(brain, 'example_simulator')

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
bonsai_ai-2.0.19-py2.py3-none-any.whl (36.4 kB) Copy SHA256 hash SHA256 Wheel py2.py3
bonsai-ai-2.0.19.tar.gz (28.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page