TargetId attribute in TargetFloorFieldGridProcessor is ignored
Summary
The TargetFloorFieldGridProcessor has an attribute to set which floor field should be captured. The implementation however
uses a random pedestrian within the simulation state.getTopography().[...].stream().findAny();
from which the
next targetId is selected.
Steps to reproduce
execute scenario002.scenario and compare
targetFloorField2.txt
with targetFloorField3.txt
Additional fixes needed to circumvent errors due to double comparison in for loops
int widthMax = (int)Math.floor(bound.width / att.getResolution());
for (int i = 0; i < widthMax; i++){
double y = bound.y + i*att.getResolution();
FloorFieldGridRow floorFieldGridRow = new FloorFieldGridRow((int) Math.floor(bound.width / att.getResolution()));
int col = 0;
for (int j=0; j< floorFieldGridRow.size(); j++){
double x = bound.x + j*att.getResolution();
floorFieldGridRow.setValue(col++, pft.getPotential(new VPoint(x, y), optPed.get()));
}
this.putValue(new TimestepRowKey(state.getStep(), row++), floorFieldGridRow);
}
Starting point
Create a dummy pedestrian with the correct targetId which is used to extract the potential field.
@BZoennchen is this the intended use case for this processor? If yes then I can fix this