Hyperbolic Cellular Automata Simulator
This software is a simulator of cellular automata, acting on an regular tiling (grids) of the hyperbolic plane.
It supports arbitrary large configurations of cells, limited only by available memory.
The simulator is written in JavaScript (CoffeeScript actually) and works directly in the browser. It is an open software, sources are available on Github.
Features
Key features are:
- Support of arbitrary large configurations.
The field is unlimited in all directions. However, large number of cells slows down computations and requires large amount of memory. In practice, configurations of 50'000 cells are near to the upper limit. -
Support of arbitrary regular hyperbolic tilings.
Hyperbolic plane can be tiled by a regular N-gons, with M N-gons around every vertex, if and only if
$$ \frac1N+\frac1M < \frac12 $$ Simply put, any tiling that is impossible on plane or on sphere, is possible on hyperbolic plane. -
Search
Observable area of the hyperbolic plane is limited. Search feature allows to find all cell groups in the field.
The simulator also supports:
- Custom rules, with arbitrary number of states and rule code written in JavaScript.
- Export and import of cell configurations as text.
- Export SVG images
- Saving and loading experiments in the Indexed Database on the local machine.
- Loading data from URL arguments, and exporting experiment state as URLs
- Automatic generation of animation frames (available only if run locally).
Tilings and neighbors
Only Moore neighborhood scheme is supported. In the {N;M} tiling (M regular N-gons are touching every vertex), total number of neighbors of a cell is \(N(M-2)\).
Rules
For 2-state automata rules are specified in the slightly modified "BS" notation (used by Golly). The format is:
$$B\ n_1\ n_2\ ...\ S\ m_1\ m_2\ ...$$
where \(n_{1,2,...}\) are number of neighbors, required for cell to "born" (change from state 0 to state 1), and \(m_{1,2,...}\) are numbers of neighbors, required to "survive" (stay in state 1). Numbers must be separated by spaces because in hyperbolic tilings number of neighbors often exceeds 10.
To set rule, edit the "Rule" field on a side pane, then press enter or click button
.Custom rules
Custom rules are written in JavaScript. They support arbitrary number of states, and custom formulas for calculation of neighbors sum (default is summation).
To change to the custom rule mode, click button
near the rule entry. Current rule would be converted to the custom rules code.Custom rules format
Custom rules must be a valid JS code, evaluated in expression context to an object with the following required fields:
- 'states' :: Integer
Number of states, must be 2 or more. - 'next' :: Function(State, SumStates) → State
Takes current state and sum of neighbors, and returns new state.
- 'plus' :: Function(SumStates, State) → SumStates
Summation function that takes incomplete sum of states and add new state to it. Default isfunction(s,x){ return s+x; }
- 'plusInitial' :: SumStates
Initial sum of states for sum calculation. Default is 0.
Editing and navigation
By default (when
button above view is active), left mouse button is used to pan view, middle button or left + shift are used to toggle state of a cell. This behavior is inverted by activating button on the top of the view.When panning view, dragging near view center translates view, and dragging near view edge rotates it.
Button
puts central cell exactly to the center of the view and rotates view to make the cell aligned vertically or horizontally. (Useful for making images and animations).Memory
There is no undo (yet?). Instead, simple "memory" functionality with
(set), (restore), (clear) buttons is implemented. It works exactly like in calculators.Import and export
It is possible to export view state into a textual format. Either whole world or only visible area can be exported. Sample export result:
7$3$(A2(B|1))(A3(B|1))(b(A3(B|1)(b|1)))(a3(B|1))(B|1(a(B|1)))(a2(B|1))(A(B(a(B|1))))(a(B|1))Here, 7 and 3 are tiling parameters, the rest is the description of cell states.
Cell position is described by a Von Dyck group \(D(N,M,2)\) with generators a, b. Generator "a" represents rotation around the N-gon center, generator "b" represents rotation around vertex. Coordinate of a cell is a chain of powers of "a" and "b".
In the export format, letters "a" and "b" designate generators, "A" and "B" are their inverse elements. Optional number after the letter is generator power. Number after vertical bar | is state of the cell. Braces are required; they allow to group multiple chains with common initial elements.
Save and load in Indexed Database
It is possible to store whole world state in the Indexed Database on the local machine. Saves are organized by grid and by rule; names are not required to be unique. They are stored locally and not uploaded anywhere.
By default, only saves matching current tiling and rule are shown. Use buttons to show all tilings and all rules.
Making animations
Uploading animations is only supported, when the page is run locally. To do it:
- Download sources
$get clone https://github.com/dmishin/hyperbolic-ca-simulator.git
- Either build them:
$make
Or download the compiled version from the demo site:$wget http://dmishin.github.io/hyperbolic-ca-simulator/index.html $wget http://dmishin.github.io/hyperbolic-ca-simulator/application.js
- Use python 3 to start local server
$python http_server_with_upload.py
- Open the local site: http://localhost:8000/index.html
Animator GUI allows to set start and end points of animation. Use memory buttons (
) to save state before adjusting positions.button tries to adjusts start and end position by equal amount so that they would be connected by a pure translation (without rotation). In euclidean geometry, it is meaningless but in hyperbolic geometry it is useful. It allows to make seamless animations of gliders (top animation is done using it).
Steps to make seamless animation of a spaceship
- Locate a spaceship (use Search and find far configurations)
- Adjust view to display it better, then use "Straighten view". (hotkey: Alt+S)
- Remember world state using MS (hotkey: M).
- Set animation start
- Simulate for several steps until spaceship returns into the original configuration (hotkey: N).
- Adjust view and use "Straighten view" to put spaceship exactly in the same position as in step #2.
- Set animation end
- Click to make path between start and end straight. (Should be possible for a real glider). You can ensure that positions are changed by clicking button.
- Set other animation parameters (size, frames, generations, name), restore works state (MR, hotkey U), and run animation.
Sources and license
Sources are available on Github under the permissive ">MIT license.
The code uses following third party libraries:
- Canvas 2 Svg by Kerry Liu (MIT license)


