From 8cae2c2a876cb09f5e8724b1b107bd9326f1c9b5 Mon Sep 17 00:00:00 2001
From: guille <guillermopolito@gmail.com>
Date: Thu, 27 Oct 2016 17:48:06 +0200
Subject: [PATCH] Moved Neuron events close to Neuron

---
 .../cristal/emeraude/n2s3/core/Neuron.scala      | 10 ++++++++--
 .../emeraude/n2s3/core/actors/InputNeuron.scala  |  3 +--
 .../n2s3/core/event/NeuronFireEvent.scala        |  8 --------
 .../n2s3/core/event/NeuronFireResponse.scala     | 11 -----------
 .../n2s3/core/event/NeuronUpdateEvent.scala      |  8 --------
 .../n2s3/core/event/SynapseUpdateEvent.scala     |  8 --------
 .../features/io/report/BenchmarkMonitor.scala    |  2 +-
 .../n2s3/features/learning/SpikeCounter.scala    |  2 +-
 .../n2s3/features/logging/NeuronLog.scala        |  5 ++---
 .../n2s3/features/logging/SpikeMonitor.scala     |  2 +-
 .../emeraude/n2s3/models/bio/LIFNeuron.scala     |  6 ++----
 .../emeraude/n2s3/models/bio/SRM2Neuron.scala    |  5 ++---
 .../emeraude/n2s3/models/bio/SRMNeuron.scala     |  5 ++---
 .../IntegrateAndFireNeuron.scala                 |  3 +--
 .../emeraude/n2s3/models/izhikevich/Neuron.scala |  3 +--
 .../emeraude/n2s3/models/qbg/QBGNeuron.scala     |  3 +--
 .../n2s3/models/ternary_synapse/Neuron.scala     | 14 ++------------
 .../emeraude/n2s3/apps/ExampleFreeWay.scala      |  2 +-
 .../emeraude/n2s3/apps/bio/Masquelier.scala      |  2 +-
 .../emeraude/n2s3/apps/bio/SmallReservoir.scala  |  2 +-
 .../emeraude/n2s3/apps/ternary/BitStream.scala   | 16 ++++++++--------
 .../n2s3/apps/ternary/PatternStart.scala         |  2 +-
 22 files changed, 37 insertions(+), 85 deletions(-)
 delete mode 100644 n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronFireEvent.scala
 delete mode 100644 n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronFireResponse.scala
 delete mode 100644 n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronUpdateEvent.scala
 delete mode 100644 n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/SynapseUpdateEvent.scala

diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/Neuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/Neuron.scala
index 5c6924f5..9598e625 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/Neuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/Neuron.scala
@@ -9,9 +9,8 @@ import fr.univ_lille.cristal.emeraude.n2s3.core.NetworkEntity.AskReference
 import fr.univ_lille.cristal.emeraude.n2s3.core.NeuronConnection.ConnectionEnds
 import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.{Done, SynchronizedMessage}
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.WrapMessage
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
-import fr.univ_lille.cristal.emeraude.n2s3.support.event.{Observable, ObservableMessage}
+import fr.univ_lille.cristal.emeraude.n2s3.support.event.{Event, EventResponse, Observable, ObservableMessage}
 
 import scala.collection.mutable
 import scala.language.postfixOps
@@ -162,6 +161,13 @@ object Neuron {
         throw new RuntimeException("can't send message with past timestamp")
     }
   }
