diff --git a/Cluster.cs b/Cluster.cs index 2a7fe34..c9842dd 100644 --- a/Cluster.cs +++ b/Cluster.cs @@ -104,7 +104,7 @@ public class Cluster : Nucleus { foreach (Nucleus prefabArrayNucleus in prefabReceptor.nucleiArray) { int arrayNucleusIx = GetNucleusIndex(prefabNuclei, prefabArrayNucleus); if (arrayNucleusIx >= 0) { - Neuron clonedArrayNucleus = clonedNuclei[arrayNucleusIx] as Neuron; + Nucleus clonedArrayNucleus = clonedNuclei[arrayNucleusIx]; clonedArray.nuclei[arrayIx] = clonedArrayNucleus; } else { diff --git a/ClusterReceptor.cs b/ClusterReceptor.cs index fb9a7bc..b93e205 100644 --- a/ClusterReceptor.cs +++ b/ClusterReceptor.cs @@ -152,6 +152,7 @@ public class ClusterReceptor : Cluster, IReceptor { public virtual void ProcessStimulus(Neuron input, Vector3 inputValue, int thingId = 0, string thingName = null) { CleanupReceivers(); + Debug.Log($"{input.name} is {inputValue}, 1/{inputValue} = {1 / inputValue.x}, {1/inputValue.y}, {1/inputValue.z}"); //inputValue = input.Activator(inputValue); if (!thingReceivers.TryGetValue(thingId, out ClusterReceptor selectedReceiver)) @@ -173,6 +174,7 @@ public class ClusterReceptor : Cluster, IReceptor { if (selectedReceiver.clusterNuclei[inputIx] is Neuron selectedNeuron) selectedNeuron.ProcessStimulusDirect(inputValue); + Debug.Log($"cluster output = {selectedReceiver.defaultOutput.outputValue}"); } // private ClusterReceptor FindReceiver(int thingId, float3 inputValue) { @@ -220,7 +222,6 @@ public class ClusterReceptor : Cluster, IReceptor { private ClusterReceptor FindReceiver2(int thingId, float3 inputValue) { // No existing nucleus for this thing - //float inputMagnitude = length(inputValue); ClusterReceptor selectedReceiver = null; float selectedMagnitude = 0; foreach (ClusterReceptor receiver in this.nucleiArray.Cast()) { diff --git a/Editor/ClusterInspector.cs b/Editor/ClusterInspector.cs index d2c7e2d..56cb636 100644 --- a/Editor/ClusterInspector.cs +++ b/Editor/ClusterInspector.cs @@ -176,7 +176,7 @@ public class ClusterInspector : Editor { if (this.prefabAsset == null) { // create in memory save if it doesn't exist this.prefabAsset = CreateInstance(); - Debug.LogError("Cluster Prefab is not found on disk"); + //Debug.LogError("Cluster Prefab is not found on disk"); } DrawInspector(inspectorContainer); } @@ -752,10 +752,10 @@ public class ClusterInspector : Editor { EditorGUI.indentLevel++; float newWeight = EditorGUILayout.FloatField("Weight", synapse.weight); if (newWeight != synapse.weight) { - if (synapse.nucleus is IReceptor receptor) { + if (synapse.nucleus.parent is IReceptor receptor) { Nucleus[] receptorArray = receptor.nucleiArray; foreach (Synapse s in this.currentNucleus.synapses) { - if (s.nucleus is IReceptor r && r.nucleiArray == receptorArray) + if (s.nucleus.parent is IReceptor r && r.nucleiArray == receptorArray) s.weight = newWeight; } } diff --git a/NewVelocity.asset b/NewVelocity.asset new file mode 100644 index 0000000..87c56b4 --- /dev/null +++ b/NewVelocity.asset @@ -0,0 +1,1305 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 60a957541c24c57e78018c202ebb1d9b, type: 3} + m_Name: NewVelocity + m_EditorClassIdentifier: Assembly-CSharp::ClusterPrefab + nuclei: + - rid: 2262690579536937007 + - rid: 2262690579536937008 + - rid: 2262690579536937009 + - rid: 2262690579536937010 + references: + version: 2 + RefIds: + - rid: -2 + type: {class: , ns: , asm: } + - rid: 2262690579536937007 + type: {class: Neuron, ns: , asm: Assembly-CSharp} + data: + name: Proximity + clusterPrefab: {fileID: 11400000} + parent: + rid: -2 + trace: 0 + bias: {x: 0, y: 0, z: 0} + _synapses: + - nucleus: + rid: 2262690579536937008 + weight: 1 + combinator: 0 + _curvePreset: 3 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0.001 + value: 999.99994 + inSlope: 0 + outSlope: -112788.63 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.008866142 + value: 112.788635 + inSlope: -112788.63 + outSlope: -6740.78 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.016732283 + value: 59.76471 + inSlope: -6740.78 + outSlope: -2429.6155 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.024598425 + value: 40.653008 + inSlope: -2429.6155 + outSlope: -1252.2269 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.032464568 + value: 30.802813 + inSlope: -1252.2269 + outSlope: -763.7558 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.040330708 + value: 24.795002 + inSlope: -763.7558 + outSlope: -514.45264 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.04819685 + value: 20.748245 + inSlope: -514.45264 + outSlope: -370.0882 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.056062993 + value: 17.837078 + inSlope: -370.0882 + outSlope: -279.01324 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.06392913 + value: 15.642321 + inSlope: -279.01324 + outSlope: -217.87398 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.07179528 + value: 13.928493 + inSlope: -217.87398 + outSlope: -174.8461 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.079661414 + value: 12.553129 + inSlope: -174.8461 + outSlope: -143.41913 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.087527566 + value: 11.424973 + inSlope: -143.41913 + outSlope: -119.76661 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.0953937 + value: 10.482872 + inSlope: -119.76661 + outSlope: -101.519356 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.10325985 + value: 9.684306 + inSlope: -101.519356 + outSlope: -87.14706 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.11112598 + value: 8.9987955 + inSlope: -87.14706 + outSlope: -75.62513 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.11899213 + value: 8.403917 + inSlope: -75.62513 + outSlope: -66.24654 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.12685826 + value: 7.882813 + inSlope: -66.24654 + outSlope: -58.510654 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.13472441 + value: 7.4225597 + inSlope: -58.510654 + outSlope: -52.055042 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.14259055 + value: 7.0130873 + inSlope: -52.055042 + outSlope: -46.612007 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.1504567 + value: 6.6464305 + inSlope: -46.612007 + outSlope: -41.98024 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.15832284 + value: 6.316208 + inSlope: -41.98024 + outSlope: -38.006134 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.16618897 + value: 6.0172467 + inSlope: -38.006134 + outSlope: -34.570965 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.17405513 + value: 5.745306 + inSlope: -34.570965 + outSlope: -31.581244 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.18192126 + value: 5.496884 + inSlope: -31.581244 + outSlope: -28.963417 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.1897874 + value: 5.2690535 + inSlope: -28.963417 + outSlope: -26.658009 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.19765353 + value: 5.059358 + inSlope: -26.658009 + outSlope: -24.617418 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.20551969 + value: 4.8657136 + inSlope: -24.617418 + outSlope: -22.802412 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.21338584 + value: 4.6863465 + inSlope: -22.802412 + outSlope: -21.181019 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.22125196 + value: 4.519734 + inSlope: -21.181019 + outSlope: -19.72667 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.22911811 + value: 4.364561 + inSlope: -19.72667 + outSlope: -18.417059 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.23698425 + value: 4.21969 + inSlope: -18.417059 + outSlope: -17.233776 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.2448504 + value: 4.0841265 + inSlope: -17.233776 + outSlope: -16.160883 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.25271654 + value: 3.9570026 + inSlope: -16.160883 + outSlope: -15.185221 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.2605827 + value: 3.8375535 + inSlope: -15.185221 + outSlope: -14.295299 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.2684488 + value: 3.725105 + inSlope: -14.295299 + outSlope: -13.481375 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.27631494 + value: 3.6190586 + inSlope: -13.481375 + outSlope: -12.735047 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.28418112 + value: 3.5188825 + inSlope: -12.735047 + outSlope: -12.04901 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.29204726 + value: 3.4241033 + inSlope: -12.04901 + outSlope: -11.416967 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.2999134 + value: 3.3342957 + inSlope: -11.416967 + outSlope: -10.8334 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.30777952 + value: 3.249079 + inSlope: -10.8334 + outSlope: -10.293426 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.31564566 + value: 3.1681094 + inSlope: -10.293426 + outSlope: -9.792865 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.3235118 + value: 3.0910773 + inSlope: -9.792865 + outSlope: -9.327949 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.33137795 + value: 3.0177023 + inSlope: -9.327949 + outSlope: -8.895375 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.33924407 + value: 2.9477303 + inSlope: -8.895375 + outSlope: -8.492224 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.34711024 + value: 2.880929 + inSlope: -8.492224 + outSlope: -8.115812 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.3549764 + value: 2.8170888 + inSlope: -8.115812 + outSlope: -7.76395 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.36284253 + value: 2.7560165 + inSlope: -7.76395 + outSlope: -7.434456 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.37070867 + value: 2.697536 + inSlope: -7.434456 + outSlope: -7.1255083 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.3785748 + value: 2.641486 + inSlope: -7.1255083 + outSlope: -6.8354197 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.38644093 + value: 2.5877175 + inSlope: -6.8354197 + outSlope: -6.562695 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.39430708 + value: 2.5360944 + inSlope: -6.562695 + outSlope: -6.305974 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.40217322 + value: 2.4864907 + inSlope: -6.305974 + outSlope: -6.064021 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.4100394 + value: 2.43879 + inSlope: -6.064021 + outSlope: -5.835745 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.4179055 + value: 2.3928854 + inSlope: -5.835745 + outSlope: -5.6201315 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.42577165 + value: 2.3486767 + inSlope: -5.6201315 + outSlope: -5.4162097 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.4336378 + value: 2.306072 + inSlope: -5.4162097 + outSlope: -5.223229 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.44150394 + value: 2.2649853 + inSlope: -5.223229 + outSlope: -5.040342 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.4493701 + value: 2.2253373 + inSlope: -5.040342 + outSlope: -4.8669295 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.4572362 + value: 2.1870534 + inSlope: -4.8669295 + outSlope: -4.7023005 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.46510234 + value: 2.1500645 + inSlope: -4.7023005 + outSlope: -4.5458865 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.47296852 + value: 2.1143057 + inSlope: -4.5458865 + outSlope: -4.3971753 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.48083466 + value: 2.079717 + inSlope: -4.3971753 + outSlope: -4.2555995 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.4887008 + value: 2.0462418 + inSlope: -4.2555995 + outSlope: -4.1207685 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.49656692 + value: 2.0138273 + inSlope: -4.1207685 + outSlope: -3.9922712 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5044331 + value: 1.9824234 + inSlope: -3.9922712 + outSlope: -3.8696532 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5122992 + value: 1.9519844 + inSlope: -3.8696532 + outSlope: -3.7526293 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5201653 + value: 1.9224657 + inSlope: -3.7526293 + outSlope: -3.6408176 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.52803147 + value: 1.8938265 + inSlope: -3.6408176 + outSlope: -3.5339315 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5358976 + value: 1.8660281 + inSlope: -3.5339315 + outSlope: -3.4316826 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.54376376 + value: 1.839034 + inSlope: -3.4316826 + outSlope: -3.3338284 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5516299 + value: 1.8128096 + inSlope: -3.3338284 + outSlope: -3.240066 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.55949605 + value: 1.7873228 + inSlope: -3.240066 + outSlope: -3.1502352 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.56736225 + value: 1.7625424 + inSlope: -3.1502352 + outSlope: -3.0640743 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5752284 + value: 1.7384399 + inSlope: -3.0640743 + outSlope: -2.9814053 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.58309454 + value: 1.7149878 + inSlope: -2.9814053 + outSlope: -2.9020314 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.5909606 + value: 1.6921601 + inSlope: -2.9020314 + outSlope: -2.8257964 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.59882677 + value: 1.669932 + inSlope: -2.8257964 + outSlope: -2.7525082 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6066929 + value: 1.6482804 + inSlope: -2.7525082 + outSlope: -2.6820538 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.61455905 + value: 1.627183 + inSlope: -2.6820538 + outSlope: -2.6142666 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6224252 + value: 1.6066188 + inSlope: -2.6142666 + outSlope: -2.5490105 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.63029134 + value: 1.5865679 + inSlope: -2.5490105 + outSlope: -2.4861636 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6381575 + value: 1.5670114 + inSlope: -2.4861636 + outSlope: -2.4256358 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.64602363 + value: 1.547931 + inSlope: -2.4256358 + outSlope: -2.3672597 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6538898 + value: 1.5293097 + inSlope: -2.3672597 + outSlope: -2.3109925 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.66175586 + value: 1.5111313 + inSlope: -2.3109925 + outSlope: -2.2566907 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.669622 + value: 1.4933798 + inSlope: -2.2566907 + outSlope: -2.2042859 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.67748815 + value: 1.4760406 + inSlope: -2.2042859 + outSlope: -2.1536992 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6853543 + value: 1.4590993 + inSlope: -2.1536992 + outSlope: -2.1048093 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.6932205 + value: 1.4425424 + inSlope: -2.1048093 + outSlope: -2.0575728 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.70108664 + value: 1.4263573 + inSlope: -2.0575728 + outSlope: -2.011927 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7089528 + value: 1.4105312 + inSlope: -2.011927 + outSlope: -1.9677659 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7168189 + value: 1.3950524 + inSlope: -1.9677659 + outSlope: -1.9250447 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7246851 + value: 1.3799098 + inSlope: -1.9250447 + outSlope: -1.8837026 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7325512 + value: 1.3650923 + inSlope: -1.8837026 + outSlope: -1.8436778 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7404173 + value: 1.3505898 + inSlope: -1.8436778 + outSlope: -1.8049132 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.74828345 + value: 1.336392 + inSlope: -1.8049132 + outSlope: -1.7673749 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7561496 + value: 1.3224896 + inSlope: -1.7673749 + outSlope: -1.7309732 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.76401573 + value: 1.3088735 + inSlope: -1.7309732 + outSlope: -1.695693 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7718819 + value: 1.295535 + inSlope: -1.695693 + outSlope: -1.6614736 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.779748 + value: 1.2824656 + inSlope: -1.6614736 + outSlope: -1.6282848 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.78761417 + value: 1.2696573 + inSlope: -1.6282848 + outSlope: -1.5960962 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.7954803 + value: 1.2571021 + inSlope: -1.5960962 + outSlope: -1.564832 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.80334646 + value: 1.2447929 + inSlope: -1.564832 + outSlope: -1.5344887 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.81121254 + value: 1.2327225 + inSlope: -1.5344887 + outSlope: -1.5050048 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.81907874 + value: 1.2208838 + inSlope: -1.5050048 + outSlope: -1.4763738 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8269449 + value: 1.2092705 + inSlope: -1.4763738 + outSlope: -1.4485649 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.83481103 + value: 1.1978759 + inSlope: -1.4485649 + outSlope: -1.4215137 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8426772 + value: 1.186694 + inSlope: -1.4215137 + outSlope: -1.3952202 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8505433 + value: 1.175719 + inSlope: -1.3952202 + outSlope: -1.369639 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.85840946 + value: 1.1649452 + inSlope: -1.369639 + outSlope: -1.3447852 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8662756 + value: 1.154367 + inSlope: -1.3447852 + outSlope: -1.320568 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.87414175 + value: 1.1439792 + inSlope: -1.320568 + outSlope: -1.2970176 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8820079 + value: 1.1337767 + inSlope: -1.2970176 + outSlope: -1.2740829 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.889874 + value: 1.1237546 + inSlope: -1.2740829 + outSlope: -1.2517655 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.8977401 + value: 1.113908 + inSlope: -1.2517655 + outSlope: -1.2300034 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.90560627 + value: 1.1042327 + inSlope: -1.2300034 + outSlope: -1.2088321 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.9134724 + value: 1.0947238 + inSlope: -1.2088321 + outSlope: -1.1881914 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.92133856 + value: 1.0853773 + inSlope: -1.1881914 + outSlope: -1.1680659 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.9292047 + value: 1.0761892 + inSlope: -1.1680659 + outSlope: -1.1484709 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.93707085 + value: 1.0671551 + inSlope: -1.1484709 + outSlope: -1.1293371 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.94493705 + value: 1.0582715 + inSlope: -1.1293371 + outSlope: -1.1106901 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.9528032 + value: 1.0495347 + inSlope: -1.1106901 + outSlope: -1.0925045 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.96066934 + value: 1.0409409 + inSlope: -1.0925045 + outSlope: -1.0747513 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.9685354 + value: 1.0324868 + inSlope: -1.0747513 + outSlope: -1.0574516 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.97640157 + value: 1.0241687 + inSlope: -1.0574516 + outSlope: -1.0405389 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.9842677 + value: 1.0159837 + inSlope: -1.0405389 + outSlope: -1.0240355 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 0.99213386 + value: 1.0079285 + inSlope: -1.0240355 + outSlope: -1.0079259 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: -1.0079259 + outSlope: 0 + tangentMode: 69 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curveMax: 100 + _receivers: [] + - rid: 2262690579536937008 + type: {class: Neuron, ns: , asm: Assembly-CSharp} + data: + name: Position + clusterPrefab: {fileID: 11400000} + parent: + rid: -2 + trace: 0 + bias: {x: 0, y: 0, z: 0} + _synapses: [] + combinator: 0 + _curvePreset: 0 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1000 + value: 1000 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curveMax: 1 + _receivers: + - rid: 2262690579536937007 + - rid: 2262690579536937009 + - rid: 2262690579536937009 + type: {class: Neuron, ns: , asm: Assembly-CSharp} + data: + name: Velocity + clusterPrefab: {fileID: 11400000} + parent: + rid: -2 + trace: 0 + bias: {x: 0, y: 0, z: 0} + _synapses: + - nucleus: + rid: 2262690579536937008 + weight: 1 + - nucleus: + rid: 2262690579536937010 + weight: 1 + combinator: 0 + _curvePreset: 0 + curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1000 + value: 1000 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curveMax: 1 + _receivers: [] + - rid: 2262690579536937010 + type: {class: MemoryCell, ns: , asm: Assembly-CSharp} + data: + name: New memory cell + clusterPrefab: {fileID: 11400000} + parent: + rid: -2 + trace: 0 + bias: {x: 0, y: 0, z: 0} + _synapses: [] + combinator: 0 + _curvePreset: 0 + curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curveMax: 1 + _receivers: + - rid: 2262690579536937009 + staticMemory: 0 diff --git a/NewVelocity.asset.meta b/NewVelocity.asset.meta new file mode 100644 index 0000000..5718f8b --- /dev/null +++ b/NewVelocity.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 61eea9f818639ec20b7a7bf4e86fff66 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Pulsar.cs b/Pulsar.cs deleted file mode 100644 index b302951..0000000 --- a/Pulsar.cs +++ /dev/null @@ -1,54 +0,0 @@ -// using System; -// using Unity.Mathematics; - -// /// -// /// The Pulsar represents a type of neuron that operates based on -// /// the product of its weighted inputs rather than the traditional summation. -// /// Drawing inspiration from the concept of pulsars in astrophysics -// /// —highly magnetized rotating neutron stars that emit beams of radiation— -// /// the Pulsar could symbolize dynamic, focused output based on the interaction of multiple factors. -// /// -// /// Multiplicative Functionality: -// /// Instead of summing inputs, the Pulsar takes the weighted product of its inputs. -// /// This means that all inputs must be active (non-zero) for the neuron to "pulse" or activate. -// /// Output Behavior: -// /// The output could amplify or diminish depending on the magnitude of the inputs. -// /// The product would be sensitive to small values, -// /// which means that even a small input could significantly lower the overall output if multiplied. -// /// Activation Mechanism: -// /// The activation function can further refine the output from the product result. -// /// For instance, a certain threshold could be used to determine if a pulse occurs. -// /// Modeling Complex Interactions: -// /// The Pulsar could be particularly beneficial for modeling situations where interactions multiply rather than add. -// /// This is useful in fields such as economics (e.g., compound growth models), -// /// biology (e.g., interaction of hormones), and machine learning where multiplicative relationships exist. -// [Serializable] -// public class Pulsar : Neuron { -// public Pulsar(Cluster parent, string name) : base(parent, name) { -// // To prevent mistakes, bias one (instead of zero for standard neurons) -// this.bias = new float3(1, 1, 1); -// } -// public Pulsar(ClusterPrefab parent, string name) : base(parent, name) { -// // To prevent mistakes, bias one (instead of zero for standard neurons) -// this.bias = new float3(1, 1, 1); -// } - -// public override Nucleus ShallowCloneTo(Cluster newParent) { -// Pulsar clone = new(newParent, this.name); -// CloneFields(clone); -// return clone; -// } - -// public override void UpdateStateIsolated() { -// float3 product = this.bias; - -// //Applying the weight factors -// foreach (Synapse synapse in this.synapses) { -// float3 input = synapse.weight * synapse.nucleus.outputValue; -// product *= input; -// } - -// // Activation function -// this.outputValue = Activator(product); -// } -// } \ No newline at end of file diff --git a/Pulsar.cs.meta b/Pulsar.cs.meta deleted file mode 100644 index e73f7db..0000000 --- a/Pulsar.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 46bd155173053a01585411c3e07f85d4 \ No newline at end of file diff --git a/Selector.cs b/Selector.cs deleted file mode 100644 index ad68c3d..0000000 --- a/Selector.cs +++ /dev/null @@ -1,62 +0,0 @@ -// using System; -// using Unity.Mathematics; -// using static Unity.Mathematics.math; - -// [Serializable] -// public class Selector : Neuron { -// public Selector(Cluster parent, string name) : base(parent, name) { } -// public Selector(ClusterPrefab parent, string name) : base(parent, name) {} - -// public override Nucleus ShallowCloneTo(Cluster newParent) { -// Selector clone = new(newParent, this.name) { -// // array = this.array, -// curve = this.curve, -// curvePreset = this.curvePreset, -// curveMax = this.curveMax, -// }; -// return clone; -// } - -// public override void UpdateStateIsolated() { //float3 bias) { -// float3 max = this.bias; -// float maxSqrLength = lengthsq(max); - -// //Applying the weight factors -// foreach (Synapse synapse in this.synapses) { -// float3 input = synapse.weight * synapse.nucleus.outputValue; - -// float inputSqrlength = lengthsq(input); -// if (inputSqrlength > maxSqrLength) { -// max = input; -// maxSqrLength = inputSqrlength; -// } -// } - -// // Activation function -// float3 result; -// switch (this.curvePreset) { -// case CurvePresets.Linear: -// result = max; -// break; -// case CurvePresets.Sqrt: -// result = normalize(max) * System.MathF.Sqrt(length(max)); -// break; -// case CurvePresets.Power: -// result = normalize(max) * System.MathF.Pow(length(max), 2); -// break; -// case CurvePresets.Reciprocal: { -// float magnitude = length(max); -// if (magnitude > 0) -// result = normalize(max) * (1 / magnitude); -// else -// result = float3(0, 0, 0); -// break; -// } -// default: -// float activatedValue = this.curve.Evaluate(length(max)); -// result = normalize(max) * activatedValue; -// break; -// } -// this.outputValue = result; -// } -// } \ No newline at end of file diff --git a/Selector.cs.meta b/Selector.cs.meta deleted file mode 100644 index 1273f83..0000000 --- a/Selector.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 4218c2f3f15af944db0eadd6e1500d17 \ No newline at end of file