func NewSpikingNeuron(a, b, c, d float64, id int64, redisConnection redis.Conn) *SpikingNeuron { spikeRateMap := make(map[float64]float64) spikeMap := []float64{} return &SpikingNeuron{ a: a, b: b, c: c, d: d, V: vars.GetDefaultV(), u: b * vars.GetDefaultV(), input: 0, outputs: nil, spikes: 0, redisConnection: redisConnection, spikeRateMap: spikeRateMap, spikeMap: spikeMap, predicate: nil, success: nil, fail: nil, inputPredicate: nil, inputSuccess: nil, inputFail: nil, id: id, connections: nil, } }
func (this *SpikingNeuron) ResetParameters(a, b, c, d float64) { this.a = a this.b = b this.c = c this.d = d this.V = vars.GetDefaultV() this.u = b * vars.GetDefaultV() this.outputs = nil this.input = 0 this.spikes = 0 }