burlap icon indicating copy to clipboard operation
burlap copied to clipboard

Agent can try to move out of bounds, throwing an ArrayIndexOutOfBoundsException

Open QuantumMatters opened this issue 4 years ago • 1 comments

https://github.com/jmacglashan/burlap/blob/cc3b09de81f33e6bed8154144a3183dee8595e32/src/main/java/burlap/domain/singleagent/blockdude/BlockDudeModel.java#L138

Because dir can be +1 and ax can be the map.length - 1, the agent can try to move outside the bounds of the map array.

To reproduce, run this test with getLevel1 or getLevel2 instead of getLevel3: https://github.com/jmacglashan/burlap/blob/cc3b09de81f33e6bed8154144a3183dee8595e32/src/test/java/burlap/testing/TestBlockDude.java#L40

QuantumMatters avatar Nov 21 '21 19:11 QuantumMatters

any solutions to it instead of modified the source code by my self

yangluo0901 avatar Nov 08 '22 21:11 yangluo0901