mapa17 / Kaleidoscope

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

agent return complete roi #13

Closed mapa17 closed 6 years ago

mapa17 commented 6 years ago

Funny, to revert the code, but the agent has to be able to not only set the center of the ROI but to set any field in the ROI in order to for example walk over the plane, split, or do other stuff ...

mapa17 commented 6 years ago

Well now its getting difficult because depending on the execution order of the different works, the result buffer will look different ...

mapa17 commented 6 years ago

Ok another major refactoring

1) The agent function will be called only on 'black' cells 2) The agent function returns a complete ROI 3) The wrapper function will identify which cells have been changed. The center cell (dx, dy) will be modified directly through he shared memory. Other modifications will be pushed into a queue. 4) After all workers are down a coordinator will process the queue and will insure deterministic operations by giving ordering operation on the same cell based on the process id.

Each agent process will send modifications of the form ((x, y), (process_id, new_cell_value))

So its a tuple of two tuples. (x,y) will be used as a key in a hash table to find colliding operations. If this happens, the entry will be replaced if the process_id of the conflicting new entry is higher.