A collection of libraries for interfacing simulators with the Bonsai platform.
Перейти к файлу
Juan Vergara def34959ea Add test_scenarios to Lunar Lander
File needed for local debugging of exported brains & programmed policies
2022-11-30 17:38:17 -08:00
CSharp update c# cartpole readme 2021-12-13 10:57:59 -05:00
Java Merge pull request #14 from microsoft/dependabot/maven/Java/tests/junit-junit-4.13.1 2022-05-19 10:57:08 -04:00
Python Add test_scenarios to Lunar Lander 2022-11-30 17:38:17 -08:00
Reference
Typescript Merge pull request #54 from microsoft/dependabot/npm_and_yarn/Typescript/samples/adder/glob-parent-5.1.2 2022-05-19 10:56:46 -04:00
managed-simulator-offer add link to managed simulator offer docs on learn.microsoft.com 2022-10-18 17:31:10 -07:00
.gitignore
.gitmodules
CONTRIBUTING.md
LICENSE.txt
README.md Update README.md 2022-01-27 11:09:12 -08:00
SECURITY.md

README.md

Bonsai Platform API

This folder contains support libraries for connecting to the Bonsai Azure Service.

Microsoft Open Source Code of Conduct

This repository is subject to the Microsoft Open Source Code of Conduct.

Contributing Samples

Please read the Microsoft contributing guidelines.

Submit a PR adding a brief description of the code you wish to be included and add an appropriate hyperlink to the sample code section. If the sample you wish to code is small and self contained it can be added to the samples directory for the language it is written. For example Python samples can be found in Python/samples.

Sample Code

Samples that show how to use microsoft-bonsai-api and connect with the Bonsai platform.

Python

cartpole - Classic CartPole simulator in Python. Balancing an inverted pendulum on a moving cart.

gym-highway - Make decisions to speed up, slow down, change lanes, etc with a multi-lane highway. This sample uses arrays in Inkling for states and demonstrates usage of using an element of the array in the reward.

house-energy - Control the temperature inside of a house according to the desired set temperatures just like a thermostat.

microgrid - Control a local energy grid to meet the load by charging or discharging the battery, importing or exporting energy from the traditional grid, and consuming generated PV power.

plastic-extrusion - Control a plastic extruder to optimize production of PVC rods with a specified length and tolerance.

quanser-qube - Simulation of the real hardware, academic learning tool: Quanser Qube. Swing Up and Balancing an inverted pendulum with a rotary base.

simple-adder - A minimal working example of a Python simulator that can be connected to Bonsai and used to train a brain. You can think of it as Project Bonsai's "Hello World".

C#

cartpole - Classic CartPole simulator in C#. Balancing an inverted pendulum on a moving cart.

Java

cartpole - Classic CartPole simulator in Java. Balancing an inverted pendulum on a moving cart.

Typescript

adder - Simple simulator that adds numbers and computes a reward based on the result.

Other Bonsai repositories

bonsai-common - A Python framework for interfacing with the bonsai platform.

bonsai-sim-connector-template - A template for creating Bonsai Connectors. It can serve as a starting point for making a simulation platform work with Bonsai.

moabsim-py - Simulator for balancing a ball on a plate, based on hardware. Tutorial 2 is meant for deployment. Additional Inkling samples can be found in /Machine-Teaching-Examples.

Simulator Integration Checklist & Best Practices

  • Make sure workspace is registered & correct.
  • Error handling: Any cloud service can have transient errors and our SDK have Retry policy in place, but not all errors can be retried, so a good error handling logic will make your sim sessions more robust. Please check cartpole sim sample, for the hints.
  • Make sure there is a Re-Register (Re create sim session), in the error handling logic, when you are unregistering or deleting sim. To make sure, sim will keep running.
  • Enable verbose SDK logging: If you are hitting issues. Enable logging in BonsaiClientConfig. And set the right LogLevel to get more information.
  • For hosted sim, You can also enable Sim logging for Episodes, iterations and system log, using our CLI commands (1, 2) for start-training and start-logging. These logs will go to Log Analytics workspace.