Further cleanup
This commit is contained in:
parent
a22e4b149a
commit
1e1e5b1344
@ -70,10 +70,8 @@
|
|||||||
<Compile Include="Assets/NanoBrain/VisualEditor/NanoBrainComponent.cs" />
|
<Compile Include="Assets/NanoBrain/VisualEditor/NanoBrainComponent.cs" />
|
||||||
<Compile Include="Assets/NanoBrain/LinearAlgebra/src/Vector2Int.cs" />
|
<Compile Include="Assets/NanoBrain/LinearAlgebra/src/Vector2Int.cs" />
|
||||||
<Compile Include="Assets/Scenes/Boids/Scripts/SwarmControl.cs" />
|
<Compile Include="Assets/Scenes/Boids/Scripts/SwarmControl.cs" />
|
||||||
<Compile Include="Assets/Scenes/Boids/Scripts/RoamingNucleus.cs" />
|
|
||||||
<Compile Include="Assets/NanoBrain/LinearAlgebra/src/Spherical.cs" />
|
<Compile Include="Assets/NanoBrain/LinearAlgebra/src/Spherical.cs" />
|
||||||
<Compile Include="Assets/NanoBrain/LinearAlgebra/test/Vector3FloatTest.cs" />
|
<Compile Include="Assets/NanoBrain/LinearAlgebra/test/Vector3FloatTest.cs" />
|
||||||
<Compile Include="Assets/Scenes/Boids/Scripts/SwarmingNucleus.cs" />
|
|
||||||
<Compile Include="Assets/NanoBrain/LinearAlgebra/test/QuaternionTest.cs" />
|
<Compile Include="Assets/NanoBrain/LinearAlgebra/test/QuaternionTest.cs" />
|
||||||
<Compile Include="Assets/Scenes/Boids/Scripts/Boid.cs" />
|
<Compile Include="Assets/Scenes/Boids/Scripts/Boid.cs" />
|
||||||
<Compile Include="Assets/NanoBrain/LinearAlgebra/src/SwingTwist.cs" />
|
<Compile Include="Assets/NanoBrain/LinearAlgebra/src/SwingTwist.cs" />
|
||||||
|
|||||||
@ -69,17 +69,19 @@ public class Nucleus {
|
|||||||
{
|
{
|
||||||
get { return _outputValue; }
|
get { return _outputValue; }
|
||||||
set {
|
set {
|
||||||
//Refresh();
|
|
||||||
this.stale = 0;
|
this.stale = 0;
|
||||||
|
this.isSleeping = false;
|
||||||
_outputValue = value;
|
_outputValue = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.NonSerialized]
|
[System.NonSerialized]
|
||||||
private int stale = 1000;
|
private int stale = 1000;
|
||||||
public bool isSleeping => this.stale > 2;
|
|
||||||
|
public bool isSleeping = false;
|
||||||
public void IncreaseAge() {
|
public void IncreaseAge() {
|
||||||
this.stale++;
|
this.stale++;
|
||||||
|
this.isSleeping = this.stale > 2;
|
||||||
if (isSleeping)
|
if (isSleeping)
|
||||||
_outputValue = Spherical.zero;
|
_outputValue = Spherical.zero;
|
||||||
}
|
}
|
||||||
@ -89,13 +91,6 @@ public class Nucleus {
|
|||||||
#endregion Runtime state
|
#endregion Runtime state
|
||||||
|
|
||||||
public Nucleus(string name) {
|
public Nucleus(string name) {
|
||||||
// this.brain = brain;
|
|
||||||
// if (this.brain != null) {
|
|
||||||
// this.brain.nuclei.Add(this);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// Debug.LogError("No neuroid network");
|
|
||||||
|
|
||||||
this._name = name;
|
this._name = name;
|
||||||
this.id = this.GetHashCode();
|
this.id = this.GetHashCode();
|
||||||
}
|
}
|
||||||
@ -137,12 +132,6 @@ public class Nucleus {
|
|||||||
this.SetWeight(input, weight);
|
this.SetWeight(input, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public bool isSleeping {
|
|
||||||
// get {
|
|
||||||
// return this.stale > 2;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
public bool SynapseExists(Nucleus nucleus) {
|
public bool SynapseExists(Nucleus nucleus) {
|
||||||
foreach (Synapse synapse in synapses) {
|
foreach (Synapse synapse in synapses) {
|
||||||
if (synapse.nucleus == nucleus)
|
if (synapse.nucleus == nucleus)
|
||||||
|
|||||||
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
public class Roaming : Nucleus {
|
|
||||||
public Neuroid avoidance;
|
|
||||||
|
|
||||||
public Neuroid output;
|
|
||||||
|
|
||||||
public Roaming(NanoBrainObj brain, Perception perception, SwarmControl sc) : base("Roaming nucleus") {
|
|
||||||
avoidance = new(brain, "Avoidance") { inverse = true };
|
|
||||||
perception.SendPositions(avoidance, Boid.BoundaryType);
|
|
||||||
|
|
||||||
this.output = new(brain, "Roaming");
|
|
||||||
output.GetInputFrom(avoidance, -sc.avoidanceForce);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void AddReceiver(Nucleus receiver) {
|
|
||||||
output.AddReceiver(receiver);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2c0f5292293252943b1d45dbd1d14515
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
// using UnityEngine;
|
|
||||||
// using LinearAlgebra;
|
|
||||||
|
|
||||||
// public class Swarming : Nucleus {
|
|
||||||
// public Neuroid cohesion;
|
|
||||||
// public Neuroid alignment;
|
|
||||||
// public Neuroid avoidance;
|
|
||||||
// public Neuroid boundary;
|
|
||||||
|
|
||||||
// public Neuroid output;
|
|
||||||
|
|
||||||
// //public override Spherical outputValue { get => output.outputValue; set => output.outputValue = value; }
|
|
||||||
|
|
||||||
// public Swarming(NanoBrainObj brain, Perception perception, SwarmControl sc) : base("Swarming Nucleus") {
|
|
||||||
// this.cohesion = new(brain, "Cohesion") { inverse = false };
|
|
||||||
// perception.SendPositions(this.cohesion, Boid.BoidType);
|
|
||||||
|
|
||||||
// this.alignment = new(brain, "Alignment") { average = true };
|
|
||||||
// perception.SendVelocities(this.alignment, Boid.BoidType);
|
|
||||||
|
|
||||||
// this.avoidance = new(brain, "Avoidance") { inverse = true };
|
|
||||||
// perception.SendPositions(this.avoidance);
|
|
||||||
|
|
||||||
// this.boundary = new(brain, "Boundary");
|
|
||||||
// perception.SendPositions(this.boundary, Boid.BoundaryType);
|
|
||||||
|
|
||||||
// this.output = new(brain, "Swarming");
|
|
||||||
// this.output.GetInputFrom(alignment, sc.alignmentForce);
|
|
||||||
// this.output.GetInputFrom(cohesion, sc.cohesionForce);
|
|
||||||
// this.output.GetInputFrom(avoidance, -sc.avoidanceForce);
|
|
||||||
// this.output.GetInputFrom(boundary, -sc.avoidanceForce);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public override void AddReceiver(Nucleus receiver) {
|
|
||||||
// this.output.AddReceiver(receiver);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 14b1bfd5a5b0784e098fc5e47b1720a1
|
|
||||||
Loading…
x
Reference in New Issue
Block a user