|
2 | 2 |
|
3 | 3 | Inspired by a challenge issued earlier in the week. |
4 | 4 |
|
| 5 | +## Getting started |
| 6 | + |
| 7 | +To get started clone this repo. The project is made to integrate with [IntelliJ idea](https://www.jetbrains.com/idea/). |
| 8 | +There are several gradle integrated run configurations that will aid in a quick start (see `GameOfLife [run]`). |
| 9 | +Running `gradlew.bat run`(windows) or `gradlew run`(linux) |
| 10 | +will start the application via cli. |
| 11 | + |
| 12 | +### Run Configurations |
| 13 | + |
| 14 | +For now these are all set via inline code. |
| 15 | + |
| 16 | +Further development is set up to enable features such as |
| 17 | + |
| 18 | +- Setting the location of the viewport. |
| 19 | +- Setting the scale of the viewport. |
| 20 | +- Progression speed of the simulation age / tick-speed |
| 21 | +- Pausing the simulation |
| 22 | +- Loading start configurations (active/inactive status on the grid) from files |
| 23 | + |
5 | 24 | ## Implementation |
6 | 25 |
|
7 | | -After an initial lookover the linked wikipage [Conways Game of Life](http://en.wikipedia.org/wiki/Conway's_Game_of_Life). An implementation |
8 | | -seems to require logic to keep track of the entities, and a canvas to render a limited space out of the total of the |
9 | | -abstract 2d plane on which the game logic occurs across. |
| 26 | +After an initial look over the linked |
| 27 | +wikipage [Conways Game of Life.](http://en.wikipedia.org/wiki/Conway's_Game_of_Life) |
| 28 | +An implementation seems to require logic to keep track of the entities, and a canvas to render a limited space out of |
| 29 | +the total of the abstract 2d plane on which the game logic occurs across. |
| 30 | + |
| 31 | +### Limitations on current implementation |
| 32 | + |
| 33 | +The current implementation uses a `boolean[][]` type 2d array to store the abstract 2d plane. |
| 34 | + |
| 35 | +The good: Primitive types when in arrays allow for very fast memory access. There is a great talk |
| 36 | +here [Youtube - Scott Meyers Nokia talk](https://www.youtube.com/watch?v=WDIkqP4JbkE) that describes why a large data |
| 37 | +set capable of being described by a and array of primitives should never be represented as an array of complex typed |
| 38 | +objects. This could however likely be rewritten in some combination of logic to handle chunks |
| 39 | +and arrays of 64bit integers for the best result. |
| 40 | + |
| 41 | +The bad: This does however add a limitation where the size of the simulation space is neither infinite nor flexible. |
| 42 | +Adding simulation space into rows lower than 0 or columns lower than requires a full copy of the array into a larger |
| 43 | +array this is unideal. |
10 | 44 |
|
11 | 45 | ### Ideas for further development |
12 | 46 |
|
13 | | -Move the implementation of the abstract grid containing an array of entities in series of classes into an spring powered mvc app. |
| 47 | +Move the implementation of the abstract grid containing an array of entities (see the class `EntityGrid`) into a spring |
| 48 | +powered mvc app. This would allow multiple observers to simultaneously observe. |
| 49 | + |
| 50 | +Change the method of simulation progression such that it relies on a queue of changes. This could also allow different |
| 51 | +singular clients to stream/download and load the simulation asynchronously. |
14 | 52 |
|
15 | | -Extend the implementation of the rendering engine in java fx, to also cover a web app- perhaps angular with a 2d rendering library. |
| 53 | +~~Extend the implementation of the rendering engine in java fx, to also cover a web app- perhaps angular with a 2d |
| 54 | +rendering library.~~ |
16 | 55 |
|
17 | 56 | ## Dependencies |
18 | 57 |
|
|
0 commit comments