[][src]Module semeion::env

Structs

Environment

The Environment is a grid, of squared tiles with the same size, where all the entities belongs. The Environment acts both as the data structure as well as the engine that controls the behavior of all the entities in it, and their interaction for each generation. Where both of those are defined by the user, and handled via the Entity trait method called for each entity by the environment generation after generation. An environment can contains entities of different kinds, dynamically allocated and defined according to the user needs via the Entity trait, but all the entities must share the same Entity trait associated types. The Environment can be created with specific bounds, that represents the size of the grid that describes its geometry (the Bounds can be computed from the window size in pixels where the environment will be drawn for a specific length of the grid tiles side). Once the environment is initialized by inserting entities in its initial population, it can be drawn by drawing all its entities, and it is possible to move to the next generation (where the interaction between the entities takes place). The geometry of the environment is defined as a Torus, that is, the grid bounds are adjacent to each other, allowing therefore the entities to move past each bounds into the next tile as if there were no limits.

NeighborHood

The neighbor tiles of a specific entity.