[mod] made console output human readable
This commit is contained in:
@@ -2,7 +2,7 @@ package scim.components
|
|||||||
|
|
||||||
import scim.datastruct.{Cell, Group, SensorResult, SharedMemory, Time, Truth}
|
import scim.datastruct.{Cell, Group, SensorResult, SharedMemory, Time, Truth}
|
||||||
|
|
||||||
class Output(sharedMemory: SharedMemory) extends Runnable {
|
class Output(sharedMemory: SharedMemory, printOutput: Boolean = true) extends Runnable {
|
||||||
def run(): Unit = {
|
def run(): Unit = {
|
||||||
val outputBroadcast = sharedMemory.output
|
val outputBroadcast = sharedMemory.output
|
||||||
val duration = sharedMemory.config.duration
|
val duration = sharedMemory.config.duration
|
||||||
@@ -15,8 +15,19 @@ class Output(sharedMemory: SharedMemory) extends Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def outputData(time: Time, sensors: Map[Cell, Map[Group, Vector[SensorResult]]], groundTruths: Map[Cell, Map[Group, Truth]]): Unit = {
|
def outputData(time: Time, sensors: Map[Cell, Map[Group, Vector[SensorResult]]], groundTruths: Map[Cell, Map[Group, Truth]]): Unit = {
|
||||||
println("TICK: " + time)
|
println("\n\nTICK: " + time)
|
||||||
println(sensors)
|
if(!printOutput) return
|
||||||
println(groundTruths)
|
sensors.foreach(cells => {
|
||||||
|
val cell = cells._1
|
||||||
|
println("Cell: " + cell)
|
||||||
|
cells._2.foreach(groups => {
|
||||||
|
val group = groups._1
|
||||||
|
print("Group: " + group + " ")
|
||||||
|
groups._2.foreach(res => print(res.get._3.getOrElse("None") + " | "))
|
||||||
|
print("\n")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
//println(sensors)
|
||||||
|
//println(groundTruths)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user