我正在尝试从命令行使用BehaviorSpace进行实验,但是BehaviorSpace没有加载扩展。有a similar question,我既不理解答案也不能评论,所以我将在这里解释我的问题。
我修改了fire.nlogo模型,通过GUI添加一个名为“experiment1”的随机实验,并从guide复制粘贴:
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的。
答案 0 :(得分:0)
我有类似的问题。
对我来说,当我将文件夹extensions
从NetLogo/app/
复制到NetLogo
文件夹(netlogo-headless.sh
通常所在的位置)时,我就解决了这个问题。