physarumAdv / minds_crawl

Physarum polycephalum growth simulator on polyhedron surfaces written in CUDA C++
MIT License
4 stars 0 forks source link

Too much trail is added when nutrients are projected #57

Open kolayne opened 3 years ago

kolayne commented 3 years ago

It is not guaranteed, that all the nodes in the following loops are unique: it is possible that node A has node B as its neighbour by more than one direction (for example, (A->get_top() == &B) && (A->get_right() == &B)). In such situation B->temp_trail will be increased twice instead of once.

We need to fix this piece of code, and also look for similar cases and either fix them if they are affected by the same mistake or write a comment explaining why this is not an issue there, to make it clear that the piece of code was not forgotten but is correct.

https://github.com/physarumAdv/minds_crawl/blob/8e132c0578677b4d44882377212f6530deb39e8b/src/main_logic/simulation_motor.cuh#L156-L165

kolayne commented 3 years ago

I would also like @tanya-kta to make a long comment somewhere in SimulationMap.cu/cuh and explain in more detail, how the mapnode grid is built, what strange things like that are supposed to happen and why