Nano Brain for Unity

AUTHOR
Version v0.1

Table of Contents

Table of contents

Nano Brain for Unity

Table of Contents

Installation 

Package Installation
You can import the NanoBrain Ant package in Unity directly with the Package Manager git package importer.
See Unity: Installing from a Git URL
Use the link from 'Clone with HTTP' (for example: https://git.passer.life/CreatureControl/Ant.git) In this way you can always retrieve the latest version by pressing the Update button in the Package Manager.
Optionally, you can use a tag to retrieve a specific version. For example: https://git.passer.life/CreatureControl/Ant.git#0.1.0. This will give you a stable version which does not change. Updating can be done by retrieving the package with a link to a new release.
Samples Installation
In the Unity Package manager, select the NanoBrain Ant package and look for the Samples  tab in the details pane on the right. There you can import the Models . 

NanoBrain
 Documentation is found in the Documentation folder 

Hierarchical Index
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
NanoBrain.Brain	pagenum
NanoBrain.ClusterPrefab	pagenum
NanoBrain.Nucleus	pagenum
NanoBrain.Cluster	pagenum
NanoBrain.Neuron	pagenum
NanoBrain.MemoryCell	pagenum

NanoBrain.Synapse	pagenum

Class Index
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
NanoBrain.Brain (The NanoBrain Unity Componnent ) 	pagenum
NanoBrain.Cluster (A Cluster combines a collection of Nuclei to implement reusable behaviour ) 	pagenum
NanoBrain.ClusterPrefab (The Unity ScriptableObject to implement re-usable Cluster Prefabs ) 	pagenum
NanoBrain.MemoryCell (A MemoryCell stored its value for one update ) 	pagenum
NanoBrain.Neuron (A neuron is a basic Nucleus ) 	pagenum
NanoBrain.Nucleus (A Nucleus is a basic element in a brain cluster ) 	pagenum
NanoBrain.Synapse (A Synapse connects the ouput of a Neuron to another Neuron ) 	pagenum

Namespace Documentation
NanoBrain Namespace Reference

The Nanobrain namespace. 
Classes
class BrainThe NanoBrain Unity Componnent. 
class ClusterA Cluster combines a collection of Nuclei to implement reusable behaviour. 
class ClusterPrefabThe Unity ScriptableObject to implement re-usable Cluster Prefabs. 
class MemoryCellA MemoryCell stored its value for one update. 
class NeuronA neuron is a basic Nucleus. 
class NucleusA Nucleus is a basic element in a brain cluster. 
class SynapseA Synapse connects the ouput of a Neuron to another Neuron. 

Detailed Description
The Nanobrain namespace. 

Class Documentation
NanoBrain.Brain Class Reference

Description
The NanoBrain Unity Componnent. 
This implements the top-level NanoBrain Cluster 

Inherits MonoBehaviour.
Static Public Member Functions
static void UpdateWeight (Cluster brain, string name, float weight)
Update the weight for all Synapses coming from the Neuron with the given name. 

Public Attributes
ClusterPrefab brainPrefab
The Cluster prefab from which the cluster is created. 

Properties
Cluster brain [get]
The cluster isntance. 

Member Function Documentation
static void NanoBrain.Brain.UpdateWeight (Cluster  brain, string  name, float  weight)[static]

Update the weight for all Synapses coming from the Neuron with the given name. 

Parameters
brain 	The cluster in which the synapses are updated	
name 	The name of the Neuron for which the weights are updated	
weight 	The new Synapse weight	

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Brain.cs

NanoBrain.Cluster Class Reference

Description
A Cluster combines a collection of Nuclei to implement reusable behaviour. 
A Cluster is an instantiation of a ClusterPrefab. Clusters can be nested inside other clusters. 
Inheritance diagram for NanoBrain.Cluster:
IMAGE
Public Types
enum Type { None, Neuron, MemoryCell, Cluster }
Function to clone a nucleus to a Cluster prefab. 
Public Member Functions
Cluster (ClusterPrefab prefab, Cluster parent)
Instantiate a new copy of a ClusterPrefab in the given parent. 

Cluster (ClusterPrefab prefab, ClusterPrefab parent=null)
Add a new cluster to a ClusterPrefab. 

override Nucleus ShallowCloneTo (Cluster parent)
Toggle for printing debugging trace data.   

void AddInstance ()
Increase the number of instances in an multi-cluster. 

void AddInstance (ClusterPrefab prefab)
Create an new instance in a multi-cluster. 

void RemoveInstance ()
Decrease the number of instance in a multi-cluster. 

void RefreshComputeOrders ()
Refresh the order in which neurons should be computed. 

void RefreshOutputs ()
Reset the list of outputs such that they will be re-determined. 

bool TryGetNucleus (string nucleusName, out Nucleus foundNucleus)
Try to find a nucleus in this cluster. 

Nucleus GetNucleus (string nucleusName)
Get a nucleus in this cluster. 

Neuron GetNeuron (string neuronName)
Get a neuron in this cluster. 

Neuron GetNeuron (int thingId, string neuronName, string thingName=null)
Get a neuron in an instance of a multi-cluster. 

bool DeleteNucleus (Nucleus nucleus)
Delete a nucleus from this clsuter. 

virtual List< Nucleus > CollectReceivers (bool removeDuplicates=false)
Collect all receiving nuclei of signals from this cluster. 

List< Synapse > CollectSynapsesTo (Cluster otherCluster)
Collect all connections to receivers of signals from this cluster. 

void UpdateFromNucleus (Nucleus startNucleus)
Update the state of the nucleus and all nuclei receiving from it. 

override void UpdateStateIsolated ()
Update the state without updating other Nuclei.   

void Refresh ()
Recalculate derived properties. 

virtual void UpdateNuclei ()
Update the state and recursively all Nuclei receiving data from this Nucleus. 

Static Public Member Functions
static int GetNucleusIndex (List< Nucleus > nuclei, Nucleus nucleus)
Get the index of a nucleus in a list of nuclei. 

static int GetNucleusIndex (List< Nucleus > nuclei, string nucleusName)
Get the index of a nucleus with the given name in a list of nuclei. 

Public Attributes
ClusterPrefab prefab
The prefab used to create this cluster. 

Cluster[] instances
All cluster instance of a multi-cluster. 

int instanceCount = 1
The number of cluster instances in a multi-cluster. 

Dictionary< int, Cluster > thingClusters = new()
The mapping from things to cluster instances. 

List< Nucleus > nuclei = new()
All nuclei in this cluster. 

string name
The name of the Nucleus. 

Cluster parent
The cluster prefab in which the nucleus is located. 

Protected Attributes
List< Neuron > _outputs = null
The neurons without outgoing connections. 

Properties
string baseName [get]
The base name of the cluster. I don't think this is actively used at this moment. 

Dictionary< Nucleus, List< Nucleus > > computeOrders [get]
This gives the order in which nuclei should be computed when a nucleus is updated. 

virtual Neuron defaultOutput [get]
The first nucleus in a cluster is the default output. 

List< Neuron > outputs [get]
The neurons without outgoing connections. 

Member Enumeration Documentation
enum NanoBrain.Nucleus.Type[inherited]

Function to clone a nucleus to a Cluster prefab. 

Parameters
prefab 		
Returns

The types of Nucleus 

Constructor & Destructor Documentation
NanoBrain.Cluster.Cluster (ClusterPrefab  prefab, Cluster  parent)

Instantiate a new copy of a ClusterPrefab in the given parent. 

Parameters
prefab 	The prefab to use	
parent 	The cluster in which this new cluster will be placed	
NanoBrain.Cluster.Cluster (ClusterPrefab  prefab, ClusterPrefab  parent = null)

Add a new cluster to a ClusterPrefab. 

Parameters
prefab 	The prefab to copy	
parent 	The prefab in which the new copy is placed	

Member Function Documentation
override Nucleus NanoBrain.Cluster.ShallowCloneTo (Cluster  parent)

Toggle for printing debugging trace data.   
Function to make a partial clone of this nucleus
Parameters
parent 	The cluster in which the cloned nucleus should be placed	
Returns

static int NanoBrain.Cluster.GetNucleusIndex (List< Nucleus >  nuclei, Nucleus  nucleus)[static]

Get the index of a nucleus in a list of nuclei. 

Parameters
nuclei 	The list of nuclei to search	
nucleus 	The nucleus to find	
Returns
The index of the nucleus in the list or -1 when it has not been found
static int NanoBrain.Cluster.GetNucleusIndex (List< Nucleus >  nuclei, string  nucleusName)[static]

Get the index of a nucleus with the given name in a list of nuclei. 

Parameters
nuclei 	The list of nuclei to search	
nucleusName 	The name of the nucleus to find	
Returns
The index of the nucleus in the list or -1 when it has not been found
void NanoBrain.Cluster.AddInstance ()

Increase the number of instances in an multi-cluster. 
/remark Note this does not create the instances. This is only intended to be used for prefabs. 
void NanoBrain.Cluster.AddInstance (ClusterPrefab  prefab)

Create an new instance in a multi-cluster. 

Parameters
prefab 	The prefab to use to create the new instance	
/remark This does not change the instanceCount. It should only be used at runtime. 
bool NanoBrain.Cluster.TryGetNucleus (string  nucleusName, out Nucleus  foundNucleus)

Try to find a nucleus in this cluster. 

Parameters
nucleusName 	The name of the nucleus to find	
foundNucleus 	The found nucleus or null if it is not found	
Returns
True when the nucleus is found, false otherwise
Nucleus NanoBrain.Cluster.GetNucleus (string  nucleusName)

Get a nucleus in this cluster. 

Parameters
nucleusName 	The name of the nucleus to find	
Returns
The found nucleus or null when it is not found
Neuron NanoBrain.Cluster.GetNeuron (string  neuronName)

Get a neuron in this cluster. 

Parameters
neuronName 	The name of the neuron to find	
Returns
The found neuron or null when it is not found
Neuron NanoBrain.Cluster.GetNeuron (int  thingId, string  neuronName, string  thingName = null)

Get a neuron in an instance of a multi-cluster. 

Parameters
thingId 	The id of the thing mapped to the cluster instance	
neuronName 	The name of the neuron to find	
thingName 	The name of the thing mapped to the cluster instance	
Returns
The found neuron or null when it is not found
The cluster instance mapped to the thing will be neuron.parent if a neuron is found. 
bool NanoBrain.Cluster.DeleteNucleus (Nucleus  nucleus)

Delete a nucleus from this clsuter. 

Parameters
nucleus 	The nucleus to delete	
Returns
True if a nucleus was deleted, false if the nucleus could not be found
virtual List< Nucleus > NanoBrain.Cluster.CollectReceivers (bool  removeDuplicates = false)[virtual]

Collect all receiving nuclei of signals from this cluster. 

Parameters
removeDuplicates 	Ensure that a receiver is only listed once in the result	
Returns
The list of receivers
List< Synapse > NanoBrain.Cluster.CollectSynapsesTo (Cluster  otherCluster)

Collect all connections to receivers of signals from this cluster. 

Returns
A list of pairs of the sending neuron in this cluster and the matching receiving nucleus
Collect all synapses of senders in another cluster of signals to this cluster
Parameters
otherCluster 	The other cluster with sending neurons	
Returns
A list of synapses to the neurons in the other clusters
void NanoBrain.Cluster.UpdateFromNucleus (Nucleus  startNucleus)

Update the state of the nucleus and all nuclei receiving from it. 

Parameters
startNucleus 	The nucleus to start updating	
override void NanoBrain.Cluster.UpdateStateIsolated ()

Update the state without updating other Nuclei.   

void NanoBrain.Cluster.Refresh ()

Recalculate derived properties. 
This can be used to recalculate derived properties after the set of nuclei has been changed 
virtual void NanoBrain.Nucleus.UpdateNuclei ()[virtual], [inherited]

Update the state and recursively all Nuclei receiving data from this Nucleus. 
Reimplemented in NanoBrain.MemoryCell.

Member Data Documentation
ClusterPrefab NanoBrain.Cluster.prefab

The prefab used to create this cluster. 
Cluster should always be created from prefabs 
Cluster [] NanoBrain.Cluster.instances

All cluster instance of a multi-cluster. 
A cluster is a multi-cluster when there is more than one instance. The actual instances are only created at runtime. The value instanceCount determines how many instances will be present at runtime. 
int NanoBrain.Cluster.instanceCount = 1

The number of cluster instances in a multi-cluster. 
A cluster is a multi-clsuter when there is more than one instance. 
Dictionary<int, Cluster> NanoBrain.Cluster.thingClusters = new()

The mapping from things to cluster instances. 
In a multi-cluster each instance can be used for a thing. Cluster instance may also not (yet) be mapped to a thing. 
List<Neuron> NanoBrain.Cluster._outputs = null[protected]

The neurons without outgoing connections. 
These neurons can potentially be connected to neurons in other clusters 
Cluster NanoBrain.Nucleus.parent[inherited]

The cluster prefab in which the nucleus is located. 
The cluster instance in which the nucleus is located 

Property Documentation
List<Neuron> NanoBrain.Cluster.outputs[get]

The neurons without outgoing connections. 
These neurons can potentially be connected to neurons in other clusters 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/Cluster.cs

NanoBrain.ClusterPrefab Class Reference

Description
The Unity ScriptableObject to implement re-usable Cluster Prefabs. 

Inherits ScriptableObject.
Public Member Functions
Nucleus GetNucleus (string nucleusName)
Retrieve a nucleus in this cluster. 

void EnsureInitialization ()
void GarbageCollection ()
Public Attributes
Cluster cluster

Member Function Documentation
Nucleus NanoBrain.ClusterPrefab.GetNucleus (string  nucleusName)

Retrieve a nucleus in this cluster. 

Parameters
nucleusName 	The name of the nucleus	
Returns
The Nucleus with the given name or null if no such Nucleus could be found

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/ScriptableObjects/ClusterPrefab.cs

NanoBrain.MemoryCell Class Reference

Description
A MemoryCell stored its value for one update. 
When the input for a Memory Cell changes, it will output the previous value 
 
Inheritance diagram for NanoBrain.MemoryCell:
IMAGE
Public Types
enum CombinatorType { Sum, Product }
The type of combinators. 
enum ActivationType { Linear, Power, Sqrt, Reciprocal, Tanh, Binary, Normalized, Custom }
The type of. 
enum Type { None, Neuron, MemoryCell, Cluster }
Function to clone a nucleus to a Cluster prefab. 
Public Member Functions
MemoryCell (Cluster parent, string name)
override Nucleus ShallowCloneTo (Cluster newParent)
override void UpdateStateIsolated ()
override void UpdateNuclei ()
Update the state and recursively all Nuclei receiving data from this Nucleus. 

Synapse AddSynapse (Neuron sendingNucleus, float weight=1)
Add a new synapse to this nuclues. 

Synapse GetSynapse (Nucleus sender)
Find a synapse. 

void RemoveSynapse (Nucleus sendingNucleus)
Remove a synapse from a Nucleus. 

virtual void SetBias (Vector3 inputValue)
Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. 

AnimationCurve GenerateCurve ()
void SleepCheck ()
float3 CombinatorSum ()
Vector3 CombinatorSum ()
float3 CombinatorProduct ()
Vector3 CombinatorProduct ()
Vector3 CombinatorMax ()
virtual void AddReceiver (Nucleus receiverToAdd, float weight=1)
virtual void RemoveReceiver (Nucleus receiverToRemove)
virtual void ProcessStimulus (Vector3 inputValue)
Process an external stimulus. 

Static Public Member Functions
static void Delete (Nucleus nucleus)
Public Attributes
bool staticMemory = false
Vector3 bias = Vector3.zero
Create a new Neuron in a Cluster Prefab. 

CombinatorType combinator = CombinatorType.Sum
The type of combinator used for this Neuron. 

ActivationType _curvePreset
AnimationCurve curve
float curveMax = 1.0f
Action WhenFiring
bool persistOutput = false
float lastUpdate = 0
Toggle for printing debugging trace data. 

readonly float timeToSleep = 1f
string name
The name of the Nucleus. 

Cluster parent
The cluster prefab in which the nucleus is located. 

Protected Member Functions
virtual void CloneFields (Neuron clone)
void CheckSleepingSynapses ()
float3 ActivatorLinear (float3 input)
Vector3 ActivatorLinear (Vector3 input)
float3 ActivatorSqrt (float3 input)
Vector3 ActivatorSqrt (Vector3 input)
float3 ActivatorPower (float3 input)
Vector3 ActivatorPower (Vector3 input)
float3 ActivatorReciprocal (float3 input)
Vector3 ActivatorReciprocal (Vector3 input)
float3 ActivatorTanh (float3 input)
float3 ActivatorBinary (float3 input)
float3 ActivatorNormalized (float3 input)
float3 ActivatorCustom (float3 input)
Vector3 ActivatorCustom (Vector3 input)
Protected Attributes
float3 _outputValue
Vector3 _outputValue
Properties
override bool isSleeping [get]
List< Synapse > synapses [get]
The synapses of the nucleus. 

ActivationType curvePreset [get, set]
virtual float3 outputValue [get, set]
virtual Vector3 outputValue [get, set]
float outputMagnitude [get]
float outputSqrMagnitude [get]
bool isFiring [get]
Func< float3 > Combinator [get]
Func< Vector3 > Combinator [get]
Func< float3, float3 > Activator [get]
Func< Vector3, Vector3 > Activator [get]
virtual List< Nucleus > receivers [get, set]

Member Enumeration Documentation
enum NanoBrain.Neuron.CombinatorType[inherited]

The type of combinators. 
A combinator combines the weighted values of the synapses to a single value 

Enumerator:
Sum	Add the weighted values together. 
	
Product	Multiply the weighted values. 
	
enum NanoBrain.Nucleus.Type[inherited]

Function to clone a nucleus to a Cluster prefab. 

Parameters
prefab 		
Returns

The types of Nucleus 

Member Function Documentation
override void NanoBrain.MemoryCell.UpdateNuclei ()[virtual]

Update the state and recursively all Nuclei receiving data from this Nucleus. 
Reimplemented from NanoBrain.Nucleus.
Synapse NanoBrain.Neuron.AddSynapse (Neuron  sendingNucleus, float  weight = 1)[inherited]

Add a new synapse to this nuclues. 

Parameters
sendingNucleus 	The nucleus from which the signals may originate	
weight 	The weight applied to the input. Default value = 1	
Returns
The created Synapse
This will add a new input to this nucleus with the given weight. 
Synapse NanoBrain.Neuron.GetSynapse (Nucleus  sender)[inherited]

Find a synapse. 

Parameters
sender 	The sender of the input to the Synapse	
Returns
The found Synapse or null when the sender has no synapse to this nucleus.
void NanoBrain.Neuron.RemoveSynapse (Nucleus  sendingNucleus)[inherited]

Remove a synapse from a Nucleus. 

Parameters
sendingNucleus 	Remote the synapse connecting to this Nucleus	
virtual void NanoBrain.Neuron.SetBias (Vector3  inputValue)[virtual], [inherited]

Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. 

Parameters
inputValue 		
virtual void NanoBrain.Neuron.ProcessStimulus (Vector3  inputValue)[virtual], [inherited]

Process an external stimulus. 

Parameters
inputValue 	The value of the stimulus	
thingId 	The id of the thing causing the stimulus	
thingName 	The name of the thing causing the stimulus	

Member Data Documentation
Vector3 NanoBrain.Neuron.bias = Vector3.zero[inherited]

Create a new Neuron in a Cluster Prefab. 

Parameters
prefab 	The Cluster Preafb in which the new Neuron should be created	
name 	The name of the new Neuron	
The bias
The bias which a value which is always added to the combined value of the neuron It does not have a synapse and therefore no weight of source nucleus 
Cluster NanoBrain.Nucleus.parent[inherited]

The cluster prefab in which the nucleus is located. 
The cluster instance in which the nucleus is located 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/MemoryCell.cs

NanoBrain.Neuron Class Reference

Description
A neuron is a basic Nucleus. 
Inheritance diagram for NanoBrain.Neuron:
IMAGE
Public Types
enum CombinatorType { Sum, Product }
The type of combinators. 
enum ActivationType { Linear, Power, Sqrt, Reciprocal, Tanh, Binary, Normalized, Custom }
The type of. 
enum Type { None, Neuron, MemoryCell, Cluster }
Function to clone a nucleus to a Cluster prefab. 
Public Member Functions
Neuron (Cluster parent, string name)
Create a new Neuron in a Cluster instance. 

Synapse AddSynapse (Neuron sendingNucleus, float weight=1)
Add a new synapse to this nuclues. 

Synapse GetSynapse (Nucleus sender)
Find a synapse. 

void RemoveSynapse (Nucleus sendingNucleus)
Remove a synapse from a Nucleus. 

virtual void SetBias (Vector3 inputValue)
Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. 

AnimationCurve GenerateCurve ()
void SleepCheck ()
override Nucleus ShallowCloneTo (Cluster newParent)
Toggle for printing debugging trace data.   

override void UpdateStateIsolated ()
float3 CombinatorSum ()
float3 CombinatorProduct ()
Vector3 CombinatorSum ()
Vector3 CombinatorProduct ()
Vector3 CombinatorMax ()
virtual void AddReceiver (Nucleus receiverToAdd, float weight=1)
virtual void RemoveReceiver (Nucleus receiverToRemove)
virtual void ProcessStimulus (Vector3 inputValue)
Process an external stimulus. 

virtual void UpdateNuclei ()
Update the state and recursively all Nuclei receiving data from this Nucleus. 

Static Public Member Functions
static void Delete (Nucleus nucleus)
Public Attributes
Vector3 bias = Vector3.zero
Create a new Neuron in a Cluster Prefab. 

CombinatorType combinator = CombinatorType.Sum
The type of combinator used for this Neuron. 

ActivationType _curvePreset
AnimationCurve curve
float curveMax = 1.0f
Action WhenFiring
bool persistOutput = false
float lastUpdate = 0
Toggle for printing debugging trace data. 

readonly float timeToSleep = 1f
string name
The name of the Nucleus. 

Cluster parent
The cluster prefab in which the nucleus is located. 

Protected Member Functions
virtual void CloneFields (Neuron clone)
void CheckSleepingSynapses ()
float3 ActivatorLinear (float3 input)
float3 ActivatorSqrt (float3 input)
float3 ActivatorPower (float3 input)
float3 ActivatorReciprocal (float3 input)
float3 ActivatorTanh (float3 input)
float3 ActivatorBinary (float3 input)
float3 ActivatorNormalized (float3 input)
float3 ActivatorCustom (float3 input)
Vector3 ActivatorLinear (Vector3 input)
Vector3 ActivatorSqrt (Vector3 input)
Vector3 ActivatorPower (Vector3 input)
Vector3 ActivatorReciprocal (Vector3 input)
Vector3 ActivatorCustom (Vector3 input)
Protected Attributes
float3 _outputValue
Vector3 _outputValue
Properties
List< Synapse > synapses [get]
The synapses of the nucleus. 

ActivationType curvePreset [get, set]
virtual float3 outputValue [get, set]
float outputMagnitude [get]
float outputSqrMagnitude [get]
virtual Vector3 outputValue [get, set]
bool isFiring [get]
virtual bool isSleeping [get]
Func< float3 > Combinator [get]
Func< Vector3 > Combinator [get]
Func< float3, float3 > Activator [get]
Func< Vector3, Vector3 > Activator [get]
virtual List< Nucleus > receivers [get, set]

Member Enumeration Documentation
enum NanoBrain.Neuron.CombinatorType

The type of combinators. 
A combinator combines the weighted values of the synapses to a single value 

Enumerator:
Sum	Add the weighted values together. 
	
Product	Multiply the weighted values. 
	
enum NanoBrain.Nucleus.Type[inherited]

Function to clone a nucleus to a Cluster prefab. 

Parameters
prefab 		
Returns

The types of Nucleus 

Constructor & Destructor Documentation
NanoBrain.Neuron.Neuron (Cluster  parent, string  name)

Create a new Neuron in a Cluster instance. 

Parameters
parent 	The parent cluster in which the new Neuron should be created	
name 	The name of the new Neuron	

Member Function Documentation
Synapse NanoBrain.Neuron.AddSynapse (Neuron  sendingNucleus, float  weight = 1)

Add a new synapse to this nuclues. 

Parameters
sendingNucleus 	The nucleus from which the signals may originate	
weight 	The weight applied to the input. Default value = 1	
Returns
The created Synapse
This will add a new input to this nucleus with the given weight. 
Synapse NanoBrain.Neuron.GetSynapse (Nucleus  sender)

Find a synapse. 

Parameters
sender 	The sender of the input to the Synapse	
Returns
The found Synapse or null when the sender has no synapse to this nucleus.
void NanoBrain.Neuron.RemoveSynapse (Nucleus  sendingNucleus)

Remove a synapse from a Nucleus. 

Parameters
sendingNucleus 	Remote the synapse connecting to this Nucleus	
virtual void NanoBrain.Neuron.SetBias (Vector3  inputValue)[virtual]

Set the bias, recalculate the output and update all Nuclei receiving from this Nucleus. 

Parameters
inputValue 		
override Nucleus NanoBrain.Neuron.ShallowCloneTo (Cluster  newParent)

Toggle for printing debugging trace data.   
Function to make a partial clone of this nucleus
Parameters
parent 	The cluster in which the cloned nucleus should be placed	
Returns

virtual void NanoBrain.Neuron.ProcessStimulus (Vector3  inputValue)[virtual]

Process an external stimulus. 

Parameters
inputValue 	The value of the stimulus	
thingId 	The id of the thing causing the stimulus	
thingName 	The name of the thing causing the stimulus	
virtual void NanoBrain.Nucleus.UpdateNuclei ()[virtual], [inherited]

Update the state and recursively all Nuclei receiving data from this Nucleus. 
Reimplemented in NanoBrain.MemoryCell.

Member Data Documentation
Vector3 NanoBrain.Neuron.bias = Vector3.zero

Create a new Neuron in a Cluster Prefab. 

Parameters
prefab 	The Cluster Preafb in which the new Neuron should be created	
name 	The name of the new Neuron	
The bias
The bias which a value which is always added to the combined value of the neuron It does not have a synapse and therefore no weight of source nucleus 
Cluster NanoBrain.Nucleus.parent[inherited]

The cluster prefab in which the nucleus is located. 
The cluster instance in which the nucleus is located 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/Neuron.cs

NanoBrain.Nucleus Class Reference

Description
A Nucleus is a basic element in a brain cluster. 
Inheritance diagram for NanoBrain.Nucleus:
IMAGE
Public Types
enum Type { None, Neuron, MemoryCell, Cluster }
Function to clone a nucleus to a Cluster prefab. 
Public Member Functions
Nucleus ShallowCloneTo (Cluster parent)
Toggle for printing debugging trace data. 

void UpdateStateIsolated ()
Update the state without updating other Nuclei. 

virtual void UpdateNuclei ()
Update the state and recursively all Nuclei receiving data from this Nucleus. 

Public Attributes
string name
The name of the Nucleus. 

Cluster parent
The cluster prefab in which the nucleus is located. 

Member Enumeration Documentation
enum NanoBrain.Nucleus.Type

Function to clone a nucleus to a Cluster prefab. 

Parameters
prefab 		
Returns

The types of Nucleus 

Member Function Documentation
Nucleus NanoBrain.Nucleus.ShallowCloneTo (Cluster  parent)[abstract]

Toggle for printing debugging trace data. 
Function to make a partial clone of this nucleus
Parameters
parent 	The cluster in which the cloned nucleus should be placed	
Returns

virtual void NanoBrain.Nucleus.UpdateNuclei ()[virtual]

Update the state and recursively all Nuclei receiving data from this Nucleus. 
Reimplemented in NanoBrain.MemoryCell.

Member Data Documentation
Cluster NanoBrain.Nucleus.parent

The cluster prefab in which the nucleus is located. 
The cluster instance in which the nucleus is located 

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/Nucleus.cs

NanoBrain.Synapse Class Reference

Description
A Synapse connects the ouput of a Neuron to another Neuron. 
Public Member Functions
Synapse (Neuron nucleus, float weight=1.0f)
Create a new Synapse. 

Public Attributes
Neuron neuron
The neuron from which input is received. 

float weight
The weight value to apply to the Neuron input. 

Properties
bool isSleeping [get]

Constructor & Destructor Documentation
NanoBrain.Synapse.Synapse (Neuron  nucleus, float  weight = 1::0f)

Create a new Synapse. 

Parameters
nucleus 	The neuron from which input is received	
weight 	The weight value to apply to the Neuron input	

The documentation for this class was generated from the following file:
/home/pascal/Development/Projects/Passer/NanoBrain/NanoBrain/Assets/NanoBrain-unitypackage/Runtime/Scripts/Core/Synapse.cs

Index
INDEX