Documentation ¶
Overview ¶
go-neuron - A neuron simulator for Go.
Copyright (c) 2013 - Michael Nelson <absoludity@gmail.com>
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 <absoludity@gmail.com>
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 neuron implements a time-based neuron simulator. A neuron implements a simple interface that responds to additional potential being added at a point in time. If the additional potential over time reaches a threshold, the neuron fires and sends an activation event.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationEvent ¶
An ActivationEvent records the neuron and time at which it was activated.
type ActivationStream ¶
type ActivationStream chan ActivationEvent
An ActivationStream communicates the activation events for further processing.
func (*ActivationStream) Process ¶
func (as *ActivationStream) Process()
Process() processing the incoming activation events, by ordering them in a queue and then processing the queue. The function returns after the activation stream is closed and the queue is cleared.
func (*ActivationStream) ProcessUntilEmpty ¶
func (as *ActivationStream) ProcessUntilEmpty()
type Axon ¶
type Axon struct { Terminals []action_potential.ActionPotential Delay time.Duration }
An Axon can have many terminals connecting to other neurons and an associated delay between the neurons activation and when the signal reaches the terminals.
type Neuron ¶
type Neuron struct { Axon Axon ActivationStream *ActivationStream action_potential.ActionPotential }
A neuron itself is an ActionPotential implementation, together with a single Axon and an activation stream with which signals are communicated.
func (*Neuron) AddPotential ¶
func (n *Neuron) AddPotential(p action_potential.Potential) (action_potential.Potential, bool)
func (*Neuron) AddPotentialAt ¶
func (n *Neuron) AddPotentialAt(p action_potential.Potential, t time.Time) (action_potential.Potential, bool)
AddPotentialAt updates the default implementation provided by the embedded ActivationPotential ensuring that any resulting activation is communicated to the stream.
type OrderedList ¶
func (*OrderedList) Insert ¶
func (l *OrderedList) Insert(value interface{}) *list.Element
type TerminalEvent ¶
type TerminalEvent ActivationEvent
A TerminalEvent records the neuron and the time at which the signal reaches the axon terminals.