From 797f52ea851860b38cee7b5b1848fda744f61007 Mon Sep 17 00:00:00 2001
From: Elbez Hammouda <hammoudae@gmail.com>
Date: Mon, 3 May 2021 16:28:29 +0200
Subject: [PATCH] Updated SimMongoLog

---
 .../emeraude/n2s3/features/logging/SimMongoLog.scala        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/SimMongoLog.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/SimMongoLog.scala
index e1e2df4..c6adb69 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/SimMongoLog.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/SimMongoLog.scala
@@ -292,7 +292,7 @@ class NeuronsPotentialLog(name : String,mongoCollection: MongoCollection[Documen
   override def process(message: Message, sender: ActorRef): Unit = message match {
     case NeuronPotentialResponse(timestamp, source, value) =>
       if (((System.currentTimeMillis() - globalTimestamps) * 1000) - time > 250){
-        time = (System.currentTimeMillis() - globalTimestamps) * 1000
+        time = (System.currentTimeMillis() - globalTimestamps) /1000
         documents = documents.::(Document("T" -> time,"L" -> source.actor.path.name.split(":")(0),
           "N" -> BsonInt32(Integer.valueOf(source.actor.path.name.split(":")(1))), "V" ->
             BsonDouble.apply(BigDecimal(value).setScale(6, BigDecimal.RoundingMode.HALF_UP).toDouble)))
@@ -337,7 +337,7 @@ class LabelMonitoring(n2s3 : N2S3, outputNeuron : Seq[NeuronGroupRef],mongoColle
 
   def receive = {
     case LabelChangeResponse(start, end, label) =>
-      time = (System.currentTimeMillis() - globalTimestamps) * 1000
+      time = (System.currentTimeMillis() - globalTimestamps) /1000
       GlobalLogVars.ActualInput = label
       GlobalLogVars.globalInput = GlobalLogVars.globalInput + 1
       documents = documents.::(Document("L" -> BsonInt32(Integer.valueOf(label)),"T" ->time,"G" -> GlobalLogVars.globalInput))
@@ -426,7 +426,7 @@ class SynapticWeight(list : Seq[Seq[Seq[ConnectionPath]]], refreshRate : Int = 1
             }
           })
 
-          documents = documents.::(Document("T" -> (System.currentTimeMillis() - globalTimestamps) * 1000, "C" -> v._1,"L" -> v._4.actor.path.name.split(":")(0), "To" -> v._2, "V" -> BsonDouble.apply(BigDecimal(v._3).setScale(6, BigDecimal.RoundingMode.HALF_UP).toDouble),"index" -> Document("x" -> x, "y" -> y)))})
+          documents = documents.::(Document("T" -> (System.currentTimeMillis() - globalTimestamps) / 1000 , "C" -> v._1,"L" -> v._4.actor.path.name.split(":")(0), "To" -> v._2, "V" -> BsonDouble.apply(BigDecimal(v._3).setScale(6, BigDecimal.RoundingMode.HALF_UP).toDouble),"index" -> Document("x" -> y, "y" -> x)))})
 
         valuesTmp = values
         values = List.empty
-- 
GitLab