- Timestamp:
- 04/18/19 13:23:10 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/ArtificialAnt/Problem.cs
r16723 r16813 23 23 using System.Diagnostics.Contracts; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 29 30 using HeuristicLab.Optimization; 30 31 using HeuristicLab.Parameters; 31 using HEAL.Attic;32 32 33 33 … … 116 116 #endregion 117 117 118 public Problem() 119 : base() { 118 public Problem() : base(new SymbolicExpressionTreeEncoding()) { 120 119 BoolMatrix world = new BoolMatrix(ToBoolMatrix(santaFeAntTrail)); 121 120 Parameters.Add(new ValueParameter<BoolMatrix>("World", "The world for the artificial ant with scattered food items.", world)); 122 121 Parameters.Add(new ValueParameter<IntValue>("MaximumTimeSteps", "The number of time steps the artificial ant has available to collect all food items.", new IntValue(600))); 123 122 124 base.BestKnownQuality = 89;125 123 var g = new SimpleSymbolicExpressionGrammar(); 126 124 g.AddSymbols(new string[] { "IfFoodAhead", "Prog2" }, 2, 2); 127 125 g.AddSymbols(new string[] { "Prog3" }, 3, 3); 128 126 g.AddTerminalSymbols(new string[] { "Move", "Left", "Right" }); 129 base.Encoding = new SymbolicExpressionTreeEncoding(g, 20, 10); 127 128 Encoding.TreeLength = 20; 129 Encoding.TreeDepth = 10; 130 Encoding.Grammar = g; 131 base.BestKnownQuality = 89; 130 132 } 131 133 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/BasicSymbolicRegression/Problem.cs
r16723 r16813 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 29 using HeuristicLab.Parameters; 29 using HEAL.Attic;30 30 using HeuristicLab.Problems.DataAnalysis; 31 31 using HeuristicLab.Problems.Instances; … … 81 81 #endregion 82 82 83 public Problem() 84 : base() { 83 public Problem() : base(new SymbolicExpressionTreeEncoding()) { 85 84 Parameters.Add(new ValueParameter<IRegressionProblemData>(ProblemDataParameterName, "The data for the regression problem", new RegressionProblemData())); 86 85 87 var g = new SimpleSymbolicExpressionGrammar(); // empty grammar is replaced in UpdateGrammar()88 base.Encoding = new SymbolicExpressionTreeEncoding(g, 100, 17);86 Encoding.TreeLength = 100; 87 Encoding.TreeDepth = 17; 89 88 90 89 UpdateGrammar(); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/Boolean/EvenParityProblem.cs
r16723 r16813 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 28 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 29 30 using HeuristicLab.Parameters; 30 using HEAL.Attic;31 31 32 32 … … 78 78 79 79 public EvenParityProblem() 80 : base( ) {80 : base(new SymbolicExpressionTreeEncoding()) { 81 81 Parameters.Add(new FixedValueParameter<IntValue>(NumberOfBitsParameterName, "The number of bits for the input parameter for the even parity function", new IntValue(4))); 82 82 83 var g = new SimpleSymbolicExpressionGrammar(); // will be replaced in update grammar84 Encoding = new SymbolicExpressionTreeEncoding(g, 100, 17);83 Encoding.TreeLength = 100; 84 Encoding.TreeDepth = 17; 85 85 86 86 UpdateGrammar(); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/Boolean/MultiplexerProblem.cs
r16723 r16813 24 24 using System.Diagnostics.Contracts; 25 25 using System.Linq; 26 using HEAL.Attic; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; … … 29 30 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 30 31 using HeuristicLab.Parameters; 31 using HEAL.Attic;32 32 33 33 … … 81 81 82 82 public MultiplexerProblem() 83 : base( ) {83 : base(new SymbolicExpressionTreeEncoding()) { 84 84 Parameters.Add(new FixedValueParameter<IntValue>(NumberOfBitsParameterName, 85 85 "The number of bits for the input parameter for the multiplexer function. This is the sum of the number of address bits and the number of input lines. E.g. the 11-MUX has 3 address bits and 8 input lines", 86 86 new IntValue(11))); 87 87 88 var g = new SimpleSymbolicExpressionGrammar(); // will be replaced in update grammar 89 Encoding = new SymbolicExpressionTreeEncoding(g, 100, 17); 90 88 Encoding.TreeLength = 100; 89 Encoding.TreeDepth = 17; 91 90 UpdateGrammar(); 92 91 RegisterEventHandlers(); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/LawnMower/Problem.cs
r16723 r16813 22 22 using System; 23 23 using System.Linq; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Parameters; 30 using HEAL.Attic;31 31 using HeuristicLab.Random; 32 32 … … 62 62 #endregion 63 63 64 public Problem() 65 : base() { 64 public Problem() : base(new SymbolicExpressionTreeEncoding()) { 66 65 Parameters.Add(new FixedValueParameter<IntValue>(LawnWidthParameterName, "Width of the lawn.", new IntValue(8))); 67 66 Parameters.Add(new FixedValueParameter<IntValue>(LawnLengthParameterName, "Length of the lawn.", new IntValue(8))); … … 77 76 } 78 77 79 Encoding = new SymbolicExpressionTreeEncoding(g, 1000, 17); 78 Encoding.TreeLength = 1000; 79 Encoding.TreeDepth = 17; 80 Encoding.Grammar = g; 80 81 } 81 82 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.GeneticProgramming/3.3/robocode/Problem.cs
r16723 r16813 20 20 #endregion 21 21 22 using HEAL.Attic; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; 28 using HEAL.Attic;29 29 30 30 namespace HeuristicLab.Problems.GeneticProgramming.Robocode { … … 73 73 } 74 74 75 public Problem() 76 : base() { 75 public Problem() : base(new SymbolicExpressionTreeEncoding()) { 77 76 DirectoryValue robocodeDir = new DirectoryValue { Value = @"robocode" }; 78 77 … … 85 84 Parameters.Add(new ValueParameter<EnemyCollection>(EnemiesParameterName, "The enemies that should be battled.", robotList)); 86 85 87 Encoding = new SymbolicExpressionTreeEncoding(new Grammar(), 1000, 10); 86 Encoding.TreeLength = 1000; 87 Encoding.TreeDepth = 10; 88 Encoding.Grammar = new Grammar(); 88 89 Encoding.FunctionArguments = 0; 89 90 Encoding.FunctionDefinitions = 0; … … 134 135 } 135 136 136 void RobocodePathParameter_ValueChanged(object sender, System.EventArgs e) {137 private void RobocodePathParameter_ValueChanged(object sender, System.EventArgs e) { 137 138 EnemiesParameter.Value.RobocodePath = RobocodePathParameter.Value.Value; 138 139 }
Note: See TracChangeset
for help on using the changeset viewer.