Changeset 18117 for branches/3140_NumberSymbol
- Timestamp:
- 12/14/21 14:37:01 (3 years ago)
- Location:
- branches/3140_NumberSymbol
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3140_NumberSymbol
- Property svn:mergeinfo changed
/branches/3139_ParameterChange_SymbolicExpressionTreeLengthAnalyzer (added) merged: 18079-18080,18102 /trunk (added) merged: 18105-18111
- Property svn:mergeinfo changed
-
branches/3140_NumberSymbol/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
branches/3140_NumberSymbol/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Analyzers/SymbolicExpressionTreeLengthAnalyzer.cs
r17180 r18117 52 52 } 53 53 54 public I LookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {55 get { return (I LookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }54 public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter { 55 get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; } 56 56 } 57 57 public ValueLookupParameter<DataTable> SymbolicExpressionTreeLengthsParameter { … … 102 102 : base() { 103 103 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree whose length should be calculated.")); 104 Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length"));104 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length")); 105 105 Parameters.Add(new ValueLookupParameter<DataTable>(SymbolicExpressionTreeLengthsParameterName, "The data table to store the symbolic expression tree lengths.")); 106 106 Parameters.Add(new ValueLookupParameter<DataTableHistory>(SymbolicExpressionTreeLengthsHistoryParameterName, "The data table to store the symbolic expression tree lengths history.")); … … 118 118 [StorableHook(HookType.AfterDeserialization)] 119 119 private void AfterDeserialization() { 120 // reset MaximumSymbolicExpressionTreeLengthParameterName to ValueLookupParameter 121 if (Parameters.TryGetValue(MaximumSymbolicExpressionTreeLengthParameterName, out IParameter treeLengthParam) && !(treeLengthParam is ValueLookupParameter<IntValue>)) 122 Parameters.Remove(MaximumSymbolicExpressionTreeLengthParameterName); 123 if(!Parameters.ContainsKey(MaximumSymbolicExpressionTreeLengthParameterName)) 124 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximum allowed symbolic expression tree length")); 125 120 126 // check if all the parameters are present and accounted for 121 if (!Parameters.ContainsKey(StoreHistoryParameterName)) {127 if (!Parameters.ContainsKey(StoreHistoryParameterName)) 122 128 Parameters.Add(new ValueParameter<BoolValue>(StoreHistoryParameterName, "True if the tree lengths history of the population should be stored.", new BoolValue(false))); 123 }124 if (!Parameters.ContainsKey(UpdateIntervalParameterName)) {129 130 if (!Parameters.ContainsKey(UpdateIntervalParameterName)) 125 131 Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1))); 126 } 132 127 133 //necessary code to correct UpdateCounterParameter - type was changed from LookupParameter to ValueParameter 128 if (Parameters. ContainsKey(UpdateCounterParameterName) && (Parameters[UpdateCounterParameterName] is LookupParameter<IntValue>))134 if (Parameters.TryGetValue(UpdateCounterParameterName, out IParameter updateCounterParam) && updateCounterParam is LookupParameter<IntValue>) 129 135 Parameters.Remove(UpdateCounterParameterName); 130 136 if (!Parameters.ContainsKey(UpdateCounterParameterName)) { -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis (added) merged: 18107-18108,18110-18111
- Property svn:mergeinfo changed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression (added) merged: 18107
- Property svn:mergeinfo changed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4 (added) merged: 18107
- Property svn:mergeinfo changed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/ShapeConstrainedRegressionSingleObjectiveProblem.cs
r17964 r18117 28 28 [StorableType("B35ADCA7-E902-4BEE-9DDE-DF8BBC1E27FE")] 29 29 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 150)] 30 public class ShapeConstrainedRegressionSingleObjectiveProblem : SymbolicRegressionSingleObjectiveProblem {30 public class ShapeConstrainedRegressionSingleObjectiveProblem : SymbolicRegressionSingleObjectiveProblem, IShapeConstrainedRegressionProblem { 31 31 [StorableConstructor] 32 32 protected ShapeConstrainedRegressionSingleObjectiveProblem(StorableConstructorFlag _) : base(_) { } … … 34 34 public override IDeepCloneable Clone(Cloner cloner) { return new ShapeConstrainedRegressionSingleObjectiveProblem(this, cloner); } 35 35 36 public ShapeConstrainedRegressionProblemData ShapeConstrainedRegressionProblemData { 37 get => (ShapeConstrainedRegressionProblemData)ProblemData; 38 set => ProblemData = value; 39 } 36 40 public ShapeConstrainedRegressionSingleObjectiveProblem() 37 41 : base(new ShapeConstrainedRegressionProblemData(), new NMSESingleObjectiveConstraintsEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { … … 51 55 52 56 public override void Load(IRegressionProblemData data) { 53 var scProblemData = new ShapeConstrainedRegressionProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable, 54 data.TrainingPartition, data.TestPartition) { 55 Name = data.Name, 56 Description = data.Description 57 }; 57 if (data is ShapeConstrainedRegressionProblemData scProblemData) { 58 } else { 59 scProblemData = new ShapeConstrainedRegressionProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable, 60 data.TrainingPartition, data.TestPartition) { 61 Name = data.Name, 62 Description = data.Description 63 }; 64 } 58 65 59 66 base.Load(scProblemData); -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis/3.4 (added) merged: 18107-18108,18110-18111
- Property svn:mergeinfo changed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs
r17180 r18117 92 92 93 93 #region Import & Export 94 public v oid Load(T data) {94 public virtual void Load(T data) { 95 95 Name = data.Name; 96 96 Description = data.Description; … … 98 98 } 99 99 100 public T Export() {100 public virtual T Export() { 101 101 return ProblemData; 102 102 } -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ShapeConstrainedRegressionProblem.cs
r17960 r18117 24 24 using HeuristicLab.Core; 25 25 26 namespace HeuristicLab.Problems.DataAnalysis {26 namespace HeuristicLab.Problems.DataAnalysis { 27 27 [StorableType("B53C4C71-3715-4BB1-9A95-4E969D8135C6")] 28 28 [Item("Shape-constrained Regression Problem", "A regression problem with shape constraints.")] 29 public class ShapeConstrainedRegressionProblem : DataAnalysisProblem<I ShapeConstrainedRegressionProblemData>, IShapeConstrainedRegressionProblem {29 public class ShapeConstrainedRegressionProblem : DataAnalysisProblem<IRegressionProblemData>, IShapeConstrainedRegressionProblem { 30 30 [StorableConstructor] 31 31 protected ShapeConstrainedRegressionProblem(StorableConstructorFlag _) : base(_) { } … … 33 33 public override IDeepCloneable Clone(Cloner cloner) { return new ShapeConstrainedRegressionProblem(this, cloner); } 34 34 35 public ShapeConstrainedRegressionProblemData ShapeConstrainedRegressionProblemData { 36 get => (ShapeConstrainedRegressionProblemData)ProblemData; 37 set => ProblemData = value; 38 } 35 39 public ShapeConstrainedRegressionProblem() : base(new ShapeConstrainedRegressionProblemData()) { } 40 41 42 public override void Load(IRegressionProblemData data) { 43 if (data is ShapeConstrainedRegressionProblemData scProblemData) { 44 // use directly 45 } else { 46 scProblemData = new ShapeConstrainedRegressionProblemData(data.Dataset, data.AllowedInputVariables, data.TargetVariable, 47 data.TrainingPartition, data.TestPartition) { 48 Name = data.Name, 49 Description = data.Description 50 }; 51 } 52 base.Load(scProblemData); 53 } 36 54 } 37 55 } -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ShapeConstrainedRegressionProblemData.cs
r18034 r18117 145 145 : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable, 146 146 regressionProblemData.TrainingPartition, regressionProblemData.TestPartition, regressionProblemData.Transformations, 147 (regressionProblemData is ShapeConstrainedRegressionProblemData) ? ((ShapeConstrainedRegressionProblemData)regressionProblemData).ShapeConstraints : null, 147 (regressionProblemData is ShapeConstrainedRegressionProblemData) ? ((ShapeConstrainedRegressionProblemData)regressionProblemData).ShapeConstraints : null, 148 148 regressionProblemData.VariableRanges) { 149 149 } … … 159 159 if (sc == null) sc = new ShapeConstraints(); 160 160 Parameters.Add(new FixedValueParameter<ShapeConstraints>(ShapeConstraintsParameterName, "Specifies the shape constraints for the regression problem.", (ShapeConstraints)sc.Clone())); 161 161 if (variableRanges != null) { 162 foreach (var entry in variableRanges.GetVariableIntervals()) 163 VariableRanges.SetInterval(entry.Item1, entry.Item2); 164 } 162 165 RegisterEventHandlers(); 163 166 } -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IShapeConstrainedRegressionProblem.cs
r17960 r18117 24 24 namespace HeuristicLab.Problems.DataAnalysis { 25 25 [StorableType("C6E9D32A-7727-487E-859C-DF24EDCC5922")] 26 public interface IShapeConstrainedRegressionProblem : IDataAnalysisProblem<IShapeConstrainedRegressionProblemData> { 26 public interface IShapeConstrainedRegressionProblem : IRegressionProblem { 27 ShapeConstrainedRegressionProblemData ShapeConstrainedRegressionProblemData { get; set; } 27 28 } 28 29 } -
branches/3140_NumberSymbol/HeuristicLab.Problems.Instances.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.Instances.DataAnalysis (added) merged: 18106
- Property svn:mergeinfo changed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus9.cs
r18032 r18117 74 74 if (targetNoise != null) data.Add(targetNoise); 75 75 76 //var targetNoise = GetNoisyTarget(r, rand);77 //if (targetNoise != null) data.Add(targetNoise);78 79 76 return data; 80 77 } -
branches/3140_NumberSymbol/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanLargeInstanceProvider.cs
r17805 r18117 35 35 36 36 37 var noiseRatio = new double?[] { null, 0.1, 0. 3, 1};37 var noiseRatio = new double?[] { null, 0.1, 0.25, 0.50, 0.75 }; 38 38 39 39 #region types -
branches/3140_NumberSymbol/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanSmallInstanceProvider.cs
r17805 r18117 35 35 36 36 37 var noiseRatio = new double?[] { null, 0.1, 0. 3, 1};37 var noiseRatio = new double?[] { null, 0.1, 0.25, 0.50, 0.75 }; 38 38 39 39 #region types -
branches/3140_NumberSymbol/HeuristicLab.Problems.QuadraticAssignment.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.QuadraticAssignment.Views (added) merged: 18109
- Property svn:mergeinfo changed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/HeuristicLab.Problems.QuadraticAssignment.Views-3.3.csproj
r16565 r18117 225 225 226 226 call PreBuildEvent.cmd 227 SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\Plugin.cs.frame" "%25ProjectDir%25\Plugin.cs"228 227 </PreBuildEvent> 229 228 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
Note: See TracChangeset
for help on using the changeset viewer.