我目前有一个项目,我已经使用netlogo界面完成了。
我的项目包含多个.nls文件,我的一个.nls文件使用表扩展名。我已经创建了一个行为空间实验并将其命名为实验以简化。
我正在尝试使用Netlogo应用程序的Netlogo.jar所在目录中的以下命令运行实验。
java -Xmx1024m -Dfile.encoding=UTF-8 -cp ./Netlogo.jar org.nlogo.headless.Main --model /path/to/file/experiment.nlogo --experiment experiment --table /path/to/output/table-output.csv --spreadsheet /path/to/output/spreadsheet-output.csv
我收到以下错误。好像我无法从.nls文件中检测到我的扩展名。如何解决这个问题?
Exception in thread "main" Nothing named TABLE:PUT has been defined at position 895 in
at org.nlogo.compiler.CompilerExceptionThrowers$.exception(CompilerExceptionThrowers.scala:26)
at org.nlogo.compiler.IdentifierParser.org$nlogo$compiler$IdentifierParser$$getAgentVariableReporter(IdentifierParser.scala:107)
at org.nlogo.compiler.IdentifierParser$$anonfun$processToken2$2.apply(IdentifierParser.scala:75)
at org.nlogo.compiler.IdentifierParser$$anonfun$processToken2$2.apply(IdentifierParser.scala:68)
at scala.Option.getOrElse(Option.scala:108)
at org.nlogo.compiler.IdentifierParser.processToken2(IdentifierParser.scala:68)
at org.nlogo.compiler.IdentifierParser.processToken$1(IdentifierParser.scala:31)
at org.nlogo.compiler.IdentifierParser$$anonfun$process$1.apply(IdentifierParser.scala:34)
at org.nlogo.compiler.IdentifierParser$$anonfun$process$1.apply(IdentifierParser.scala:34)
at scala.collection.Iterator$$anon$19.next(Iterator.scala:401)
at scala.collection.Iterator$class.toStream(Iterator.scala:1181)
at scala.collection.Iterator$$anon$19.toStream(Iterator.scala:399)
at scala.collection.Iterator$$anonfun$toStream$1.apply(Iterator.scala:1181)
at scala.collection.Iterator$$anonfun$toStream$1.apply(Iterator.scala:1181)
at scala.collection.immutable.Stream$Cons.tail(Stream.scala:1060)
at scala.collection.immutable.Stream$Cons.tail(Stream.scala:1052)
at scala.collection.immutable.StreamIterator$$anonfun$next$1.apply(Stream.scala:952)
at scala.collection.immutable.StreamIterator$$anonfun$next$1.apply(Stream.scala:952)
at scala.collection.immutable.StreamIterator$LazyCell.v(Stream.scala:941)
at scala.collection.immutable.StreamIterator.hasNext(Stream.scala:946)
at scala.collection.Iterator$class.isEmpty(Iterator.scala:329)
at scala.collection.immutable.StreamIterator.isEmpty(Stream.scala:933)
at scala.collection.immutable.StreamIterator.next(Stream.scala:948)
at scala.collection.Iterator$$anon$2.next(Iterator.scala:898)
at scala.collection.Iterator$$anon$2.head(Iterator.scala:885)
at org.nlogo.compiler.ExpressionParser.recurse$1(ExpressionParser.scala:474)
at org.nlogo.compiler.ExpressionParser.delayBlock(ExpressionParser.scala:479)
at org.nlogo.compiler.ExpressionParser.parseExpressionInternal(ExpressionParser.scala:339)
at org.nlogo.compiler.ExpressionParser.org$nlogo$compiler$ExpressionParser$$parseArgExpression(ExpressionParser.scala:290)
at org.nlogo.compiler.ExpressionParser$$anonfun$parseArguments$1.apply$mcVI$sp(ExpressionParser.scala:96)
at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:81)
at org.nlogo.compiler.ExpressionParser.parseArguments(ExpressionParser.scala:95)
at org.nlogo.compiler.ExpressionParser.parseStatement(ExpressionParser.scala:80)
at org.nlogo.compiler.ExpressionParser.parse(ExpressionParser.scala:55)
at org.nlogo.compiler.CompilerMain$$anonfun$compile$1.apply(CompilerMain.scala:34)
at org.nlogo.compiler.CompilerMain$$anonfun$compile$1.apply(CompilerMain.scala:29)
at scala.collection.Iterator$class.foreach(Iterator.scala:772)
at scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:573)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
at scala.collection.JavaConversions$JCollectionWrapper.foreach(JavaConversions.scala:592)
at org.nlogo.compiler.CompilerMain$.compile(CompilerMain.scala:29)
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:531)
at org.nlogo.headless.HeadlessWorkspace.open(HeadlessWorkspace.scala:513)
at 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$1.apply(Lab.scala:33)
at org.nlogo.lab.Lab$$anonfun$1.apply(Lab.scala:33)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.immutable.Range.foreach(Range.scala:78)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
at scala.collection.immutable.Range.map(Range.scala:46)
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:197)
at org.nlogo.headless.Main$.main(Main.scala:14)
at org.nlogo.headless.Main.main(Main.scala)
答案 0 :(得分:1)
.nlogo文件似乎必须包含扩展声明而不是.nls文件。