Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Link Class Reference

Abstraction of a connection between two neurons. More...

#include <Link.h>

Collaboration diagram for Link:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Link (Neuron *to, Neuron *from)
 Creates a link between two neurons.

 Link (Neuron *to, Neuron *from, real weight)
 Creates a link between two neurons.

virtual ~Link ()
 Destroys the link.

NeurongetSource () const
 Pointer to the source neuron.

NeurongetDestination () const
 Pointer to the destination neuron.

real getWeight () const
 Returns the weight of the link.

void setWeight (real weight)
 Sets the weight of the link.

void setDeltaWeight (real delta)
 Sets the change in weight of the link The actual change is made only when updateWeight is called.

void updateWeight ()
 Updates the weight of the link.

bool isEqualTo (Link *l)
 Finds if two links are equivalent.

real getLastDeltaWeight ()
 Get the current delta.


Detailed Description

Abstraction of a connection between two neurons.

A connection has a source, destination and a weight. The source's output is taken as input by the destination


Constructor & Destructor Documentation

Link Neuron to,
Neuron from
 

Creates a link between two neurons.

Weight assigned is a random value between -1 and +1

Parameters:
to The destination neuron
from The source neuron

Link Neuron to,
Neuron from,
real  weight
 

Creates a link between two neurons.

Parameters:
to The destination neuron
from The source neuron
weight The weight of the connection

virtual ~Link  )  [virtual]
 

Destroys the link.

When doing so, removes the link from the _outputLinks of the source neuron and the _inputLinks of the destination neuron


Member Function Documentation

Neuron* getDestination  )  const
 

Pointer to the destination neuron.

real getLastDeltaWeight  ) 
 

Get the current delta.

If updateWeight was called, this will be zero. Otherwise the result will be last value set by setDeltaWeight

Neuron* getSource  )  const
 

Pointer to the source neuron.

real getWeight  )  const
 

Returns the weight of the link.

bool isEqualTo Link l  ) 
 

Finds if two links are equivalent.

Two links are considered equivalent if they are between the same two neurons, irrespective of the weight

Returns:
true if equivalent, false if not

void setDeltaWeight real  delta  ) 
 

Sets the change in weight of the link The actual change is made only when updateWeight is called.

See also:
updateWeight

void setWeight real  weight  ) 
 

Sets the weight of the link.

void updateWeight  ) 
 

Updates the weight of the link.

New weight = old weight + value set by setDeltaWeight Then it resets the change in weight so successive calls to updateWeight have no adverse effect.

See also:
setDeltaWeight


The documentation for this class was generated from the following file:
Generated on Fri Jun 18 13:19:08 2004 for Annie by doxygen 1.3.5