Safe to call during multithread mode. Indiv won't move until end of sim step when drainMoveQueue() is called. Should only be called for living agents. It's ok if multiple agents are queued to move to the same location; only the first one will actually get moved.
| 57 | // for living agents. It's ok if multiple agents are queued to move |
| 58 | // to the same location; only the first one will actually get moved. |
| 59 | void Peeps::queueForMove(const Indiv &indiv, Coord newLoc) |
| 60 | { |
| 61 | assert(indiv.alive); |
| 62 | |
| 63 | #pragma omp critical |
| 64 | { |
| 65 | auto record = std::make_pair<uint16_t, Coord>(uint16_t(indiv.index), Coord(newLoc)); |
| 66 | moveQueue.push_back(record); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | |
| 71 | // Called in single-thread mode at end of sim step. This executes all the |