|
VDPAU
|
Typedefs | |
| typedef uint64_t | VdpTime |
| The representation of a point in time. More... | |
| typedef uint32_t | VdpPresentationQueueTarget |
| An opaque handle representing the location where video will be presented. More... | |
| typedef VdpStatus | VdpPresentationQueueTargetDestroy(VdpPresentationQueueTarget presentation_queue_target) |
| Destroy a VdpPresentationQueueTarget. More... | |
| typedef uint32_t | VdpPresentationQueue |
| An opaque handle representing a presentation queue object. More... | |
| typedef VdpStatus | VdpPresentationQueueCreate(VdpDevice device, VdpPresentationQueueTarget presentation_queue_target, VdpPresentationQueue *presentation_queue) |
| Create a VdpPresentationQueue. More... | |
| typedef VdpStatus | VdpPresentationQueueDestroy(VdpPresentationQueue presentation_queue) |
| Destroy a VdpPresentationQueue. More... | |
| typedef VdpStatus | VdpPresentationQueueSetBackgroundColor(VdpPresentationQueue presentation_queue, VdpColor *const background_color) |
| Configure the background color setting. More... | |
| typedef VdpStatus | VdpPresentationQueueGetBackgroundColor(VdpPresentationQueue presentation_queue, VdpColor *background_color) |
| Retrieve the current background color setting. More... | |
| typedef VdpStatus | VdpPresentationQueueGetTime(VdpPresentationQueue presentation_queue, VdpTime *current_time) |
| Retrieve the presentation queue's "current" time. More... | |
| typedef VdpStatus | VdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, VdpOutputSurface surface, uint32_t clip_width, uint32_t clip_height, VdpTime earliest_presentation_time) |
| Enter a surface into the presentation queue. More... | |
| typedef VdpStatus | VdpPresentationQueueBlockUntilSurfaceIdle(VdpPresentationQueue presentation_queue, VdpOutputSurface surface, VdpTime *first_presentation_time) |
| Wait for a surface to finish being displayed. More... | |
| typedef VdpStatus | VdpPresentationQueueQuerySurfaceStatus(VdpPresentationQueue presentation_queue, VdpOutputSurface surface, VdpPresentationQueueStatus *status, VdpTime *first_presentation_time) |
| Poll the current queue status of a surface. More... | |
Enumerations | |
| enum | VdpPresentationQueueStatus { VDP_PRESENTATION_QUEUE_STATUS_IDLE, VDP_PRESENTATION_QUEUE_STATUS_QUEUED, VDP_PRESENTATION_QUEUE_STATUS_VISIBLE } |
| The status of a surface within a presentation queue. More... | |
The VdpPresentationQueue manages a queue of surfaces and associated timestamps. For each surface in the queue, once the associated timestamp is reached, the surface is displayed to the user. This timestamp-based approach yields high quality video delivery.
The exact location of the displayed content is Window System specific. For this reason, the Window System Integration Layer provides an API to create a VdpPresentationQueueTarget object (e.g. via VdpPresentationQueueTargetCreateX11) which encapsulates this information.
Note that the presentation queue performs no scaling of surfaces to match the display target's size, aspect ratio, etc.
Surfaces that are too large to fit into the display target will be clipped. Surfaces that are too small to fill the display target will be aligned to the top-left corner of the display target, with the balance of the display target being filled with a constant configurable "background" color.
Note that the presentation queue operates in a manner that is semantically equivalent to an overlay surface, with any required color key painting hidden internally. However, implementations are free to use whatever semantically equivalent technique they wish. Note that implementations that actually use color-keyed overlays will typically use the "background" color as the overlay color key value, so this color should be chosen with care.
| typedef uint32_t VdpPresentationQueue |
An opaque handle representing a presentation queue object.
| typedef VdpStatus VdpPresentationQueueBlockUntilSurfaceIdle(VdpPresentationQueue presentation_queue, VdpOutputSurface surface,VdpTime *first_presentation_time) |
Wait for a surface to finish being displayed.
| [in] | presentation_queue | The queue to query. |
| [in] | surface | The surface to wait for. |
| [out] | first_presentation_time | The timestamp of the VSYNC at which this surface was first displayed. Note that 0 means the surface was never displayed. |
Note that this API would block forever if queried about the surface most recently added to a presentation queue. That is because there would be no other surface that could possibly replace that surface as the currently displayed surface, and hence that surface would never become idle. For that reason, this function will return an error in that case.
| typedef VdpStatus VdpPresentationQueueCreate(VdpDevice device, VdpPresentationQueueTarget presentation_queue_target,VdpPresentationQueue *presentation_queue) |
Create a VdpPresentationQueue.
| [in] | device | The device that will contain the queue. |
| [in] | presentation_queue_target | The location to display the content. |
| [out] | presentation_queue | The new queue's handle. |
Note: The initial value for the background color will be set to an implementation-defined value.
| typedef VdpStatus VdpPresentationQueueDestroy(VdpPresentationQueue presentation_queue) |
Destroy a VdpPresentationQueue.
| [in] | presentation_queue | The queue to destroy. |
| typedef VdpStatus VdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue, VdpOutputSurface surface, uint32_t clip_width, uint32_t clip_height, VdpTime earliest_presentation_time) |
Enter a surface into the presentation queue.
| [in] | presentation_queue | The queue to query. |
| [in] | surface | The surface to enter into the queue. |
| [in] | clip_width | If set to a non-zero value, the presentation queue will display only clip_width pixels of the surface (anchored to the top-left corner of the surface. |
| [in] | clip_height | If set to a non-zero value, the presentation queue will display only clip_height lines of the surface (anchored to the top-left corner of the surface. |
| [in] | earliest_presentation_time | The timestamp associated with the surface. The presentation queue will not display the surface until the presentation queue's current time is at least this value. |
Applications may choose to allow resizing of the presentation queue target (which may be e.g. a regular Window when using an X11-based implementation).
clip_width and clip_height may be used to limit the size of the displayed region of a surface, in order to match the specific region that was rendered to.
In turn, this allows the application to allocate over-sized (e.g. screen-sized) surfaces, but render to a region that matches the current size of the video window.
Using this technique, an application's response to window resizing may simply be to render to, and display, a different region of the surface, rather than de-/re-allocation of surfaces to match the updated window size.
Implementations may impose an upper bound on the number of entries contained by the presentation queue at a given time. This limit is likely different to the number of VdpOutputSurfaces that may be allocated at a given time. This limit applies to entries in the QUEUED or VISIBLE state only. In other words, entries that have transitioned from a QUEUED or VISIBLE state to an IDLE state do not count toward this limit.
| typedef VdpStatus VdpPresentationQueueGetBackgroundColor(VdpPresentationQueue presentation_queue, VdpColor *background_color) |
Retrieve the current background color setting.
| [in] | presentation_queue | The queue to query. |
| [out] | background_color | The current background color. |
| typedef VdpStatus VdpPresentationQueueGetTime(VdpPresentationQueue presentation_queue,VdpTime *current_time) |
Retrieve the presentation queue's "current" time.
| [in] | presentation_queue | The queue to query. |
| [out] | current_time | The current time, which may represent a point between display VSYNC events. |
| typedef VdpStatus VdpPresentationQueueQuerySurfaceStatus(VdpPresentationQueue presentation_queue, VdpOutputSurface surface,VdpPresentationQueueStatus *status, VdpTime *first_presentation_time) |
Poll the current queue status of a surface.
| [in] | presentation_queue | The queue to query. |
| [in] | surface | The surface to query. |
| [out] | status | The current status of the surface within the queue. |
| [out] | first_presentation_time | The timestamp of the VSYNC at which this surface was first displayed. Note that 0 means the surface was never displayed. |
| typedef VdpStatus VdpPresentationQueueSetBackgroundColor(VdpPresentationQueue presentation_queue, VdpColor *const background_color) |
Configure the background color setting.
| [in] | presentation_queue | The queue to manipulate. |
| [in] | background_color | The new background color. |
Note: Implementations may choose whether to apply the new background color value immediately, or defer it until the next surface is presented.
| typedef uint32_t VdpPresentationQueueTarget |
An opaque handle representing the location where video will be presented.
VdpPresentationQueueTarget are created using a Window System Integration Layer specific API, such as VdpPresentationQueueTargetCreateX11.
| typedef VdpStatus VdpPresentationQueueTargetDestroy(VdpPresentationQueueTarget presentation_queue_target) |
Destroy a VdpPresentationQueueTarget.
| [in] | presentation_queue_target | The target to destroy. |
| typedef uint64_t VdpTime |
The representation of a point in time.
VdpTime timestamps are intended to be a high-precision timing system, potentially independent from any other time domain in the system.
Time is represented in units of nanoseconds. The origin (i.e. the time represented by a value of 0) is implementation dependent.
The status of a surface within a presentation queue.


I am a young lad of integrity and honesty.
My hobbies include:
My education is as follows:
I decided to take programming because of usefulness of technology in today's world and since my passion in mobile applications has always excited.
My projects include:


Free Responsive Bootstrap Wedding Theme
Weddo is a beautiful wedding theme for cute couples. Wedding is an important part of everyone life. One need to celebrate their wedding in grand manner. Among all wedding related stuffs website plays a important role because we can invite our friends and relatives easily with the help of website other than sending post and waiting for reply.
Features:
1. All basic sections like home page, RSVP, Photos, Wedding details, about couples.
2. Flex slider for photo gallery.
3. Cool hero unit.
4. jQuery anchor plugin for navigation.


404: Page not found
Sorry, we’ve misplaced that URL or it’s pointing to something that doesn’t exist. Head back home to try finding it again.
Techshaw Podcast
Sorry, we’ve misplaced that URL or it’s pointing to something that doesn’t exist. Head back home to try finding it again.


Spider limited company was founded by Patrick and Jaydan in the year 2016 with the aim of making websites to our clients at an affordable price
Any design you need we are capable of meeting your needs to the maximum
Read articleOnly Spider can do this to catch attension of customers like this!!
Read more


Logisticae
Library who contains many algorithms about mathematics, physics, electricity, etc.
Algorithms founds in Logisticae
In Mathematics
- Pythagorean Theorem and his converse.
- Intercept Theorem also known as Thales's Theorem and his converse.
- Euclidean algorithm to compute the Greatest Common Divisor between 2 numbers.
- LCM algorithm to compute the Least Common Multiple between 2 numbers.
- Implementation of an algorithm to check if a number is a prime number or not.
- Implementation of Lucas-Lehmer algorithms to check if a number is a Mersenner number.
- Implementation of line slope computation.
In Physics
- An simple converter to convert distance, liter or weight unit to another one.
- Implementations of Ohm's law to compute voltage, intensity, power and/or resistance of a electric circuit.
- Add method to convert degree unit into another one.
In Literature
- A simple algorithm to reverse the text. By example, the text Hello World ! became ! dlroW olleH.
- An algorithms to verify if a text is a palindrome. A palindrome is a text can be read and each letters are at the same place from left to right or right to left like the word kayak or the sentence Ah, Satan sees Natasha.
Installation
You can get this library on npm.
To download it, you just type the commmand
$ npm i @kero76/logisticae
Documentations
Local access
If you work locally with this library, you can generate yourself the documentation thanks to this command
$ npx typedoc --out docs src --mode file --module commonjs
Web access
You can consult the API of the library to following this link : https://kero76.github.io/logisticae/.
This version is update after each release of the API.
:warning: If you use the develop
branch content, you must generate yourself the documentation or reading the source code to using correctly this API.
Useful commands
- Command use to compile the project :
$ npm run build
or $ tsc
- Command use to execute the unit tests :
$ npm test
or $ npm run test
- Command use to execute the code coverage :
$ npm run coverage
- Command use to execute the linter :
$ npm run lint
- Command use to generate the documentation :
$ npm run docs
or $ npx typedoc --out docs src --mode file --module commonjs
Changelog
You can see more information about versions on the CHANGELOG.md.
- v0.4.0 : Documentae update
- v0.3.0 : Stringae update
- V0.2.0 : Physicae update
- V0.1.0 : Mathematicae update
License
This project is under MIT License.
Author(s)