Skip to content

Instantly share code, notes, and snippets.

@qiemem
Created August 23, 2014 04:25
Show Gist options
  • Select an option

  • Save qiemem/5a0360c30d27416b0913 to your computer and use it in GitHub Desktop.

Select an option

Save qiemem/5a0360c30d27416b0913 to your computer and use it in GitHub Desktop.
val wolfSheep = Source.fromFile("public/modelslib/Sample Models/Biology/Wolf Sheep Predation.nlogo").mkString
val wsModelV = CompiledModel.fromNlogoContents(wolfSheep)
val wsModel = wsModelV valueOr { e => fail(modelShouldHaveCompiled(e)) }
private val modelShouldHaveCompiled = (failures: NonEmptyList[CompilerException]) =>
s"""|Model should have compiled but failed with the following messages:
|${failures.stream.mkString("\n")}""".stripMargin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment