~mwshinn/+junk/structure

« back to all changes in this revision

Viewing changes to LearnCalcium.cpp

  • Committer: Max Shinn
  • Date: 2013-07-23 18:10:00 UTC
  • Revision ID: trombonechamp@gmail.com-20130723181000-cxyyrd2i7ql27vfb
Complete potential synapse based model with casting bug fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
*/
47
47
void LearnCalcium::learn(annarSynapse *synapse){
48
48
 
49
 
        FLOAT pre_ca=((CalciumNeuron*)(synapse->getPre()))->getCa();
 
49
        FLOAT pre_ca=((CalciumLGNNeuron*)(synapse->getPre()))->getCa();
50
50
        FLOAT pre_ca_mean=((PopulationCalcium*)(synapse->getPre()->getPopulation()))->getCa_mean();
51
51
        FLOAT weight=synapse->getValue();
52
52
 
66
66
        } else {
67
67
                deltaWeight = 0;
68
68
        }
 
69
    if (deltaWeight + weight < 0) deltaWeight = -weight; // Don't let it go below zero
69
70
 
70
71
        synapse->incValue(deltaWeight); // Increase the weight
71
72
}