-
Notifications
You must be signed in to change notification settings - Fork 0
/
Synapse.cs
56 lines (42 loc) · 999 Bytes
/
Synapse.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Created by: Silver Phoenix
* Created: sábado, 30 de Junho de 2007
*/
using System;
using System.Diagnostics;
namespace dasp.Neat
{
[Serializable]
[DebuggerDisplay("[{Source} Enabled = {Enabled}]: Weight = {Weight}")]
public class Synapse: IComparable<Synapse>
{
#region FIELDS
public bool Enabled;
public readonly int Source;
public double Weight;
#endregion
#region PROPERTIES
#endregion
#region CONSTRUCTORS
public Synapse(int source, double weight)
{
Source = source;
Weight = weight;
Enabled = true;
}
#endregion
#region METHODS
public Synapse Clone()
{
Synapse s = new Synapse(Source, Weight) {Enabled = Enabled};
return s;
}
public override string ToString()
{
return string.Format("[{0} {2}]: Weight = {1}", Source, Weight,
Enabled ? 'E' : 'D');
}
public int CompareTo(Synapse other) => Source.CompareTo(other?.Source);
#endregion
}
}