bb4 / bb4-simulations

A collection of java simulations. Examples include reaction diffusion, fractals, henon phase exploration, snakes, dice, and fluid flow.
MIT License
5 stars 2 forks source link

IndexOutOfBounds when changing colormap in FractalExplorer #13

Closed barrybecker4 closed 5 years ago

barrybecker4 commented 9 years ago

Exception in thread "Thread-18" java.lang.IndexOutOfBoundsException: Index: 6, Size: 6 at java.util.ArrayList.rangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at com.barrybecker4.ui.util.ColorMap.getColorForValue(ColorMap.java:60) at com.barrybecker4.simulation.common.rendering.ModelImage.updateImage(ModelImage.java:72) at com.barrybecker4.simulation.fractalexplorer.FractalExplorer.timeStep(FractalExplorer.java:119) at com.barrybecker4.ui.animation.AnimationComponent.run(AnimationComponent.java:91) at java.lang.Thread.run(Unknown Source)

barrybecker4 commented 7 years ago

I have not seen it lately

barrybecker4 commented 5 years ago

Just got it in CaveExplorer too when adding a control point ARGS = -panel_class, com.barrybecker4.simulation.cave.CaveExplorer

Exception in thread "Thread-1" java.lang.ArrayIndexOutOfBoundsException: 6
    at com.barrybecker4.ui.util.ColorMap.interpolate(ColorMap.scala:75)
    at com.barrybecker4.ui.util.ColorMap.getColorForValue(ColorMap.scala:51)
    at com.barrybecker4.simulation.cave.rendering.CaveRenderer.$anonfun$render$2(CaveRenderer.scala:46)
    at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:156)
    at com.barrybecker4.simulation.cave.rendering.CaveRenderer.$anonfun$render$1(CaveRenderer.scala:42)
    at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:156)
    at com.barrybecker4.simulation.cave.rendering.CaveRenderer.render(CaveRenderer.scala:41)
    at com.barrybecker4.simulation.cave.model.CaveModel.doRender(CaveModel.scala:182)
    at com.barrybecker4.simulation.cave.model.CaveModel.$anonfun$timeStep$1(CaveModel.scala:174)
    at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:156)
    at com.barrybecker4.simulation.cave.model.CaveModel.timeStep(CaveModel.scala:171)
    at com.barrybecker4.simulation.cave.CaveExplorer.timeStep(CaveExplorer.scala:52)
    at com.barrybecker4.ui.animation.AnimationComponent.run(AnimationComponent.scala:58)
    at java.lang.Thread.run(Thread.java:745)
barrybecker4 commented 5 years ago

Fixed in bb4-ui library. Also added ttip instructions or how to add/remove markers.