Agent Datastructure

Last modification on 2019-03-10


At this stage in the project I am going to focus more on the agents, following the advice of Simon. Far too much time has been paid to the user interface.

The datastructure

A basic datastructure for agents has been implemented, which is as follows:
struct _Agent {
float x;
float y;
float size;
RGB rgb;
struct {
  float x;
  float y;
} velocity;
Also an agent array structure has been created:
struct _Agent_array {
Agent* agents;
int count;


Drawing an agent array can be done very easily now via the following pipeline:
Fig1. Agent render pipeline


It is now possible to draw large amounts of agents to the screen using a few lines of code. Below is an example of this:
Fig2. An array of agents drawn to the screen