Git Product home page Git Product logo

wireworld's Introduction

WireWorld

This program is designed to run the cellular automata WireWorld. The class 'World' is designed to be flexible enough to run different kinds of cellular automata.

I have chosen to represent the state of the 'world' by a dictionary with coordinates as keys and states as the values. This choice is particularly suitable to the wireworld cellular automata because it has a stable 0 state. By this, I mean that a cell with state 0 will remain in state 0. It is therefore not necessary to update these cells, the important cells are all non-zero. By ommiting the coordinates with state 0 from the dictionary, the program becomes much more scalable for sparse worlds spread over a large area. For example, a wire running along the perimeter of an otherwise empty square of size n will run at, and use O(n) space rather than O(n^2).

A weaker version of this 0 stability property holds for other cellular automata such as John Conway's game of life or Langtons ant. In these, a cell in state 0 surrounded by cells in state 0 will remain in state 0. For such cellular automata, it is only necessary to update non-zero cells and cells immediately adjacent to non-zero cells. In such cases, world.mode is set to semistable and the world.pad() method will create the adjacent 0 cells with the setdefault method and remove 0 cells with the world.trim() method after updating.

wireworld's People

Contributors

stephenworsley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.