Changeset 10396
- Timestamp:
- 01/26/14 01:42:09 (11 years ago)
- Location:
- branches/Sliding Window GP
- Files:
-
- 108 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r10364 r10396 41 41 <DebugType>full</DebugType> 42 42 <Optimize>false</Optimize> 43 <OutputPath> $(SolutionDir)\bin\</OutputPath>43 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 44 44 <DefineConstants>DEBUG;TRACE</DefineConstants> 45 45 <ErrorReport>prompt</ErrorReport> … … 93 93 </PropertyGroup> 94 94 <ItemGroup> 95 <Reference Include="ALGLIB-3.7.0 , Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">96 <HintPath>..\..\ bin\ALGLIB-3.7.0.dll</HintPath>95 <Reference Include="ALGLIB-3.7.0"> 96 <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.7.0.dll</HintPath> 97 97 <Private>False</Private> 98 98 </Reference> … … 100 100 <SpecificVersion>False</SpecificVersion> 101 101 <HintPath>..\..\..\..\trunk\sources\bin\EPPlus-3.1.3.dll</HintPath> 102 <Private>False</Private> 103 </Reference> 104 <Reference Include="HeuristicLab.Analysis-3.3"> 105 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath> 106 </Reference> 107 <Reference Include="HeuristicLab.Analysis.Views-3.3"> 108 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis.Views-3.3.dll</HintPath> 102 109 <Private>False</Private> 103 110 </Reference> … … 192 199 </ItemGroup> 193 200 <ItemGroup> 194 <Compile Include="Exporters\SymbolicSolutionExcelExporter.cs" />195 201 <Compile Include="InteractiveSymbolicExpressionTreeChart.cs"> 196 202 <SubType>UserControl</SubType> … … 206 212 </Compile> 207 213 <Compile Include="Plugin.cs" /> 214 <Compile Include="SlidingWindowBestSolutionsCollectionView.cs"> 215 <SubType>UserControl</SubType> 216 </Compile> 217 <Compile Include="SlidingWindowBestSolutionsCollectionView.Designer.cs"> 218 <DependentUpon>SlidingWindowBestSolutionsCollectionView.cs</DependentUpon> 219 </Compile> 208 220 <Compile Include="SlidingWindowDataView.cs"> 209 221 <SubType>UserControl</SubType> … … 319 331 </ItemGroup> 320 332 <ItemGroup> 321 <EmbeddedResource Include="SlidingWindowDataView.resx"> 322 <DependentUpon>SlidingWindowDataView.cs</DependentUpon> 333 <Folder Include="Exporters\" /> 334 </ItemGroup> 335 <ItemGroup> 336 <EmbeddedResource Include="SlidingWindowBestSolutionsCollectionView.resx"> 337 <DependentUpon>SlidingWindowBestSolutionsCollectionView.cs</DependentUpon> 323 338 </EmbeddedResource> 324 339 </ItemGroup> -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs
r10373 r10396 88 88 protected BoolValue PruneOnlyZeroImpactNodes { get { return PruneOnlyZeroImpactNodesParameter.Value; } } 89 89 #endregion 90 91 [StorableConstructor] 92 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(bool deserializing) : base(deserializing) { } 90 93 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner) 91 94 : base(original, cloner) { -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r10373 r10396 158 158 <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs" /> 159 159 <Compile Include="SlidingWindow\OffspringSelectionSlidingWindowAnalyzer.cs" /> 160 <Compile Include="SlidingWindow\SlidingWindowBestSolutionsCollection.cs"> 161 <SubType>Code</SubType> 162 </Compile> 160 163 <Compile Include="SlidingWindow\SlidingWindowData.cs" /> 161 164 <Compile Include="SlidingWindow\GenerationalSlidingWindowAnalyzer.cs" /> -
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowAnalyzer.cs
r9707 r10396 20 20 #endregion 21 21 22 using System; 23 using System.Linq; 22 24 using HeuristicLab.Common; 23 25 using HeuristicLab.Core; 24 26 using HeuristicLab.Data; 27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 25 28 using HeuristicLab.Operators; 26 29 using HeuristicLab.Optimization; … … 31 34 [StorableClass] 32 35 [Item("Sliding Window GP Analyzer", "Base class for concrete sliding window GP analyzers.")] 33 public abstract class SlidingWindowAnalyzer : SymbolicDataAnalysis Analyzer {36 public abstract class SlidingWindowAnalyzer : SymbolicDataAnalysisSingleObjectiveAnalyzer { 34 37 private const string ProblemDataParameterName = "ProblemData"; 35 38 private const string EvaluatorParameterName = "Evaluator"; … … 41 44 private const string InitialSlidingWindowParameterName = "Initial Sliding Window"; 42 45 private const string TerminateSlidingWindowParameterName = "TerminateSlidingWindow"; 46 private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter"; 43 47 44 48 #region parameter properties 49 private ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter { 50 get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; } 51 } 45 52 public IValueLookupParameter<IDataAnalysisProblemData> ProblemDataParameter { 46 53 get { return (IValueLookupParameter<IDataAnalysisProblemData>)Parameters[ProblemDataParameterName]; } … … 75 82 public override bool EnabledByDefault { get { return false; } } 76 83 public IntValue SlidingWindowSize { get { return SlidingWindowSizeParameter.Value; } } 77 public IntValue Valid iationSlidingWindowSize { get { return ValidationSlidingWindowSizeParameter.Value; } }84 public IntValue ValidationSlidingWindowSize { get { return ValidationSlidingWindowSizeParameter.Value; } } 78 85 public IntValue SlidingWindowStepWidth { get { return SlidingWindowStepWidthParameter.Value; } } 79 86 public IntRange InitialSlidingWindow { get { return InitialSlidingWindowParameter.Value; } } 87 public ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get { return InterpreterParameter.ActualValue; } } 88 public IDataAnalysisProblemData ProblemData { get { return ProblemDataParameter.ActualValue; } } 80 89 #endregion 81 82 90 83 91 [StorableConstructor] … … 97 105 Parameters.Add(new FixedValueParameter<IntRange>(InitialSlidingWindowParameterName, "", new IntRange(0, 1))); 98 106 Parameters.Add(new LookupParameter<BoolValue>(TerminateSlidingWindowParameterName, "")); 107 if (!Parameters.ContainsKey(InterpreterParameterName)) 108 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName, "")); 109 if (!Parameters.ContainsKey("Quality")) 110 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "")); 111 if (!Parameters.ContainsKey("Maximization")) 112 Parameters.Add(new LookupParameter<BoolValue>("Maximization", "The direction of optimization.")); 113 ProblemDataParameter.Hidden = true; 99 114 100 ProblemDataParameter.Hidden = true;101 115 } 102 116 … … 105 119 if (!Parameters.ContainsKey(EvaluatorParameterName)) 106 120 Parameters.Add(new LookupParameter<IEvaluator>(EvaluatorParameterName, "")); 121 if (!Parameters.ContainsKey(InterpreterParameterName)) 122 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName, "")); 123 if (!Parameters.ContainsKey("Quality")) 124 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "")); 125 if (!Parameters.ContainsKey("Maximization")) 126 Parameters.Add(new LookupParameter<BoolValue>("Maximization", "The direction of optimization.")); 127 if (!Parameters.ContainsKey(ProblemDataParameterName)) 128 Parameters.Add(new LookupParameter<IDataAnalysisProblemData>(ProblemDataParameterName)); 107 129 } 108 130 … … 112 134 TerminateSlidingWindowParameter.ActualValue = new BoolValue(false); 113 135 FitnessCalculationPartitionParameter.ActualValue = (IntRange)InitialSlidingWindow.Clone(); 114 ValidationPartitionParameter.ActualValue = new IntRange(InitialSlidingWindow.End, InitialSlidingWindow.End + Valid iationSlidingWindowSize.Value);136 ValidationPartitionParameter.ActualValue = new IntRange(InitialSlidingWindow.End, InitialSlidingWindow.End + ValidationSlidingWindowSize.Value); 115 137 return base.Apply(); 116 138 } 117 139 118 140 if (!CheckForUpdate()) return base.Apply(); 141 142 SaveBestSolution(); 119 143 120 144 //update necessary - move sliding window … … 136 160 FitnessCalculationPartitionParameter.ActualValue.End = fitnessPartition.End; 137 161 ValidationPartitionParameter.ActualValue.Start = fitnessPartition.End; 138 ValidationPartitionParameter.ActualValue.End = ValidationPartitionParameter.ActualValue.Start + Valid iationSlidingWindowSize.Value;162 ValidationPartitionParameter.ActualValue.End = ValidationPartitionParameter.ActualValue.Start + ValidationSlidingWindowSize.Value; 139 163 140 164 //reevaluate all individuals with new sliding window … … 147 171 } 148 172 173 private ISymbolicExpressionTree FindBestIndividual() { 174 var pop = SymbolicExpressionTree.Zip(Quality, (t, q) => new { Tree = t, Quality = q.Value }).ToList(); 175 Func<double, double, int> comparer = (a, b) => Maximization.Value ? a.CompareTo(b) : b.CompareTo(a); 176 pop.Sort((a, b) => comparer(a.Quality, b.Quality)); 177 return pop.Last().Tree; 178 } 179 180 private void SaveBestSolution() { 181 var bestSolutionsCollection = (SlidingWindowBestSolutionsCollection)ResultCollection["Best Solutions"].Value; 182 183 if (bestSolutionsCollection.ProblemData == null) 184 bestSolutionsCollection.ProblemData = ProblemData; 185 186 if (bestSolutionsCollection.Interpreter == null) 187 bestSolutionsCollection.Interpreter = Interpreter; 188 189 var fitnessPartition = FitnessCalculationPartitionParameter.ActualValue; 190 var best = FindBestIndividual(); 191 var range = new IntRange(fitnessPartition.Start, fitnessPartition.End); 192 193 bestSolutionsCollection.Add(best, range); 194 } 195 149 196 protected abstract bool CheckForUpdate(); 150 197 } -
branches/Sliding Window GP/PreBuildEvent.cmd
r7845 r10396 1 IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs"2 IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs"1 REM IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs" 2 REM IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs" -
branches/Sliding Window GP/Sliding Window GP.sln
r7845 r10396 1 1 2 Microsoft Visual Studio Solution File, Format Version 11.00 3 # Visual Studio 2010 2 Microsoft Visual Studio Solution File, Format Version 12.00 3 # Visual Studio 2013 4 VisualStudioVersion = 12.0.30110.0 5 MinimumVisualStudioVersion = 10.0.40219.1 4 6 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj", "{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}" 5 7 EndProject … … 10 12 EndProject 11 13 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic.Views\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj", "{7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}" 14 EndProject 15 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic.Classification\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj", "{05BAE4E1-A9FA-4644-AA77-42558720159E}" 16 EndProject 17 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj", "{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}" 12 18 EndProject 13 19 Global … … 45 51 {7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|x86.ActiveCfg = Release|x86 46 52 {7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086}.Release|x86.Build.0 = Release|x86 53 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 54 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|Any CPU.Build.0 = Debug|Any CPU 55 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|x64.ActiveCfg = Debug|x64 56 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|x64.Build.0 = Debug|x64 57 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|x86.ActiveCfg = Debug|x86 58 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Debug|x86.Build.0 = Debug|x86 59 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|Any CPU.ActiveCfg = Release|Any CPU 60 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|Any CPU.Build.0 = Release|Any CPU 61 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|x64.ActiveCfg = Release|x64 62 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|x64.Build.0 = Release|x64 63 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|x86.ActiveCfg = Release|x86 64 {05BAE4E1-A9FA-4644-AA77-42558720159E}.Release|x86.Build.0 = Release|x86 65 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 66 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|Any CPU.Build.0 = Debug|Any CPU 67 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|x64.ActiveCfg = Debug|x64 68 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|x64.Build.0 = Debug|x64 69 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|x86.ActiveCfg = Debug|x86 70 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Debug|x86.Build.0 = Debug|x86 71 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|Any CPU.ActiveCfg = Release|Any CPU 72 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|Any CPU.Build.0 = Release|Any CPU 73 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|x64.ActiveCfg = Release|x64 74 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|x64.Build.0 = Release|x64 75 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|x86.ActiveCfg = Release|x86 76 {5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}.Release|x86.Build.0 = Release|x86 47 77 EndGlobalSection 48 78 GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset
for help on using the changeset viewer.