2

I have set up a simulation in Repast that is supposed to model people boarding an airplane. I wish to run it multiple times to get an average of how much time it takes to board the airplane for various methods. The model works completely fine when running normally, and the model output works just fine then. However, when I try to do a batch run it gives me this error in the console, and the final model output it gives is just an empty file. Also, the console gives this message:

WARN [SwingWorker-pool-2-thread-2] 17:40:56,274 OutputFinder - No model output found matching glob:{**/,}ModelOutput*.batch_param_map.txt in /var/folders/nh/8k546jq14l5gnwkjgxvch8180000gn/T/simphony_model_1651246794058/instance_2

WARN [SwingWorker-pool-2-thread-2] 17:40:56,274 OutputFinder - No model output found matching glob:{**/,}ModelOutput*.txt in /var/folders/nh/8k546jq14l5gnwkjgxvch8180000gn/T/simphony_model_1651246794058/instance_2

WARN [SwingWorker-pool-2-thread-2] 17:40:56,275 OutputFinder - No model output found matching glob:{**/,}ModelOutput*.batch_param_map.txt in /var/folders/nh/8k546jq14l5gnwkjgxvch8180000gn/T/simphony_model_1651246794058/instance_1

WARN [SwingWorker-pool-2-thread-2] 17:40:56,275 OutputFinder - No model output found matching glob:{**/,}ModelOutput*.txt in /var/folders/nh/8k546jq14l5gnwkjgxvch8180000gn/T/simphony_model_1651246794058/instance_1

From what I have seen, there could be four issues why a model doesn't work in batch when it works normally.

  1. It doesn't self-terminate. However, I am certain my model does this, it terminates as soon as all passengers are seated, and I know it does this in all normal runs.
  2. Display elements I have removed the display, and have no display elements in my simulation
  3. Model output My model output is written to a file ModelOutput.txt, with the same name each time, and it works fine when running normally.
  4. External libraries This is what I believe might be the issue. The only libraries I am importing are standard java libraries such as java.util.Random or java.util.list, as well as a lot of repast libraries. Could any of these be the issue? If so, how do I move them somewhere else while still being able to access them? I saw something about moving them into the lib directory but didn't quite understand how.

Thank you for any help!

Emil Ryd
  • 35
  • 4
  • 1
    Is there no more error output in the console? Usually if there's an error during the run it will get reported there. If not, is there anything in the instance directories - /var/folders/nh/8k546jq14l5gnwkjgxvch8180000gn/T/simphony_model_1651246794058/instance_1. – Nick Collier Apr 29 '22 at 17:23
  • 1
    @NickCollier only error given in the console is this, printed at two instances: `INFO [Thread-0] 19:44:57,237 LocalSession - ERROR [main] 19:44:57,219 InstanceRunner - Error while running model` However under it also says: Caused by: `java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module [at]41a962cf` Does this say anything of value? – Emil Ryd Apr 29 '22 at 17:54
  • 1
    I changed my Eclipse preferences to use JDK compliance level to 1.8, and now it instead gives this error: `ERROR [main] 20:09:50,895 InstanceRunner - Error while running model INFO [Thread-0] 20:09:50,924 LocalSession - java.lang.ExceptionInInitializerError: null` Also this: `Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module [at]5ef60048` Could the problems have something to do with JDK/JRE version or VM arguments? – Emil Ryd Apr 29 '22 at 18:11

1 Answers1

2

This error results when using a JRE > 11. (Note that when doing a batch run, the first "java" in the PATH is used which may not be what Eclipse is using.)

See the FAQ entry here for a solution:

https://repast.github.io/docs/RepastFAQ/RepastFAQ.html#_fatal_java_lang_exceptionininitializererror_caused_by_java_lang_reflect_inaccessibleobjectexception

The arguments specified there can be added in the JVM Arguments text box in the batch run GUI.

Nick Collier
  • 1,786
  • 9
  • 10