[mod][fix] modified config to be more sane and fixed output thread

This commit is contained in:
2020-01-29 01:19:11 -06:00
parent a7817d04ec
commit 86e383922d
2 changed files with 18 additions and 29 deletions

View File

@@ -17,28 +17,17 @@ object Main {
val simBehavirous = SimulationBehaviours(behaviours)
def main(args: Array[String]): Unit = {
val config = "docs/wiki/config/config.yml"
val list: Map[String, Any] = yml.parse(config)
new SimulationConfigParser(list, simBehavirous).parse()
// println(printUtil.indentCollection(list.toString()).toString)
//new Test2().run()
val parlist: Map[String, Int] = Map("a" -> 1, "b" -> 1, "c" -> 1, "d" -> 1)
val v: Vector[Int] = Vector(1,2,3,4,5,6,7)
//lib.evalUtil.time("par", parlist.par.map({_ => Thread.sleep(10); 2}))
//lib.evalUtil.time("ser", parlist.map({_ => Thread.sleep(10); 2}))
//startSimulation()
startSimulation()
}
def startSimulation(): Unit = {
val config = new Parser().parse("docs/wiki/config/config.yml", simBehavirous).get
val config = new Parser().parse("docs/wiki/config/config.yml", simBehavirous)
val sharedMemory = config.sharedMemory
val output = new Output(sharedMemory)
val outputThread = new Thread(output)
val simulator = new Simulation(config)
for(_ <- 0 to sharedMemory.config.runs) {
val outputThread = new Thread(output)
outputThread.start()
simulator.start()
outputThread.join()