Git Product home page Git Product logo

grojoa3n's Introduction

grojoa3n's People

Contributors

rubensolv avatar

Watchers

 avatar  avatar

grojoa3n's Issues

IndexOutOfBoundsException in selectLeafUsingLocalMABs()

Context

I'm running PPO-based trainings in MicroRTS-Py, in a work-in-progress branch where I'm trying to get the training and evaluation code there to work on mixes of different maps of different sizes. These trainings use a mix of different opponent AIs to train and evaluate against, of which guidedRojoA3N is one. In one of my test runs just now, this bot ended up crashing.

Stack trace

Here is the stacktrace produced for the crash:

java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 1
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
        at java.base/java.util.Objects.checkIndex(Objects.java:385)
        at java.base/java.util.ArrayList.get(ArrayList.java:427)
        at ai.CMAB.GuidedA3NWithinMCTSNode.selectLeafUsingLocalMABs(GuidedA3NWithinMCTSNode.java:231)
        at ai.CMAB.GuidedA3NWithinMCTSNode.selectLeaf(GuidedA3NWithinMCTSNode.java:154)
        at ai.CMAB.GuidedA3NW.iteration(GuidedA3NW.java:343)
        at ai.CMAB.GuidedA3NW.computeDuringOneGameFrame(GuidedA3NW.java:324)
        at ai.CMAB.GuidedA3NW.getAction(GuidedA3NW.java:275)
        at ai.competition.GRojoA3N.GuidedRojoA3N.getAction(GuidedRojoA3N.java:62)
        at tests.JNIGridnetClient.gameStep(JNIGridnetClient.java:172)
        at tests.JNIGridnetVecClient.gameStep(JNIGridnetVecClient.java:271)
Traceback (most recent call last):
  File "JNIGridnetVecClient.java", line 271, in tests.JNIGridnetVecClient.gameStep
  File "JNIGridnetClient.java", line 172, in tests.JNIGridnetClient.gameStep
  File "GuidedRojoA3N.java", line 62, in ai.competition.GRojoA3N.GuidedRojoA3N.getAction
  File "GuidedA3NW.java", line 275, in ai.CMAB.GuidedA3NW.getAction
  File "GuidedA3NW.java", line 324, in ai.CMAB.GuidedA3NW.computeDuringOneGameFrame
  File "GuidedA3NW.java", line 343, in ai.CMAB.GuidedA3NW.iteration
  File "GuidedA3NWithinMCTSNode.java", line 154, in ai.CMAB.GuidedA3NWithinMCTSNode.selectLeaf
  File "GuidedA3NWithinMCTSNode.java", line 231, in ai.CMAB.GuidedA3NWithinMCTSNode.selectLeafUsingLocalMABs
  File "ArrayList.java", line 427, in java.util.ArrayList.get
  File "Objects.java", line 385, in java.util.Objects.checkIndex
  File "Preconditions.java", line 302, in jdk.internal.util.Preconditions.checkIndex
  File "Preconditions.java", line 106, in jdk.internal.util.Preconditions.outOfBoundsCheckIndex
  File "Preconditions.java", line 100, in jdk.internal.util.Preconditions.outOfBounds
Exception: Java Exception

So, it looks like int code = unitActionTable.get(j).actions.indexOf(gua); in line 229 of GuidedA3NWithinMCTSNode.java ends up with code = -1, and then in line 231 this produces a crash.

Other info

Right now, I don't really have much other info. I was training/evaluating on a whole bunch of different maps, and the stacktrace doesn't tell me which map was being used during this particular crash. I did include some "strange" maps though, like maps/EightBasesWorkers16x12.xml (which, judging from the name, I assume includes many many more bases than most maps), and maps/melee14x12Mixed18.xml (which, I assume is a combat-units-only map, though I didn't check).

If you need this info, I can try to get it, but I'm not sure yet how long it'll take till I can reproduce this crash again (with modified code to catch such exceptions and print the map being used). If you can think of any other info that might also be useful to collect, please let me know.

I also didn't really dive into the details of how your AI works. I have no idea whether a code of -1 in this place is indicative of there being some other bug somewhere earlier on, or if this is actually a perfectly reasonable case and you simply have to add some code after it to deal with it. Hopefully you might know though :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.