I've been doing some profiling in ARGoS with large robot swarms ( >8K) with large numbers of blocks in the arena (blocks are modeled as in the foraging example, as flat black shapes on the floor). I'm using the loop functions GetFloorColor() to determine the color of the floor in a given location in the arena: white in general, and black if a block currently resides there.
I've found that updating the foot-bot ground sensors takes about 50% of the total simulation time (updating physics for 8K robots is only taking 12%, by comparison), the reason being that each robot has to call the loop functions GetFloorColor() from CFootBotMotorGroundRotZOnlySensor::Update() to figure out the sensor readings of their ground sensors on the SenseStep(). This update seems to happen unconditionally, even if the floor entity of the loop functions has not been marked as needing an update via SetChanged(). Am I correct in this ?
If so, would it be possible to "cache" the sensor readings that each robot reads, and only perform the ground sensor updates whenever the loop functions mark the arena floor as needing to be redrawn? Right now, redrawing happens on SetChanged() if using visualizations, which definitely saves computational cycles, but SetChanged() seems to have no effect on whether or not each robot will recompute their ground sensor readings on a given timestep. What would I need to change in the code to make this happen, if it is possible without core architectural changes?