Virtual Bumblebees Artificial Life Simulation
Virtual Bumblebees Artificial Life Simulation - Published in JOSS (2017)
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.3%) to scientific vocabulary
Keywords
Repository
Virtual Bumblebees
Basic Info
- Host: GitHub
- Owner: k3jph
- License: mit
- Language: JavaScript
- Default Branch: master
- Homepage: https://k3jph.github.io/bumblebees/
- Size: 41 KB
Statistics
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md
Virtual Bumblebees
This project provides a simple environment for modeling an artificial life construct called the Virtual Bumblebees. The Virtual Bumblebees is a two-dimensional cellular automaton where the full board updates each time step based on the prior board state and a limited list of rules.
Motivation
Artificial life uses information concepts and computer modeling to study life in general, and terrestrial life in particular. It aims to explain particular vital phenomena, ranging from the origin of biochemical metabolisms to the coevolution of behavioral strategies, and also the abstract properties of life as such (“life as it could be”). In the case of the Virtual Bumblebees, it is a cellular automaton, the most famous of which is Conway's "Game of Life," first made popular by Gardner[1].
The Virtual Bumblebees is derived from an ambiguous phrasing by Levy[2] describing Langton's virtual ant (or vant):
The vant itself was a V-shaped construct that moved in the direction of its point. If the lead cell moved into a blank square on the imaginary grid, the vant continued moving in that direction. If the square was blue, the vant turned right and changed the color of that cell to yellow. If the square was yellow, the vant turned left and changed the color of the square to blue.
Originally, Langton intended a different ruleset for the virtual ant[3]:
Vants reside in an environment that consists of uniformly spaced, fixed cells that are in one of two states (either blue or yellow in the following figures). A vant travels in a straight line in empty space. If it encounters a blue cell, it turns right and leaves the cell colored yellow. If it encounters a yellow cell, it turns left and leaves the cell colored blue.
This project implement's a different ruleset, derived from Levy, to understand the implications and differences from the Langton Ant.
Virtual Bumblebees Ruleset, Defined
- At a red dot, turn 90 degrees to the right, turn the dot blue, and
move forward one cell;
- At a blue dot, turn 90 degrees to left, turn the dot red, and move forward one cell; and
- At an empty square, move forward one cell.
Usage
The Simulator
The simulator starts running, but with a blank state. Clicking anywhere in the simulation field, the black area, creates a "bee." Each bee has a two part state. The first part is its location. The location set to the click's location. The second part of the state is a direction vector, one of up, down, left, or right. Unless changed, the initial direction is up. Note that as soon as a bee is created, it starts moving as the simulation is already running.
On the left-hand side of the screen is a collapsable menu. There are seven radio buttons that control what is placed when the user click's in the simulation field:
- an up bee: A bee with an initial direction of upwards,
- a right bee: A bee with an initial direction of rightwards,
- a down bee: A bee with an initial direction of downwards,
- a left bee: A bee with an initial direction of leftwards,
- a red dot: Changes the cell's color from it's current state to red,
- a blue dot: Changes the cell's color from it's current state to blue, and
- clear the cell: Clears the cell of any state or bee.
Changing the radio button immediately changes what is placed in the simulation field with the next click.
Addition Controls
Beyond the basic controls, there are additional controls to support the user's exploration of the environment.
- Speed: Controls the speed of the simulation on a scale from 1 to 100 The initial value is 10.
- Size: Controls the size of each cell. Larger cells fit fewer in the simulation field and the simulation field is limited to the window size. The sizes range from 1 to 50 with an initial value of 40. The simulator must be reset before a size change takes effect.
- Reset: Resets the simulator. However, the settings are not changed.
- Stop: Stops the simulation. All objects' states are frozen.
- Clear: Clears all objects from the simulation field.
- Start: Starts the simulation.
Installation
The Virtual Bumblebees program runs as a set of CSS and Javascript
files. While they can be served from a webserver, it is not necessary
and no special installation is necessary. Loading the index.html
file in a browser is sufficient to start the application.
Contribution guidelines
- The central repository for Virtual Bumblebees is located on GitHub
- Use GitFlow,
Vincent Driessen's Git branching model
- The
masterbranch is automatically deployed to a Heroku instance located at http://bumblebees.jameshoward.us - Technical support and problem reports should both be addressed through the GitHub repository
- The
Basic Architecture
Internally, the implementation is a simple HTML file that establishes the board. The majority of the application's implementation is handled through associated Javascript and CSS files. The simulation field is stored as an m × n array with three potential values:
- 0x00: A clear cell,
- 0x10: A red cell, and
- 0x11: A blue cell.
Bees are kept in a separate array of k elements listing the bee's state. The location is stored as the x and y coordinates of the bee. The bee's direction vector is one of four states:
- 0x20: Upwards,
- 0x21: Rightwards,
- 0x22: Downwards, and
- 0x23: Leftwards.
Architectural Implications
There are two critical implications to this architecture. First, two bees may coexist simultaneously the same cell. This simplifies the update step significantly if the bees do not bump into each other and simply move along together.
Second, the simulation state does not update atomically. The simulation state is updated for each bee, sequentially. This is largely a nonissue as a cell's state does not change unless a bee force's it to change. It also solves the semantic problem of two bees reaching the same colored cell in the same time step. When that happens, the first bee will flip the color and departs the cell. When the second bee is processed, it flips the color back and departs the cell.
Additional Implementation Notes
The implementation of Virtual Bumblebees is based on Ross Scrivener's implementation of the Langton Ant[4], available in Javascript from Scrivener's website. The existing implemented is revised and generalized to implement the Virtual Bumblebees.
There is a .htaccess file that directs a Heroku-based PHP server to
direct the server to treat index.html as the preferred index file.
Finally, the empty index.php file triggers a PHP-based environment
on Heroku.
References
- M. Gardner, Mathematical games: The fantastic combinations of John Conway’s new solitaire game “Life”. Sci. Am. 223, 120-123 (1970).
- S. Levy, Artificial Life: A Report from the Frontier Where Computers Meet Biology (Pantheon Books, New York, 1992), pp. 104.
- C. G. Langton, Studying artificial life with cellular automata. Physica D. 22, 120-149 (1986).
- R. Scrivener, Langton's Ants - in Javascript. (2012).
Owner
- Name: Dr James P. Howard, II
- Login: k3jph
- Kind: organization
- Location: United States of America
- Website: https://jameshoward.us
- Twitter: k3jph
- Repositories: 29
- Profile: https://github.com/k3jph
A Mathematician, a Different Kind of Mathematician, and a Statistician
GitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| James P. Howard, II | jh@j****s | 34 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0