7ef8e42 multi-cluster calculation fix af0ba68 Viewer for multi-clusters 0401090 Created runtime sibling, but not the synapses yet 36f876c draw external receivers only once ffcf420 Fix cloned external connections b2bc92b Multiple players working-ish 335dae7 Fix deleting neuron without synapses fc8caa8 Fix adding/removing cluster outputs 805b0f8 Fix broken outputpop references ecab0b0 Fix neuron name editor git-subtree-dir: NanoBrain git-subtree-split: 7ef8e42e091cd5a46bf77dfbf9b1a3b3a4422752
35 lines
986 B
C#
35 lines
986 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace NanoBrain {
|
|
|
|
/// <summary>
|
|
/// A Synapse connects the ouput of a Neuron to another Neuron
|
|
/// </summary>
|
|
[Serializable]
|
|
public class Synapse {
|
|
/// <summary>
|
|
/// The neuron from which input is received
|
|
/// </summary>
|
|
[SerializeReference]
|
|
public Neuron neuron;
|
|
|
|
/// <summary>
|
|
/// The weight value to apply to the Neuron input
|
|
/// </summary>
|
|
public float weight;
|
|
|
|
/// <summary>
|
|
/// Create a new Synapse
|
|
/// </summary>
|
|
/// <param name="nucleus">The neuron from which input is received</param>
|
|
/// <param name="weight">The weight value to apply to the Neuron input</param>
|
|
public Synapse(Neuron nucleus, float weight = 1.0f) {
|
|
this.neuron = nucleus;
|
|
this.weight = weight;
|
|
}
|
|
|
|
public bool isSleeping => this.neuron.isSleeping;
|
|
}
|
|
|
|
} |