Netlogo 无头错误

Netlogo Headless error

我在 运行 NetLogo 时遇到此错误,在 HPC 上无头。我的工作似乎保持 运行 但没有写任何东西。

Exception in thread "main" java.lang.OutOfMemoryError: PermGen space
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
            at org.nlogo.generator.CustomClassLoader.loadClass(CustomClassLoader.scala:27)
            at org.nlogo.generator.CustomClassLoader.loadBytecodeClass(CustomClassLoader.scala:32)
            at org.nlogo.generator.Generator$InstructionGenerator.finish(Generator.scala:241)
            at org.nlogo.generator.Generator$InstructionGenerator.generate(Generator.scala:93)
            at org.nlogo.generator.Generator.org$nlogo$generator$Generator$$recurse(Generator.scala:28)
            at org.nlogo.generator.Generator$$anonfun$generate.apply(Generator.scala:24)
            at org.nlogo.generator.Generator$$anonfun$generate.apply(Generator.scala:24)
            at scala.collection.TraversableLike$$anonfun$map.apply(TraversableLike.scala:233)
            at scala.collection.TraversableLike$$anonfun$map.apply(TraversableLike.scala:233)
            at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
            at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
            at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
            at scala.collection.mutable.ArrayOps.map(ArrayOps.scala:38)
            at org.nlogo.generator.Generator.generate(Generator.scala:24)
            at org.nlogo.compiler.CompilerMain$$anonfun$compile.apply(CompilerMain.scala:59)
            at org.nlogo.compiler.CompilerMain$$anonfun$compile.apply(CompilerMain.scala:50)
            at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
            at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
            at org.nlogo.compiler.CompilerMain$.compile(CompilerMain.scala:50)
            at org.nlogo.compiler.Compiler$.compileProgram(Compiler.scala:28)
            at org.nlogo.headless.HeadlessModelOpener.openFromMap(HeadlessModelOpener.scala:53)
            at org.nlogo.headless.HeadlessWorkspace.openString(HeadlessWorkspace.scala:525)
            at org.nlogo.headless.HeadlessWorkspace.open(HeadlessWorkspace.scala:507)
            at org.nlogo.headless.Main$.newWorkspace(Main.scala:19)
            at org.nlogo.headless.Main$$anonfun$runExperiment.apply(Main.scala:24)
            at org.nlogo.headless.Main$$anonfun$runExperiment.apply(Main.scala:24)
            at org.nlogo.lab.Lab$$anonfun.apply(Lab.scala:33)
            at org.nlogo.lab.Lab$$anonfun.apply(Lab.scala:33)
            at scala.collection.TraversableLike$$anonfun$map.apply(TraversableLike.scala:233)

更改 netlogo 批处理文件中的内存大小设置可能会解决此问题。由于最大内存的默认值较低,因此当您使用大量代理进行模拟时,通常会发生此问题。

我之前就是这样改成1024M的。尝试制作自己的脚本并使用本地修改的netlogo批处理提交,而不是使用hpc提供的标准版本。