我有一個Scala的名單,我試圖將它傳遞給我的NetLogo模型:如何在斯卡拉列表傳遞給的NetLogo
> myscalalist
List(2015-01, 2015-02)
我想這一點:
App.app.command("set months " + myscalalist)
,但我得到在我的ABM類的47行錯誤:
Illegal number format at position 54 in
at org.nlogo.lex.Tokenizer.tokenize(Tokenizer.scala:30)
at org.nlogo.lex.Tokenizer.tokenize(Tokenizer.scala:26)
at org.nlogo.compiler.CompilerMain$.compile(CompilerMain.scala:23)
at org.nlogo.compiler.Compiler$.compileMoreCode(Compiler.scala:34)
at org.nlogo.workspace.Evaluator.org$nlogo$workspace$Evaluator$$invokeCompiler(Evaluator.scala:175)
at org.nlogo.workspace.Evaluator.evaluateCommands(Evaluator.scala:18)
at org.nlogo.workspace.AbstractWorkspaceTraits$Evaluating$class.evaluateCommands(AbstractWorkspaceScala.scala:163)
at org.nlogo.workspace.AbstractWorkspaceScala.evaluateCommands(AbstractWorkspaceScala.scala:19)
at org.nlogo.app.App.command(App.scala:849)
at main.jago.ABM$$anonfun$simulate$1.apply(ABM.scala:47)
是否有任何建議,從Scala的應用程序通過安全列表的NetLogo?
命令方法的簽名是什麼?它期望什麼? –
好點,我必須檢查 – user299791
看起來像它期望一個字符串 – user299791