Skip to content

Project Structure

Danil Platonov edited this page Feb 20, 2017 · 20 revisions

Modules structure:

  • Space <- creates space

  • Creature <- something that can live inside the graph space

  • Observer <- an immaterial observer

  • World <- a graph space filled with creatures

  • Time <- allows the world to update in discrete ticks

  • Graphics <- an interface that allows to render a creature on the screen; also contains simple GUI

  • Examples <- a bunch of examples of applications that use this package

Detailed module structure:

Space:

  • Node - a node in a graph network
  • Path - a path in a network
  • Plane - a regular plane
  • Point - a point
  • Direction - possible directions
  • PointGenerator - a collection of point sets generators

Project Structure

Node Network

A 5x5 Node Network can be represented as a graph: Node Network

It is also possible to insert a graph in a regular partition of an Euclidean plane, thus effectively breaking the geometry: Node Network with Inserted Node

Creature:

An creature inside the graph space.

Available methods:

  • Move right/left/up/down
  • Get the node that the creature is placed in
  • Kill

Observer:

An observer of the graph space. Not placed inside the graph space, but has an associated node which is observed.

Available methods:

  • Move right/left/up/down
  • Get the node that the creature is placed in

World:

Basically, Set<Node<Creature>>.

Time:

Implements time progression and time traveling. When getPast is invoked, a new world line is created. It is possible that two or more time lines would attaint the same state. In this case, they should be merged into one time line.

What is time?

Time is a graph: Time Graph

Time has a beginning node (yellow) and an arbitrary number of leaf nodes (green).

Each time a tick method is used, leaf nodes are updated according to the specified rules. By default, a new leaf node is created.

Notice that sometimes different timelines can converge into one timeline if the world states are equivalent. Question: How would we handle time keeping when two timelines merge?

Available methods:

  • tick - an abstract method that ticks the world according to specific implementation, preserving the previous world state
  • getPast(int ticks) - returns the world state ticks ago
  • getFuture(int ticks) - returns the world state ticks in the future

Other functionality:

  • Keep track of different world lines

Graphics:

Interface that requires implementation of a tile-rendering method. Tiles should be squares of a regular size.

Available methods:

  • render()
  • getSize()

Examples:

  • Life - a game of life in the graph space
  • Dungeon - a dungeon crawler in the graph space
  • Wireworld - a wireworld simulation in the graph space