mapa17 / Kaleidoscope

An infinit number of worlds
MIT License
0 stars 0 forks source link

Resolve multi agent conflicts #17

Open mapa17 opened 6 years ago

mapa17 commented 6 years ago

Problem

So at the current stage, one single W0 and W1 buffer is shared between multiple agents that are running on different rows of the buffer (as their center).

This causes potential conflicts, as an agent cant change any field in its ROI (for an 3x3 roi for example this can in the worst case give 9 conflicting agent operations). Causing all kind of artifacts and none deterministic results.

Solution

The solution includes two major changes

Make all future buffers binary

I could support multiple buffers(and have to in order to encode different type of cells for example, like for the snow flake) but they have to be binary. This is because on each cycle an agent will produce for each cell a voting voting it up (+1), down (-1), nothing (0).

During an aggregation step the majority (simple sum) will decide the state of a cell.

Agents have their own buffers

Each agent will read a copy of W0 and operate using the voting system on an part of the buffer (not line by line but processing multiple lines at once, running once per cycle) After an agent is done, it send the modified W1 buffer using the Queue to the aggregation process. The aggregation process will calculate the sum of all buffers it receives until it gets its termination signal. Once this is received it will produce the binary output buffer.

I have to remember that the buffer must now have multiple levels ...