@@ -614,22 +614,24 @@ public void register(Activation act) {
614614
615615 Document doc = act .doc ;
616616 INeuron .ThreadState th = ak .node .neuron .get ().getThreadState (doc .threadId , true );
617- if (th .activations .isEmpty ()) {
618- doc .activatedNeurons .add (ak .node .neuron .get ());
619- }
620- th .activations .put (ak , act );
617+ if (!th .activations .containsKey (ak )) {
618+ if (th .activations .isEmpty ()) {
619+ doc .activatedNeurons .add (ak .node .neuron .get ());
620+ }
621+ th .activations .put (ak , act );
621622
622- TreeMap <NodeActivation .Key , Activation > actEnd = th .activationsEnd ;
623- if (actEnd != null ) actEnd .put (ak , act );
623+ TreeMap <NodeActivation .Key , Activation > actEnd = th .activationsEnd ;
624+ if (actEnd != null ) actEnd .put (ak , act );
624625
625- TreeMap <NodeActivation .Key , Activation > actRid = th .activationsRid ;
626- if (actRid != null ) actRid .put (ak , act );
626+ TreeMap <NodeActivation .Key , Activation > actRid = th .activationsRid ;
627+ if (actRid != null ) actRid .put (ak , act );
627628
628- if (ak .rid != null ) {
629- doc .activationsByRid .put (ak , act );
630- }
629+ if (ak .rid != null ) {
630+ doc .activationsByRid .put (ak , act );
631+ }
631632
632- doc .addedActivations .add (act );
633+ doc .addedActivations .add (act );
634+ }
633635
634636 linkActivation (act );
635637 }
0 commit comments