Documentation ¶
Overview ¶
go-neuron - A neuron simulator for Go.
Copyright (c) 2013 - Michael Nelson <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
go-neuron - A neuron simulator for Go.
Copyright (c) 2013 - Michael Nelson <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Package action_potential provides an interface and simple implementation of the short-lasting electrical event occuring in neurons. http://en.wikipedia.org/wiki/Action_potential
go-neuron - A neuron simulator for Go.
Copyright (c) 2013 - Michael Nelson <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
go-neuron - A neuron simulator for Go.
Copyright (c) 2013 - Michael Nelson <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
go-neuron - A neuron simulator for Go.
Copyright (c) 2013 - Michael Nelson <[email protected]>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index ¶
Constants ¶
const ( SIMPLE_DECAY_DURATION = 3 * time.Millisecond SIMPLE_ACTIVE_DURATION = 3 * time.Millisecond SIMPLE_INACTIVE_DURATION = 3 * time.Millisecond )
The Simple activates for a duration when the initial threshold is reached, then is inactive for a duration before switching back to deactivated.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccuracyAccumulator ¶
type AccuracyAccumulator struct { ActionPotential AverageDelta time.Duration Count int64 }
An AccuracyAggregator encapsulates an action potential and records the average skew
func NewAccuracyAccumulator ¶
func NewAccuracyAccumulator(ap ActionPotential) *AccuracyAccumulator
func (*AccuracyAccumulator) AddPotentialAt ¶
type ActionPotential ¶
type ActivationState ¶
type ActivationState int
const ( DEACTIVATED ActivationState = iota ACTIVATED INACTIVATED )
An ActionPotential can be deactivated, activated or inactivated.
func (ActivationState) String ¶
func (as ActivationState) String() string
type AddPotentialEvent ¶
type AlwaysFirer ¶
type AlwaysFirer struct {
ActionPotential
}
An AlwaysFirer encapsulates an action potential but fires on every call to AddPotentialAt().
func NewAlwaysFirer ¶
func NewAlwaysFirer(ap ActionPotential) *AlwaysFirer
func (*AlwaysFirer) AddPotential ¶
func (f *AlwaysFirer) AddPotential(p Potential) (Potential, bool)
func (*AlwaysFirer) AddPotentialAt ¶
type EventRecorder ¶
type EventRecorder struct { ActionPotential Events []AddPotentialEvent }
An EventRecorder encapsulates an action potential and records each AddPotential event that occurs.
func NewEventRecorder ¶
func NewEventRecorder(ap ActionPotential) *EventRecorder
func (*EventRecorder) AddPotential ¶
func (f *EventRecorder) AddPotential(p Potential) (Potential, bool)
func (*EventRecorder) AddPotentialAt ¶
type Potential ¶
type Potential float32
const ( REST_POTENTIAL Potential = 0 THRESHOLD_POTENTIAL Potential = 15 PEAK_POTENTIAL Potential = 100 REFRACTORY_POTENTIAL Potential = -15 )
Typically 15mV above the resting potential. Move these into a subclass perhaps, so it's possible to have different classes of neurons without requiring each neuron to include the values.
type PotentialState ¶
type PotentialState struct {
// contains filtered or unexported fields
}
PotentialState stores the data required to determine a potential at a given time (internally the state, the previous potential and the time at which the potential last changed.)
func (PotentialState) String ¶
func (ps PotentialState) String() string
type Simple ¶
type Simple struct {
PotentialState
}
The Simple is a simple implementation of the action potential interface.
func (*Simple) AddPotential ¶
AddPotential adds the specified potential based on the existing potential at the time it is called.
func (*Simple) AddPotentialAt ¶
AddPotentialAt adds the specified potential based on the existing potential at the specified time.
func (*Simple) GetPotential ¶
GetPotential determines and returns the potential at the time it is called.