+
+ /********************************************************************************************************************
+  * Events
+  ******************************************************************************************************************/
+
+ object NeuronFireEvent extends Event[NeuronFireResponse]
+  case class NeuronFireResponse(timestamp : Timestamp, source : NetworkEntityPath) extends EventResponse
 }
 
 trait NeuronModel {
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/actors/InputNeuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/actors/InputNeuron.scala
index cf99b47c..30b78a06 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/actors/InputNeuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/actors/InputNeuron.scala
@@ -1,9 +1,8 @@
 package fr.univ_lille.cristal.emeraude.n2s3.core.actors
 
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.NeuronEnds
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{NeuronEnds, NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties.SynapticWeightFloat
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
 
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronFireEvent.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronFireEvent.scala
deleted file mode 100644
index 40d4c5fd..00000000
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronFireEvent.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-package fr.univ_lille.cristal.emeraude.n2s3.core.event
-
-import fr.univ_lille.cristal.emeraude.n2s3.support.event.Event
-
-/**
-  * Created by guille on 10/14/16.
-  */
-object NeuronFireEvent extends Event[NeuronFireResponse]
\ No newline at end of file
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronFireResponse.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronFireResponse.scala
deleted file mode 100644
index e66d9b50..00000000
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronFireResponse.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-package fr.univ_lille.cristal.emeraude.n2s3.core.event
-
-import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
-import fr.univ_lille.cristal.emeraude.n2s3.core.NetworkEntityPath
-import fr.univ_lille.cristal.emeraude.n2s3.support.event.EventResponse
-
-/********************************************************************************************************
- *  Event triggered when a neuron fire
- *******************************************************************************************************/
-
-case class NeuronFireResponse(timestamp : Timestamp, source : NetworkEntityPath) extends EventResponse
\ No newline at end of file
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronUpdateEvent.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronUpdateEvent.scala
deleted file mode 100644
index 06439a34..00000000
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/NeuronUpdateEvent.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-package fr.univ_lille.cristal.emeraude.n2s3.core.event
-
-import fr.univ_lille.cristal.emeraude.n2s3.support.event.{Event, EventTriggered}
-
-/***************************************************************************************************
- *  Event triggered when update arise in neuron
- **************************************************************************************************/
-abstract class NeuronUpdateEvent extends Event[EventTriggered.type]
\ No newline at end of file
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/SynapseUpdateEvent.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/SynapseUpdateEvent.scala
deleted file mode 100644
index 4b4a3236..00000000
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/core/event/SynapseUpdateEvent.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-package fr.univ_lille.cristal.emeraude.n2s3.core.event
-
-import fr.univ_lille.cristal.emeraude.n2s3.support.event.{Event, EventTriggered}
-
-/***************************************************************************************************
- * Event triggered when update arise in synapse
- **************************************************************************************************/
-abstract class SynapseUpdateEvent(val connectionId : Int) extends Event[EventTriggered.type]
\ No newline at end of file
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/io/report/BenchmarkMonitor.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/io/report/BenchmarkMonitor.scala
index b035870d..a370d94d 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/io/report/BenchmarkMonitor.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/io/report/BenchmarkMonitor.scala
@@ -8,9 +8,9 @@ import java.io.{File, PrintWriter}
 
 import akka.actor.Actor
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
 import fr.univ_lille.cristal.emeraude.n2s3.core._
-import fr.univ_lille.cristal.emeraude.n2s3.core.event._
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
 import fr.univ_lille.cristal.emeraude.n2s3.support.event.{Subscribe, Unsubscribe}
 
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/learning/SpikeCounter.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/learning/SpikeCounter.scala
index b6038040..ec729531 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/learning/SpikeCounter.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/learning/SpikeCounter.scala
@@ -1,9 +1,9 @@
 package fr.univ_lille.cristal.emeraude.n2s3.features.learning
 
 import akka.actor.Actor
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.WrapMessage
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
 import fr.univ_lille.cristal.emeraude.n2s3.support.event.Subscribe
 
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/NeuronLog.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/NeuronLog.scala
index 3f9436d6..403db2a1 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/NeuronLog.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/NeuronLog.scala
@@ -6,10 +6,10 @@ import java.nio.file.Paths
 import akka.actor.Actor
 import akka.util.Timeout
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias.Timestamp
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitTime._
 import fr.univ_lille.cristal.emeraude.n2s3.core._
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.features.logging.graph.{InputOutputGraph, NeuronsGraph, ValuesGraph}
 import fr.univ_lille.cristal.emeraude.n2s3.models.qbg.NeuronPotentialResponse
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.{ActorCompanion, PropsBuilder, SinglePropsBuilder}
@@ -124,13 +124,12 @@ class NeuronsPotentialsLogGraph(step: Int = 50, unit: TimeUnitType = MilliSecond
   val graph = new ValuesGraph
   var lastT = 0L
   def receive = {
-    case NeuronPotentialResponse(timestamp, source, value) => {
+    case NeuronPotentialResponse(timestamp, source, value) =>
       if (timestamp - lastT > step) {
         graph.refreshSerie(source.path.name, convert(unit, Time(timestamp)), value)
         if (!(graph isRunning()))
           graph.launch()
         lastT = timestamp
       }
-    }
   }
 }
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/SpikeMonitor.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/SpikeMonitor.scala
index 86bf8156..5c0a1f4d 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/SpikeMonitor.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/features/logging/SpikeMonitor.scala
@@ -3,10 +3,10 @@ package fr.univ_lille.cristal.emeraude.n2s3.features.logging
 import akka.actor.{Actor, Props}
 import akka.pattern.ask
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias.Timestamp
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.Config
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.N2S3
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.LocalActorDeploymentStrategy
 import fr.univ_lille.cristal.emeraude.n2s3.support.event.Subscribe
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/LIFNeuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/LIFNeuron.scala
index be416363..0a5901ee 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/LIFNeuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/LIFNeuron.scala
@@ -2,18 +2,16 @@ package fr.univ_lille.cristal.emeraude.n2s3.models.bio
 
 import fr.univ_lille.cristal.emeraude.n2s3.core
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds}
-import fr.univ_lille.cristal.emeraude.n2s3.core._
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds, NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
+import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{ShapelessSpike, WeightedSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties._
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.synapse.FloatSynapse
 import fr.univ_lille.cristal.emeraude.n2s3.features.learning.{LTDUntil, LTPUntil}
 import fr.univ_lille.cristal.emeraude.n2s3.models.qbg._
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
 
-import scala.collection.mutable
 import scala.math._
 
 /**
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/SRM2Neuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/SRM2Neuron.scala
index 213672bb..83e983e6 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/SRM2Neuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/SRM2Neuron.scala
@@ -2,11 +2,10 @@ package fr.univ_lille.cristal.emeraude.n2s3.models.bio
 
 import fr.univ_lille.cristal.emeraude.n2s3.core
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias.Timestamp
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{NeuronEnds, NeuronMessage}
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{NeuronEnds, NeuronFireEvent, NeuronFireResponse, NeuronMessage}
+import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{ShapelessSpike, WeightedSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties.{MembraneThresholdFloat, SynapticWeightFloat}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.synapse.FloatSynapse
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/SRMNeuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/SRMNeuron.scala
index 395ddcf9..cba99790 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/SRMNeuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/bio/SRMNeuron.scala
@@ -2,11 +2,10 @@ package fr.univ_lille.cristal.emeraude.n2s3.models.bio
 
 import fr.univ_lille.cristal.emeraude.n2s3.core
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds}
-import fr.univ_lille.cristal.emeraude.n2s3.core._
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds, NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
+import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{ShapelessSpike, WeightedSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties.{MembraneThresholdFloat, MembraneThresholdType, MembraneThresholdTypeEnum, SynapticWeightFloat}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.synapse.FloatSynapse
 import fr.univ_lille.cristal.emeraude.n2s3.models.qbg._
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/integrate_and_fire/IntegrateAndFireNeuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/integrate_and_fire/IntegrateAndFireNeuron.scala
index dc66342c..49836d21 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/integrate_and_fire/IntegrateAndFireNeuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/integrate_and_fire/IntegrateAndFireNeuron.scala
@@ -1,9 +1,8 @@
 package fr.univ_lille.cristal.emeraude.n2s3.models.integrate_and_fire
 
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.NeuronEnds
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{NeuronEnds, NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core._
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
 
 /**
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/izhikevich/Neuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/izhikevich/Neuron.scala
index a99ff9ca..b0f6a40b 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/izhikevich/Neuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/izhikevich/Neuron.scala
@@ -6,10 +6,9 @@ package fr.univ_lille.cristal.emeraude.n2s3.models.izhikevich
 
 import fr.univ_lille.cristal.emeraude.n2s3.core
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias.Timestamp
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds}
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds, NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{ShapelessSpike, WeightedSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties.SynapticWeightFloat
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.synapse.FloatSynapse
 import fr.univ_lille.cristal.emeraude.n2s3.models.qbg.{BackwardSpike, QBGNeuronConnection}
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/qbg/QBGNeuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/qbg/QBGNeuron.scala
index fb936a74..a3d08fe8 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/qbg/QBGNeuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/qbg/QBGNeuron.scala
@@ -5,11 +5,10 @@
 package fr.univ_lille.cristal.emeraude.n2s3.models.qbg
 
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds}
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds, NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{NetworkEntityActor, ShapelessSpike, WeightedSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties.{MembraneThresholdTypeEnum, _}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.synapse.FloatSynapse
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
diff --git a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/ternary_synapse/Neuron.scala b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/ternary_synapse/Neuron.scala
index c8cf2955..4ca147c8 100644
--- a/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/ternary_synapse/Neuron.scala
+++ b/n2s3/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/models/ternary_synapse/Neuron.scala
@@ -6,27 +6,17 @@ package fr.univ_lille.cristal.emeraude.n2s3.models.ternary_synapse
 
 import fr.univ_lille.cristal.emeraude.n2s3.core
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
-import fr.univ_lille.cristal.emeraude.n2s3.core._
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.Inhibition
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.NeuronEnds
-import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds}
-import fr.univ_lille.cristal.emeraude.n2s3.core.NeuronConnection.ConnectionEnds
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.{Inhibition, NeuronEnds, NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
+import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{ShapelessSpike, WeightedSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.{NeuronFireEvent, NeuronFireResponse}
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties._
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.synapse.FloatSynapse
-import fr.univ_lille.cristal.emeraude.n2s3.core.models.synapse.WeightedSynapse
-import fr.univ_lille.cristal.emeraude.n2s3.core.models.synapse.{FloatSynapse, WeightedSynapse}
 import fr.univ_lille.cristal.emeraude.n2s3.features.learning.{LTDUntil, LTPUntil}
-import fr.univ_lille.cristal.emeraude.n2s3.features.logging.STDPImageGenerator
 import fr.univ_lille.cristal.emeraude.n2s3.models.qbg.{NeuronPotentialEvent, NeuronPotentialResponse, QBGParameters}
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
-import squants.electro.ElectricPotential
-import squants.electro.ElectricPotentialConversions.ElectricPotentialConversions
 
 import scala.math._
-import scala.util.Random
 
 object Neuron extends NeuronModel {
   override def createNeuron(): Neuron = new Neuron()
diff --git a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ExampleFreeWay.scala b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ExampleFreeWay.scala
index 8e51052d..8a0b647b 100644
--- a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ExampleFreeWay.scala
+++ b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ExampleFreeWay.scala
@@ -3,11 +3,11 @@ package fr.univ_lille.cristal.emeraude.n2s3.apps
 
 import akka.actor.Props
 import akka.pattern.ask
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.Config
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties._
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.connection.types.FullConnection
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.{InputOutputGraphNetworkObserver, N2S3}
diff --git a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/bio/Masquelier.scala b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/bio/Masquelier.scala
index a2f3f97e..ee952116 100644
--- a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/bio/Masquelier.scala
+++ b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/bio/Masquelier.scala
@@ -5,10 +5,10 @@ import java.io.{File, PrintWriter}
 import akka.actor.Props
 import akka.pattern.ask
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias.Timestamp
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{Config, ShapelessSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties.{MembraneThresholdFloat, MembraneThresholdType, MembraneThresholdTypeEnum}
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.N2S3
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.connection.types.FullConnection
diff --git a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/bio/SmallReservoir.scala b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/bio/SmallReservoir.scala
index 7455516d..50159d61 100644
--- a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/bio/SmallReservoir.scala
+++ b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/bio/SmallReservoir.scala
@@ -5,11 +5,11 @@ import java.io.{File, PrintWriter}
 import akka.actor.Props
 import akka.pattern.ask
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias._
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{Config, ShapelessSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties._
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.N2S3
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.connection.types.RandomConnection
diff --git a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ternary/BitStream.scala b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ternary/BitStream.scala
index f05cb32c..bbea2fe1 100644
--- a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ternary/BitStream.scala
+++ b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ternary/BitStream.scala
@@ -3,27 +3,27 @@ package fr.univ_lille.cristal.emeraude.n2s3.apps.ternary
 import java.io.{File, PrintWriter}
 
 import akka.actor.Props
+import akka.pattern.ask
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias.Timestamp
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.NeuronFireEvent
+import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
 import fr.univ_lille.cristal.emeraude.n2s3.core._
+import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{Config, ShapelessSpike}
+import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties._
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.N2S3
-import fr.univ_lille.cristal.emeraude.n2s3.features.builder.connection.types.{FullConnection, ManualConnection}
+import fr.univ_lille.cristal.emeraude.n2s3.features.builder.connection.types.ManualConnection
 import fr.univ_lille.cristal.emeraude.n2s3.features.io.input._
 import fr.univ_lille.cristal.emeraude.n2s3.features.logging.{NeuronsFireLogText, NeuronsPotentialLogText}
 import fr.univ_lille.cristal.emeraude.n2s3.models.qbg.NeuronPotentialEvent
-import fr.univ_lille.cristal.emeraude.n2s3.models.ternary_synapse.{FixedSynapse, InhibitorConnection, Neuron, Synapse}
+import fr.univ_lille.cristal.emeraude.n2s3.models.ternary_synapse.{FixedSynapse, Neuron}
 import fr.univ_lille.cristal.emeraude.n2s3.support.actors.LocalActorDeploymentStrategy
+import fr.univ_lille.cristal.emeraude.n2s3.support.event.Subscribe
 import fr.univ_lille.cristal.emeraude.n2s3.support.io.{InputSeq, N2S3Input, N2S3InputEnd, N2S3InputSpike}
 
 import scala.collection.mutable.ListBuffer
 import scala.concurrent.Await
 import scala.util.Random
-import akka.pattern.ask
-import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
-import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{Config, ShapelessSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.NeuronFireEvent
-import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties._
-import fr.univ_lille.cristal.emeraude.n2s3.support.event.Subscribe
 /**
   * Created by falezp on 14/10/16.
   */
diff --git a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ternary/PatternStart.scala b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ternary/PatternStart.scala
index 44aeb1d2..2ab105e8 100644
--- a/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ternary/PatternStart.scala
+++ b/n2s3_examples/src/main/scala/fr/univ_lille/cristal/emeraude/n2s3/apps/ternary/PatternStart.scala
@@ -5,11 +5,11 @@ import java.io.{File, PrintWriter}
 import akka.actor.Props
 import akka.pattern.ask
 import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias.Timestamp
+import fr.univ_lille.cristal.emeraude.n2s3.core.Neuron.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.core.Synchronizer.Done
 import fr.univ_lille.cristal.emeraude.n2s3.core.UnitCast._
 import fr.univ_lille.cristal.emeraude.n2s3.core._
 import fr.univ_lille.cristal.emeraude.n2s3.core.actors.{Config, ShapelessSpike}
-import fr.univ_lille.cristal.emeraude.n2s3.core.event.NeuronFireEvent
 import fr.univ_lille.cristal.emeraude.n2s3.core.models.properties.MembraneThresholdFloat
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.N2S3
 import fr.univ_lille.cristal.emeraude.n2s3.features.builder.connection.types.FullConnection
-- 
GitLab