1
我試圖從命令行運行BehaviorSpace的實驗,但BehaviorSpace不加載擴展。有a similar question,bur我既不能理解答案也不能評論,所以我會在這裏解釋我的問題。Headless BehaviorSpace無法加載擴展
我修改fire.nlogo模式,通過GUI從guide添加一個名爲「experiment1」隨機試驗和複製粘貼:
java -Xmx1024m -Dfile.encoding=UTF-8 -cp ~/Desktop/netlogo-6.0-M6-64/app/NetLogo.jar\
org.nlogo.headless.Main \
--model "~/Desktop/netlogo-6.0-M6-64/app/models/Sample Models/Earth Science/Fire.nlogo" Fire.nlogo" \
--experiment experiment1 \
--table -
這工作。
然後,添加
"extensions[csv]"
作爲模型中的第一行並運行相同的指令。這就是我得到:
Exception in thread "main" Can't find extension: csv at position 11 in
at org.nlogo.core.ErrorSource.signalError(ErrorSource.scala:11)
at org.nlogo.workspace.ExtensionManager.importExtension(ExtensionManager.scala:171)
at org.nlogo.parse.StructureParser$$anonfun$parsingWithExtensions$1.apply(StructureParser.scala:70)
at org.nlogo.parse.StructureParser$$anonfun$parsingWithExtensions$1.apply(StructureParser.scala:69)
at scala.collection.immutable.List.foreach(List.scala:381)
at org.nlogo.parse.StructureParser$.parsingWithExtensions(StructureParser.scala:69)
at org.nlogo.parse.StructureParser$.parseSources(StructureParser.scala:35)
at org.nlogo.parse.FrontEndMain$class.frontEnd(FrontEnd.scala:28)
at org.nlogo.parse.FrontEnd.frontEnd(FrontEnd.scala:16)
at org.nlogo.compiler.CompilerMain$.compile(CompilerMain.scala:28)
at org.nlogo.compiler.Compiler.compileProgram(Compiler.scala:54)
at org.nlogo.headless.HeadlessModelOpener.openFromModel(HeadlessModelOpener.scala:68)
at org.nlogo.headless.HeadlessWorkspace.openModel(HeadlessWorkspace.scala:544)
at org.nlogo.headless.HeadlessWorkspace.openFromSource(HeadlessWorkspace.scala:540)
at org.nlogo.headless.HeadlessWorkspace.openString(HeadlessWorkspace.scala:526)
at org.nlogo.headless.HeadlessWorkspace.open(HeadlessWorkspace.scala:508)
at org.nlogo.headless.Main$.org$nlogo$headless$Main$$newWorkspace$1(Main.scala:19)
at org.nlogo.headless.Main$$anonfun$runExperiment$1.apply(Main.scala:24)
at org.nlogo.headless.Main$$anonfun$runExperiment$1.apply(Main.scala:24)
at org.nlogo.lab.Lab$$anonfun$2.apply(Lab.scala:33)
at org.nlogo.lab.Lab$$anonfun$2.apply(Lab.scala:33)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
at scala.collection.immutable.Range.foreach(Range.scala:160)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at org.nlogo.lab.Lab.run(Lab.scala:33)
at org.nlogo.headless.Main$.runExperiment(Main.scala:24)
at org.nlogo.headless.Main$$anonfun$main$1.apply(Main.scala:14)
at org.nlogo.headless.Main$$anonfun$main$1.apply(Main.scala:14)
at scala.Option.foreach(Option.scala:257)
at org.nlogo.headless.Main$.main(Main.scala:14)
at org.nlogo.headless.Main.main(Main.scala)
如果我重複的步驟,使用的NetLogo 5.3.1-64,我得到一個不同的錯誤開始
java.lang.IllegalStateException: Can't find extension: csv/csv.jar
我試過位擴展,而不是CSV,但沒有運氣。值得注意的是,如果我從GUI開始實驗,那麼這個實驗就可以運行我使用 Ubuntu 16.10和 java-1.8.0-openjdk-amd64。