Changeset 16955
- Timestamp:
- 05/15/19 13:28:57 (6 years ago)
- Location:
- branches/2457_ExpertSystem
- Files:
-
- 14 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2457_ExpertSystem/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/InformationAnalysis.cs
r16137 r16955 46 46 public List<double> QualityDelta { get; private set; } 47 47 public double InformationStability { get; private set; } 48 public intRegularity { get; private set; }49 public intDiversity { get; private set; }48 public double Regularity { get; private set; } 49 public double Diversity { get; private set; } 50 50 public Peak PeakInformationContent { get; private set; } 51 51 public Peak PeakSymmetricInformationContent { get; private set; } … … 71 71 var differences = Differences(qualities).ToList(); 72 72 InformationStability = differences.Select(Math.Abs).Max(); 73 Regularity = new HashSet<double>(differences).Count ;74 Diversity = new HashSet<double>(qualities).Count ;73 Regularity = new HashSet<double>(differences).Count / (double)differences.Count; 74 Diversity = new HashSet<double>(qualities).Count / (double)qualities.Count; 75 75 var absDifferences = differences.Select(Math.Abs).OrderBy(d => d).ToList(); 76 76 nQuantiles = Math.Min(nQuantiles, absDifferences.Count); … … 118 118 PeakTotalEntropy = GetPeak(QualityDelta, TotalEntropy); 119 119 PeakSymmetricTotalEntropy = GetPeak(QualityDelta, SymmetricTotalEntropy); 120 } 121 122 public IEnumerable<Tuple<string, object>> GetFeatures() { 123 yield return Tuple.Create("InformationContent", (object)InformationContent[0]); 124 yield return Tuple.Create("DensityBasinInformation", (object)DensityBasinInformation[0]); 125 yield return Tuple.Create("PartialInformationContent", (object)PartialInformationContent[0]); 126 yield return Tuple.Create("TotalEntropy", (object)TotalEntropy[0]); 127 yield return Tuple.Create("InformationStability", (object)InformationStability); 128 yield return Tuple.Create("Regularity", (object)Regularity); 129 yield return Tuple.Create("Diversity", (object)Diversity); 130 yield return Tuple.Create("SymmetricInformationContent", (object)SymmetricInformationContent[0]); 131 yield return Tuple.Create("SymmetricDensityBasinInformation", (object)SymmetricDensityBasinInformation[0]); 132 yield return Tuple.Create("SymmetricTotalEntropy", (object)SymmetricTotalEntropy[0]); 133 yield return Tuple.Create("PeakInformationContent", (object)PeakInformationContent.Value); 134 yield return Tuple.Create("PeakDensityBasinInformation", (object)PeakDensityBasinInformation.Value); 135 yield return Tuple.Create("PeakTotalEntropy", (object)PeakTotalEntropy.Value); 136 yield return Tuple.Create("PeakSymmetricInformationContent", (object)PeakSymmetricInformationContent.Value); 137 yield return Tuple.Create("PeakSymmetricDensityBasinInformation", (object)PeakSymmetricDensityBasinInformation.Value); 138 yield return Tuple.Create("PeakSymmetricTotalEntropy", (object)PeakSymmetricTotalEntropy.Value); 120 139 } 121 140 -
branches/2457_ExpertSystem/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/InformationAnalyzer.cs
r16137 r16955 132 132 InformationStabilityParameter.ActualValue = @is; 133 133 results.AddOrUpdateResult(InformationStabilityParameter.Name, @is); 134 var regularity = new DoubleValue( 1.0 * analysis.Regularity / qualities.Count);134 var regularity = new DoubleValue(analysis.Regularity); 135 135 RegularityParameter.ActualValue = regularity; 136 136 results.AddOrUpdateResult(RegularityParameter.Name, regularity); 137 var diversity = new DoubleValue( 1.0 * analysis.Diversity / qualities.Count);137 var diversity = new DoubleValue(analysis.Diversity); 138 138 DiversityParameter.ActualValue = diversity; 139 139 results.AddOrUpdateResult(DiversityParameter.Name, diversity); -
branches/2457_ExpertSystem/HeuristicLab.Analysis.FitnessLandscape/3.3/Utilities/CurveAnalysis.cs
r16137 r16955 26 26 namespace HeuristicLab.Analysis.FitnessLandscape { 27 27 public static class CurveAnalysis<T> { 28 public static CurveAnalysisResult GetCharacteristics( List<List<Tuple<T, double>>> trajectories, Func<T, T, double> distFunc) {29 trajectories= trajectories.Where(x => x.Count > 5).ToList();30 if (traj ectories.Count == 0) return new CurveAnalysisResult(0, 0, 0, new[] { 0.0, 0.0, 0.0 }, new[] { 0.0, 0.0, 0.0 }, new[] { 0.0, 0.0, 0.0 });28 public static CurveAnalysisResult GetCharacteristics(IEnumerable<List<Tuple<T, double>>> trajectories, Func<T, T, double> distFunc) { 29 var traj = trajectories.Where(x => x.Count > 5).ToList(); 30 if (traj.Count == 0) return new CurveAnalysisResult(0, 0, 0, new[] { 0.0, 0.0, 0.0 }, new[] { 0.0, 0.0, 0.0 }, new[] { 0.0, 0.0, 0.0 }); 31 31 32 var symbols = GetSymbols(traj ectories);33 var f1 = traj ectories.Select(path => ApproximateDerivative(path, distFunc).ToList()).ToList();32 var symbols = GetSymbols(traj); 33 var f1 = traj.Select(path => ApproximateDerivative(path, distFunc).ToList()).ToList(); 34 34 var f2 = f1.Select(d1 => ApproximateDerivative(d1, distFunc).ToList()).ToList(); 35 35 -
branches/2457_ExpertSystem/PerformanceComparison.sln
r16137 r16955 31 31 EndProject 32 32 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{76241AF2-B428-4127-805D-667F79983F0F}" 33 EndProject 34 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WalkExporter", "WalkExporter\WalkExporter.csproj", "{EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}" 33 35 EndProject 34 36 Global … … 210 212 {76241AF2-B428-4127-805D-667F79983F0F}.Release|x86.ActiveCfg = Release|Any CPU 211 213 {76241AF2-B428-4127-805D-667F79983F0F}.Release|x86.Build.0 = Release|Any CPU 214 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 215 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|Any CPU.Build.0 = Debug|Any CPU 216 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|x64.ActiveCfg = Debug|Any CPU 217 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|x64.Build.0 = Debug|Any CPU 218 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|x86.ActiveCfg = Debug|Any CPU 219 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|x86.Build.0 = Debug|Any CPU 220 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|Any CPU.ActiveCfg = Release|Any CPU 221 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|Any CPU.Build.0 = Release|Any CPU 222 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|x64.ActiveCfg = Release|Any CPU 223 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|x64.Build.0 = Release|Any CPU 224 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|x86.ActiveCfg = Release|Any CPU 225 {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|x86.Build.0 = Release|Any CPU 212 226 EndGlobalSection 213 227 GlobalSection(SolutionProperties) = preSolution -
branches/2457_ExpertSystem/ProblemInstanceIdentifier/Program.cs
r16129 r16955 48 48 writer.WriteLine(header); 49 49 Console.WriteLine(header); 50 foreach (var dim in new[] { 20, 30, 40 , 50, 100}) {50 foreach (var dim in new[] { 20, 30, 40 }) { 51 51 foreach (var feat in dwFeatureSets) { 52 52 foreach (var type in dwTypes) { -
branches/2457_ExpertSystem/UnitTests/InformationAnalysisTest.cs
r16137 r16955 15 15 Assert.AreEqual(0.9008, ia.TotalEntropy[0], 1e-04); 16 16 Assert.AreEqual(2, ia.InformationStability); 17 Assert.AreEqual(4 , ia.Diversity);18 Assert.AreEqual(5 , ia.Regularity);17 Assert.AreEqual(4.0 / qualities.Length, ia.Diversity, 1e-07); 18 Assert.AreEqual(5.0 / (qualities.Length - 1), ia.Regularity, 1e-07); 19 19 Assert.AreEqual(0.4603, ia.PeakDensityBasinInformation.Value, 1e-04); 20 20 Assert.AreEqual(0.8224, ia.PeakInformationContent.Value, 1e-04);
Note: See TracChangeset
for help on using the changeset viewer.