Hi Jason, thanks for the answer. Where should I put the code? I tried to put it at the end of the code you told me, but I get an error:
------------------------------------------------------------------- ERROR ------------------------------------------------------------------- [error] /home/ubuntu/TFIA/Galapagos/app/models/ModelSaver.scala:31: ';' expected but '.' found. [error] -> org.nlogo.tortoise.JSIdentProvider(name) } [error] ^ [error] one error found [error] (compile:compile) Compilation failed [error] application - ! @6m31kbgl4 - Internal server error, for (GET) [/] -> play.PlayExceptions$CompilationException: Compilation error[';' expected but '.' found.] at play.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27) ~[na:na] at play.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27) ~[na:na] at scala.Option.map(Option.scala:145) ~[scala-library-2.11.6.jar:na] at play.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:49) ~[na:na] at play.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44) ~[na:na] [warn] play - No application found at invoker init ------------------------------------------------------------------- CODE ------------------------------------------------------------------- def apply(compiledModel: CompiledModel, jsURLs: Seq[URL] = Seq()): CompilationBundle = { val CompiledModel(js, model, _, _, _) = compiledModel val widgets = model.widgets map CompiledWidget.compile(compiledModel) val depsJS = jsURLs map slurpURL mkString("", ";\n", ";\n") CompilationBundle(js, depsJS, Json.toJson(widgets).toString, model.code, model.info) * val nlToJSIdentMap = compiledModel.procedures.map { case (name, _) => name* * -> org.nlogo.tortoise.JSIdentProvider(name) }* } Other question: if I try to synchronize the UI between different sessions, should I share the model or the world every time I send the "synchronize" instruction? Thanks, On Saturday, April 25, 2015 at 11:12:32 PM UTC-6, Oscar Martinez wrote: > > Hi, > > I have been investigating about Galapagos/Tortoise, because my idea it's > to connect two different session of Tortoise through Web Sockets. By the > moment, I have gotten take a pre-compiled model and modify it to have two > different sessions using NodeJS. I also have a local intance of Galapagos, > running and generating savable JS tortoise models. > > The new step in my project is to modified the JS code generated by > Galapagos to add my custom code, automatically. But, I haven't found where > the .nlogo code is compiled. I have checked the scala files, and I pretty > sure it's near of <models.ModelCollectionCompiler> in line 36 > <CompiledModel.fromNlogoContents(contents).map(ModelSaver(_))>, but I > haven't understand exactly what's next. > > Kind regards, > -- You received this message because you are subscribed to the Google Groups "netlogo-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.