All Projects → elbecerrasoto → gym-cellular-automata

elbecerrasoto / gym-cellular-automata

Licence: MIT license
Cellular Automata Environments for Reinforcement Learning

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to gym-cellular-automata

ton-lang
A visual programming language, evaluated as a cellular automaton
Stars: ✭ 60 (+400%)
Mutual labels:  cellular-automata
MetaGym
Collection of Reinforcement Learning / Meta Reinforcement Learning Environments.
Stars: ✭ 222 (+1750%)
Mutual labels:  gym-environments
PyGameofLife
Conway's Game of Life using python's matplotlib and numpy
Stars: ✭ 40 (+233.33%)
Mutual labels:  cellular-automata
webgpu-cca
Experiment implementation of Multiple Neighborhoods Cellular Automata using WebGPU
Stars: ✭ 31 (+158.33%)
Mutual labels:  cellular-automata
flocc
Agent-based modeling in JavaScript in the browser or on the server.
Stars: ✭ 26 (+116.67%)
Mutual labels:  cellular-automata
bark-ml
Gym environments and agents for autonomous driving.
Stars: ✭ 68 (+466.67%)
Mutual labels:  gym-environments
Roguelike-Procedual-Cave-Generator
A procedurally generated, cave-like dungeon/map creator for rogue-like games using the cellular automata method. During its development, I solved a common/limiting problem with this algorithm that might explain why it is not more commonly implemented in such games.
Stars: ✭ 26 (+116.67%)
Mutual labels:  cellular-automata
netomaton
A Python library for working with Network Automata, Cellular Automata, and other discrete dynamical systems
Stars: ✭ 38 (+216.67%)
Mutual labels:  cellular-automata
artistoo
CPM implementation in pure JavaScript
Stars: ✭ 25 (+108.33%)
Mutual labels:  cellular-automata
forma
A Lua toolkit for computational geometry on a grid
Stars: ✭ 34 (+183.33%)
Mutual labels:  cellular-automata
HCA saliency codes
Codes for HCA (Hierarchical Cellular Automata for Visual Saliency) accepted by IJCV 2018.
Stars: ✭ 18 (+50%)
Mutual labels:  cellular-automata
xentica
GPU-accelerated engine for multi-dimensional cellular automata
Stars: ✭ 29 (+141.67%)
Mutual labels:  cellular-automata
nutshell
[alpha!] [on hiatus] An advanced cellular-automaton-specification language that transpiles to Golly's.
Stars: ✭ 16 (+33.33%)
Mutual labels:  cellular-automata
cellular
A simple command-line tool that generates gif images and animations from elementary cellular automata
Stars: ✭ 28 (+133.33%)
Mutual labels:  cellular-automata
cas
Cellular Automata Simulator
Stars: ✭ 22 (+83.33%)
Mutual labels:  cellular-automata
ALPACA
A Language for the Pithy Articulation of Cellular Automata
Stars: ✭ 21 (+75%)
Mutual labels:  cellular-automata
sandbox
2D Pixel Physics Simulator
Stars: ✭ 76 (+533.33%)
Mutual labels:  cellular-automata
Growing-Neural-Cellular-Automata-Pytorch
Extended experiments of "Growing Neural Cellular Automata" https://distill.pub/2020/growing-ca/
Stars: ✭ 47 (+291.67%)
Mutual labels:  cellular-automata
terrame
TerraME is a programming environment for spatial dynamical modelling
Stars: ✭ 33 (+175%)
Mutual labels:  cellular-automata
cellular-automata-explorer
(WIP) An interactive web app for exploring cellular automata.
Stars: ✭ 18 (+50%)
Mutual labels:  cellular-automata

Gym Cellular Automata




Semantic Versioning MIT License Code style: black Gitmoji

Cellular Automata Environments for Reinforcement Learning


Gym Cellular Automata is a collection of Reinforcement Learning Environments (RLEs) that follow the OpenAI Gym API.

The available RLEs are based on Cellular Automata (CAs). On them an Agent interacts with a CA, by changing its cell states, in a attempt to drive the emergent properties of its grid.

Installation

git clone https://github.com/elbecerrasoto/gym-cellular-automata
pip install -e gym-cellular-automata

Usage

🎠 🎠 🎠

Prototype & Benchmark, the two modes of gymca...

import gym
import gym_cellular_automata as gymca

# benchmark mode
env_id = gymca.envs[0]
env = gym.make(env_id)

# prototype mode
ProtoEnv = gymca.prototypes[0]
env = ProtoEnv(nrows=42, ncols=42)

The tuple gymca.envs contains calling strings for gym.make.

gym.make generates an instance of a registered environment.

A registered environment is inflexible as it cannot be customized. This is on purpose, since the gym library is about benchmarking RL algorithms—a benchmark must not change if it wants to provide meaningful comparisons.

CA Envs are experimental—they need to mature into worth-solving RL tasks. For this to happen fast prototyping is needed. This involves parameter tweaking and module combination.

gym-cellular-automata strives to be an environment-design library, this is the motivation behind the prototype mode, which does not register the environment, but exposes it to configuration.

Grid size (nrows, ncols) is one of the most changed parameters so it is required. Other parameters are optional and differ from class to class. Grid size is a proxy for task difficulty, bigger grids are usually harder.

Random Policy

import gym
import gym_cellular_automata as gymca

env_id = gymca.envs[0]
gym.make(env_id)

obs = env.reset()

total_reward = 0.0
done = False
step = 0
threshold = 12

# Random Policy for at most "threshold" steps
while not done and step < threshold:
    action = env.action_space.sample()  # Your agent goes here!
    obs, reward, done, info = env.step(action)
    total_reward += reward
    step += 1

print(f"{env_id}")
print(f"Total Steps: {step}")
print(f"Total Reward: {total_reward}")

Gallery

Helicopter

Forest Fire Helicopter

Bulldozer

Forest Fire Bulldozer

Documentation

👷 Documentation is in progress.

Releases

🥁

Contributing

🌲 🔥

For contributions check contributing and the to do list.

Contributions to Gym Cellular Automata are always welcome. Feel free to open pull requests.

This project adheres to the following practices:

Issues

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].