- Timestamp:
- 09/20/11 11:12:10 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:ignore
-
old new 13 13 *.vsp 14 14 *.docstates 15 bin 16 HeuristicLab 3.3.6.0.ReSharper.user
-
- Property svn:mergeinfo changed
/branches/GP.Grammar.Editor (added) merged: 6284-6285,6296,6299,6335,6337,6377,6379,6387,6403,6409,6415,6493-6494,6497,6618,6620,6622,6626,6647,6675,6782,6784,6786,6795
- Property svn:ignore
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
-
Property
svn:ignore
set to
bin
-
Property
svn:ignore
set to
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Argument.cs
r6233 r6803 32 32 public const string ArgumentName = "Argument"; 33 33 public const string ArgumentDescription = "Symbol that represents a function argument."; 34 private const int minimumArity = 0; 35 private const int maximumArity = 0; 36 37 public override int MinimumArity { 38 get { return minimumArity; } 39 } 40 public override int MaximumArity { 41 get { return maximumArity; } 42 } 43 34 44 [Storable] 35 45 private int argumentIndex; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Defun.cs
r5809 r6803 32 32 public const string DefunName = "Defun"; 33 33 public const string DefunDescription = "Symbol that represents a function defining node."; 34 private const int minimumArity = 1; 35 private const int maximumArity = 1; 36 37 public override int MinimumArity { 38 get { return minimumArity; } 39 } 40 public override int MaximumArity { 41 get { return maximumArity; } 42 } 34 43 35 44 [StorableConstructor] -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/InvokeFunction.cs
r6233 r6803 32 32 public const string InvokeFunctionName = "InvokeFunction"; 33 33 public const string InvokeFunctionDescription = "Symbol that the invocation of another function."; 34 private const int minimumArity = 0; 35 private const int maximumArity = byte.MaxValue; 36 37 public override int MinimumArity { 38 get { return minimumArity; } 39 } 40 public override int MaximumArity { 41 get { return maximumArity; } 42 } 34 43 35 44 [Storable] -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/ProgramRootSymbol.cs
r5809 r6803 29 29 public const string ProgramRootSymbolName = "ProgramRootSymbol"; 30 30 public const string ProgramRootSymbolDescription = "Special symbol that represents the program root node of a symbolic expression tree."; 31 private const int minimumArity = 1; 32 private const int maximumArity = byte.MaxValue; 33 34 public override int MinimumArity { 35 get { return minimumArity; } 36 } 37 public override int MaximumArity { 38 get { return maximumArity; } 39 } 31 40 32 41 [StorableConstructor] -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/StartSymbol.cs
r5809 r6803 29 29 public const string StartSymbolName = "StartSymbol"; 30 30 public const string StartSymbolDescription = "Special symbol that represents the starting node of the result producing branch of a symbolic expression tree."; 31 private const int minimumArity = 1; 32 private const int maximumArity = 1; 33 34 public override int MinimumArity { 35 get { return minimumArity; } 36 } 37 public override int MaximumArity { 38 get { return maximumArity; } 39 } 31 40 32 41 [StorableConstructor] 33 private StartSymbol(bool deserializing) : base(deserializing) { } 42 private StartSymbol(bool deserializing) 43 : base(deserializing) { 44 } 34 45 private StartSymbol(StartSymbol original, Cloner cloner) : base(original, cloner) { } 35 46 public StartSymbol() : base(StartSymbol.StartSymbolName, StartSymbol.StartSymbolDescription) { } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Symbols/Symbol.cs
r6233 r6803 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 42 43 } 43 44 } 45 46 [Storable(DefaultValue = true)] 47 private bool enabled; 48 public virtual bool Enabled { 49 get { return enabled; } 50 set { 51 if (value != enabled) { 52 enabled = value; 53 OnChanged(EventArgs.Empty); 54 } 55 } 56 } 57 58 [Storable(DefaultValue = false)] 59 private bool @fixed; 60 public bool Fixed { 61 get { return @fixed; } 62 set { 63 if (value != @fixed) { 64 @fixed = value; 65 OnChanged(EventArgs.Empty); 66 } 67 } 68 } 69 44 70 public override bool CanChangeName { 45 71 get { return !(this is IReadOnlySymbol); } … … 48 74 get { return false; } 49 75 } 76 77 public abstract int MinimumArity { get; } 78 public abstract int MaximumArity { get; } 50 79 #endregion 51 80 … … 55 84 : base(original, cloner) { 56 85 initialFrequency = original.initialFrequency; 86 enabled = original.enabled; 87 @fixed = original.@fixed; 57 88 } 58 89 … … 60 91 : base(name, description) { 61 92 initialFrequency = 1.0; 93 enabled = true; 94 @fixed = false; 95 } 96 97 [StorableHook(HookType.AfterDeserialization)] 98 private void AfterDeserialization() { 99 // BackwardsCompatibility3.3 100 #region Backwards compatible code, remove with 3.4 101 if (initialFrequency.IsAlmost(0.0) && !(this is GroupSymbol)) enabled = false; 102 #endregion 103 62 104 } 63 105 … … 66 108 } 67 109 68 #region events 110 public virtual IEnumerable<ISymbol> Flatten() { 111 yield return this; 112 } 113 69 114 public event EventHandler Changed; 70 protected v oid OnChanged(EventArgs e) {115 protected virtual void OnChanged(EventArgs e) { 71 116 EventHandler handlers = Changed; 72 117 if (handlers != null) 73 118 handlers(this, e); 74 119 } 75 #endregion76 120 } 77 121 }
Note: See TracChangeset
for help on using the changeset viewer.