2015-12-19 337 views
0

我目前有一個項目,我已經完成了使用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) 

回答

1

看起來.nlogo文件必須包含擴展聲明而不是.nls文件。