{"id":26361241,"url":"https://github.com/k3jph/bumblebees","last_synced_at":"2025-07-25T00:40:10.734Z","repository":{"id":28697157,"uuid":"32217425","full_name":"k3jph/bumblebees","owner":"k3jph","description":"Virtual Bumblebees","archived":false,"fork":false,"pushed_at":"2017-05-10T11:36:53.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-10T21:34:02.299Z","etag":null,"topics":["agent-based-modeling","artificial-life","simulation","virtual-ants"],"latest_commit_sha":null,"homepage":"https://k3jph.github.io/bumblebees/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/k3jph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-14T15:05:30.000Z","updated_at":"2022-11-03T22:44:10.000Z","dependencies_parsed_at":"2022-08-29T01:11:19.468Z","dependency_job_id":null,"html_url":"https://github.com/k3jph/bumblebees","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k3jph%2Fbumblebees","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k3jph%2Fbumblebees/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k3jph%2Fbumblebees/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k3jph%2Fbumblebees/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k3jph","download_url":"https://codeload.github.com/k3jph/bumblebees/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243908732,"owners_count":20367457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-based-modeling","artificial-life","simulation","virtual-ants"],"created_at":"2025-03-16T17:35:04.613Z","updated_at":"2025-03-16T17:37:34.645Z","avatar_url":"https://github.com/k3jph.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virtual Bumblebees\n\nThis project provides a simple environment for modeling an artificial\nlife construct called the _Virtual Bumblebees_.  The _Virtual\nBumblebees_ is a two-dimensional cellular automaton where the full board\nupdates each time step based on the prior board state and a limited list\nof rules.\n\n## Motivation\n\nArtificial life uses information concepts and computer modeling to study\nlife in general, and terrestrial life in particular.  It aims to explain\nparticular vital phenomena, ranging from the origin of biochemical\nmetabolisms to the coevolution of behavioral strategies, and also the\nabstract properties of life as such (“life as it could be”).  In the\ncase of the _Virtual Bumblebees_, it is a cellular automaton, the most\nfamous of which is Conway's \"Game of Life,\" first made popular by\nGardner[1].\n\nThe _Virtual Bumblebees_ is derived from an ambiguous phrasing by\nLevy[2] describing Langton's virtual ant (or vant):\n\n\u003e The vant itself was a V-shaped construct that moved in the direction\n  of its point. If the lead cell moved into a blank square on the\n  imaginary grid, the vant continued moving in that direction. If the\n  square was blue, the vant turned right and changed the color of that\n  cell to yellow. If the square was yellow, the vant turned left and\n  changed the color of the square to blue.\n\nOriginally, Langton intended a different ruleset for the virtual ant[3]:\n\n\u003e Vants reside in an environment that consists of uniformly spaced,\n  fixed cells that are in one of two states (either blue or yellow in\n  the following figures). A vant travels in a straight line in empty\n  space. If it encounters a blue cell, it turns right and leaves the\n  cell colored yellow. If it encounters a yellow cell, it turns left and\n  leaves the cell colored blue.\n\nThis project implement's a different ruleset, derived from Levy, to\nunderstand the implications and differences from the Langton Ant.\n\n### _Virtual Bumblebees_ Ruleset, Defined\n\n1. At a red dot, turn 90 degrees to the right, turn the dot blue, and\n   move forward one cell;   \n2. At a blue dot, turn 90 degrees to left, turn the dot red, and move\n   forward one cell; and\n3. At an empty square, move forward one cell.\n\n## Usage\n\n### The Simulator\n\nThe simulator starts running, but with a blank state.  Clicking anywhere\nin the simulation field, the black area, creates a \"bee.\"  Each bee has\na two part state.  The first part is its location.  The location set to\nthe click's location.  The second part of the state is a direction\nvector, one of up, down, left, or right.  Unless changed, the initial\ndirection is up.  Note that as soon as a bee is created, it starts\nmoving as the simulation is already running.\n\nOn the left-hand side of the screen is a collapsable menu.  There are\nseven radio buttons that control what is placed when the user click's in\nthe simulation field:\n\n1.  *an up bee*: A bee with an initial direction of upwards,\n2.  *a right bee*: A bee with an initial direction of rightwards,\n3.  *a down bee*: A bee with an initial direction of downwards,\n4.  *a left bee*: A bee with an initial direction of leftwards,\n5.  *a red dot*: Changes the cell's color from it's current state to\n    red,\n6.  *a blue dot*: Changes the cell's color from it's current state to\n    blue, and\n7.  *clear the cell*: Clears the cell of any state or bee.\n\nChanging the radio button immediately changes what is placed in the\nsimulation field with the next click.\n\n### Addition Controls\n\nBeyond the basic controls, there are additional controls to support the\nuser's exploration of the environment.\n\n1.  *Speed*: Controls the speed of the simulation on a scale from 1 to 100\n    The initial value is 10.\n2.  *Size*: Controls the size of each cell.  Larger cells fit fewer in the\n    simulation field and the simulation field is limited to the window\n    size.  The sizes range from 1 to 50 with an initial value of 40.\n    The simulator must be reset before a size change takes effect.\n3.  *Reset*: Resets the simulator.  However, the settings are not\n    changed.\n4.  *Stop*: Stops the simulation.  All objects' states are frozen.\n5.  *Clear*: Clears all objects from the simulation field.\n6.  *Start*: Starts the simulation.  \n\n### Installation\n\nThe _Virtual Bumblebees_ program runs as a set of CSS and Javascript\nfiles.  While they can be served from a webserver, it is not necessary\nand no special installation is necessary.  Loading the ``index.html``\nfile in a browser is sufficient to start the application.\n\n## Contribution guidelines\n\n* The central repository for _Virtual Bumblebees_ is [located on\n  GitHub](https://github.com/howardjp/bumblebees/issues)\n* Use [GitFlow](http://nvie.com/posts/a-successful-git-branching-model/),\n  Vincent Driessen's Git branching model\n    * The ``master`` branch is automatically deployed to a Heroku\n      instance located at\n      [http://bumblebees.jameshoward.us](http://bumblebees.jameshoward.us)\n\t* Technical support and problem reports should both be addressed\n      through the [GitHub repository](https://github.com/howardjp/bumblebees/issues)\n  \n\n### Basic Architecture\n\nInternally, the implementation is a simple HTML file that establishes\nthe board.  The majority of the application's implementation is handled\nthrough associated Javascript and CSS files.  The simulation field is\nstored as an _m_ × _n_ array with three potential values:\n\n1. *0x00*: A clear cell,\n2. *0x10*: A red cell, and\n3. *0x11*: A blue cell.\n\nBees are kept in a separate array of _k_ elements listing the bee's\nstate.  The location is stored as the _x_ and _y_ coordinates of the\nbee.  The bee's direction vector is one of four states:\n\n1. *0x20*: Upwards,\n2. *0x21*: Rightwards,\n3. *0x22*: Downwards, and\n4. *0x23*: Leftwards.\n\n### Architectural Implications\n\nThere are two critical implications to this architecture. First, two\nbees may coexist simultaneously the same cell.  This simplifies the\nupdate step significantly if the bees do not bump into each other and\nsimply move along together.\n\nSecond, the simulation state does not update atomically.  The simulation\nstate is updated for each bee, sequentially.  This is largely a nonissue\nas a cell's state does not change unless a bee force's it to change.  It\nalso solves the semantic problem of two bees reaching the same colored\ncell in the same time step.  When that happens, the first bee will flip\nthe color and departs the cell.  When the second bee is processed, it\nflips the color back and departs the cell.\n\n### Additional Implementation Notes\n\nThe implementation of _Virtual Bumblebees_ is based on Ross Scrivener's\nimplementation of the Langton Ant[4], available in Javascript from\nScrivener's website.  The existing implemented is revised and\ngeneralized to implement the _Virtual Bumblebees_.\n\nThere is a ``.htaccess`` file that directs a Heroku-based PHP server to\ndirect the server to treat ``index.html`` as the preferred index file.\nFinally, the empty ``index.php`` file triggers a PHP-based environment\non Heroku.\n\n## References\n\n1. M. Gardner, Mathematical games: The fantastic combinations of John\n   Conway’s new solitaire game “Life”. _Sci. Am._ 223, 120-123 (1970).\n2. S. Levy, _Artificial Life: A Report from the Frontier Where Computers\n   Meet Biology_ (Pantheon Books, New York, 1992), pp. 104.\n3. C. G. Langton, Studying artificial life with cellular\n   automata. _Physica D._ 22, 120-149 (1986).\n4. R. Scrivener, Langton's Ants - in Javascript. (2012).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk3jph%2Fbumblebees","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk3jph%2Fbumblebees","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk3jph%2Fbumblebees/lists"}