The goal of this project is to link a multi-agent simulation and the Game of life of Conway.
In our code we have 3 differents rules :
- The Conway rules that state that any living cells with 1 or more than 3 neighbors dies and a dead cell with exactly 3 living neighbors will come to life.
- The Blob Rule stating that a cell will stay alive if she has exactly 1,3,5,8 neighbors and a dead cell with exaclty 3,5,7 living neighbors will come to life.
- Our rule stating that any living cell with 2 and 4 neighbors dies and a dead cell will come to life if she has 1 or 3 living neighbors
Part 3
To be able to save a world we needed to create a snapshot of the grid where each line is represented as a string of the
cell state separated by semicolons.
To do that we first create an empty list, and then the state of every cell of the grid is stored inside this list.
To save an agent or a rule do the same methodology.
Agent
We implemented the sheep agent and the engineer agent
The sheep being already written prior, we only needed to make basic modifications for our engineer agent.
The idea we had was to create an agent that could create a series of glider, depending on the x and y values put at the end of engineer script, the direction of the glider can be tweaked.
To do so, we removed all the rules concerning the movement of the sheep agent as well as the fact that it could disappear.
Instead we've written lines that first created a glider each 25 ticks (we needed to make sure difference between each generation was large enough to make sure that there wouldn't be any collisions)
And second we've written lines that rendered the right cells around the agent center point to make sure a glider was created. This is only a tiny example but several bigger structures could be created this way.
NOTE: there was a problem somewhere in our code but I cannot pinpoint where, which reversed our x and y values. Originally the plan was to have a downward right glider but instead the result was a upward right.
*