Changeset 7800
- Timestamp:
- 05/14/12 02:09:50 (13 years ago)
- Location:
- branches/HeuristicLab.EvolutionaryTracking
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj.user
r7788 r7800 7 7 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> 8 8 <StartAction>Program</StartAction> 9 <StartProgram>C:\Users\ bburlacu\Desktop\HL-Core\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>9 <StartProgram>C:\Users\Bogdan\Desktop\Trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram> 10 10 </PropertyGroup> 11 11 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs
r7799 r7800 26 26 27 27 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { 28 [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.779 2")]28 [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.7799")] 29 29 [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs
r7799 r7800 111 111 if (arc != null) { 112 112 var fragment = arc.Data as ISymbolicExpressionTreeNode; 113 //var fragmentNodes = fragment.IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>; 114 //var treeNodes = tree.IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>; 115 //var idx = SymbolicExpressionTreeMatching.FindMatch(treeNodes, fragmentNodes, (int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact); 113 116 foreach (var node in fragment.IterateNodesBreadth()) { 114 117 var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node); 115 118 visualNode.FillColor = Color.LightGreen; 116 119 } 120 symbolicExpressionTreeChart.Repaint(); 117 121 } 118 122 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Analyzers/SymbolicExpressionTreeFragmentsAnalyzer.cs
r7799 r7800 52 52 private const string GenerationsParameterName = "Generations"; 53 53 private const string FragmentStatisticsParameterName = "FragmentStatistics"; 54 private const string FragmentLengthsDistributionParametersName = "FragmentLengths"; 54 55 55 56 #region Parameter properties … … 78 79 get { return (LookupParameter<DataTable>)Parameters[FragmentStatisticsParameterName]; } 79 80 } 81 public LookupParameter<DataTable> FragmentLengthsParameter { 82 get { return (LookupParameter<DataTable>)Parameters[FragmentLengthsDistributionParametersName]; } 83 } 80 84 #endregion 81 85 … … 107 111 public DataTable FragmentStatistics { 108 112 get { return FragmentStatisticsParameter.ActualValue; } 113 } 114 public DataTable FragmentLengths { 115 get { return FragmentLengthsParameter.ActualValue; } 109 116 } 110 117 #endregion … … 130 137 Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName, "The number of generations so far.")); 131 138 Parameters.Add(new LookupParameter<DataTable>(FragmentStatisticsParameterName, "The data table to store the fragment statistics.")); 139 Parameters.Add(new LookupParameter<DataTable>(FragmentLengthsDistributionParametersName, "The data table to store the distribution of fragment lengths.")); 132 140 UpdateCounterParameter.Hidden = true; 133 141 UpdateIntervalParameter.Hidden = true; … … 140 148 Parameters.Add(new ValueParameter<IntValue>(UpdateIntervalParameterName, "The interval in which the tree length analysis should be applied.", new IntValue(1))); 141 149 } 142 if (Parameters.ContainsKey(UpdateCounterParameterName)) return; 143 Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called since the last update", new IntValue(0))); 144 UpdateCounterParameter.Hidden = true; 150 if (!Parameters.ContainsKey(UpdateCounterParameterName)) { 151 Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called since the last update", new IntValue(0))); 152 UpdateCounterParameter.Hidden = true; 153 } 154 if (!Parameters.ContainsKey(FragmentLengthsDistributionParametersName)) { 155 Parameters.Add(new LookupParameter<DataTable>(FragmentLengthsDistributionParametersName, "The data table to store the distribution of fragment lengths.")); 156 } 145 157 } 146 158 #endregion … … 167 179 results.Add(new Result("Fragment Statistics", FragmentStatistics)); 168 180 } 181 if (FragmentLengths == null) { 182 FragmentLengthsParameter.ActualValue = new DataTable("Fragment and Tree Lengths", "Distribution of the lengths of the trees sampled by crossover"); 183 FragmentLengths.VisualProperties.XAxisTitle = "Tree/fragment length"; 184 results.Add(new Result("Fragment Lengths", FragmentLengths)); 185 } 169 186 170 187 UpdateCounter.Value = 0; // reset counter … … 173 190 174 191 #region Fragment Statistics 192 #region Table data 193 if (!FragmentLengths.Rows.ContainsKey("Parent lengths distribution")) { 194 var parentLenghtsRow = new DataRow("Parent lengths distribution"); 195 parentLenghtsRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 196 parentLenghtsRow.VisualProperties.StartIndexZero = true; 197 parentLenghtsRow.VisualProperties.ScaleFactor = 1.0; 198 FragmentLengths.Rows.Add(parentLenghtsRow); 199 } 200 if (!FragmentLengths.Rows.ContainsKey("Child lengths distribution")) { 201 var treeLengthsRow = new DataRow("Child lengths distribution"); 202 treeLengthsRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 203 treeLengthsRow.VisualProperties.StartIndexZero = true; 204 treeLengthsRow.VisualProperties.ScaleFactor = 1.0; 205 FragmentLengths.Rows.Add(treeLengthsRow); 206 } 207 if (!FragmentLengths.Rows.ContainsKey("Fragment lengths distribution")) { 208 var fragmentLengthsRow = new DataRow("Fragment lengths distribution"); 209 fragmentLengthsRow.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 210 fragmentLengthsRow.VisualProperties.StartIndexZero = true; 211 fragmentLengthsRow.VisualProperties.ScaleFactor = 1.0; 212 FragmentLengths.Rows.Add(fragmentLengthsRow); 213 } 214 // fragments 215 if (!FragmentStatistics.Rows.ContainsKey("Average fragment length")) { 216 var row = new DataRow("Average fragment length") { VisualProperties = { StartIndexZero = true } }; 217 FragmentStatistics.Rows.Add(row); 218 } 219 // child trees 220 if (!FragmentStatistics.Rows.ContainsKey("Average child length")) { 221 var row = new DataRow("Average child length") { VisualProperties = { StartIndexZero = true } }; 222 FragmentStatistics.Rows.Add(row); 223 } 224 225 // parents 226 if (!FragmentStatistics.Rows.ContainsKey("Average parent length")) { 227 var row = new DataRow("Average parent length") { VisualProperties = { StartIndexZero = true } }; 228 FragmentStatistics.Rows.Add(row); 229 } 230 // exact similarity 231 if (!FragmentStatistics.Rows.ContainsKey("Similarity (exact)")) { 232 var row = new DataRow("Similarity (exact)") { VisualProperties = { StartIndexZero = true } }; 233 FragmentStatistics.Rows.Add(row); 234 } 235 #endregion 236 175 237 var fragments = new List<ISymbolicExpressionTreeNode>(); 176 238 var parents = new List<ISymbolicExpressionTree>(); 177 239 var trees = (from s in gScope.SubScopes select s.Variables.First().Value as ISymbolicExpressionTree).ToList(); 240 178 241 foreach (var tree in trees.Where(x => GlobalTraceMap.ContainsKey(x))) { 179 242 if (GlobalTraceMap[tree].Count == 2) { // crossover 243 var parent0 = (ISymbolicExpressionTree)GlobalTraceMap[tree][0]; 180 244 var nodes = tree.IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>; 181 245 var index = ((IntValue)GlobalFragmentMap[tree]).Value; 182 246 var fragment = nodes[index]; 183 247 if (fragment == null) throw new ArgumentException("Fragment not found"); 184 parents.Add Range(GlobalTraceMap[tree].Cast<ISymbolicExpressionTree>());248 parents.Add(parent0); 185 249 fragments.Add(fragment); 186 250 } else { // crossover followed by mutation … … 193 257 fragments.Add(fragment); 194 258 if (!GlobalTraceMap.ContainsKey(parent0)) throw new ArgumentException("Parent information not found"); 195 parents.Add Range(GlobalTraceMap[parent0].Cast<ISymbolicExpressionTree>());259 parents.Add(parent0); 196 260 } 197 261 } 262 //var zeros = new List<int>(Enumerable.Repeat<int>(0, 201)); 263 //var lengths = (from t in fragments 264 // let len = t.GetLength() 265 // orderby len 266 // group len by len into g 267 // select new Tuple<int,int>(g.First(), g.Count())); 268 //foreach (var len in lengths) 269 // zeros[len.Item1] = len.Item2; 270 FragmentLengths.Rows["Parent lengths distribution"].Values.Replace(parents.Select(x => (double)x.Length)); 271 FragmentLengths.Rows["Child lengths distribution"].Values.Replace(trees.Select(x => (double)x.Length)); 272 FragmentLengths.Rows["Fragment lengths distribution"].Values.Replace(fragments.Select(x => (double)x.GetLength())); 198 273 199 274 // write values to file … … 203 278 double s1 = CalculateSimilarity(fragments, (int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact); 204 279 205 #region Table data 206 // fragments 207 if (!FragmentStatistics.Rows.ContainsKey("Average fragment length")) { 208 var row = new DataRow("Average fragment length", "") { VisualProperties = { StartIndexZero = true } }; 209 FragmentStatistics.Rows.Add(row); 210 } 280 211 281 FragmentStatistics.Rows["Average fragment length"].Values.Add(a1); 212 // child trees213 if (!FragmentStatistics.Rows.ContainsKey("Average child length")) {214 var row = new DataRow("Average child length", "") { VisualProperties = { StartIndexZero = true } };215 FragmentStatistics.Rows.Add(row);216 }217 282 FragmentStatistics.Rows["Average child length"].Values.Add(a2); 218 // parents219 if (!FragmentStatistics.Rows.ContainsKey("Average parent length")) {220 var row = new DataRow("Average parent length", "") { VisualProperties = { StartIndexZero = true } };221 FragmentStatistics.Rows.Add(row);222 }223 283 FragmentStatistics.Rows["Average parent length"].Values.Add(a3); 224 // exact similarity225 if (!FragmentStatistics.Rows.ContainsKey("Similarity (exact)")) {226 var row = new DataRow("Similarity (exact)", "") { VisualProperties = { StartIndexZero = true } };227 FragmentStatistics.Rows.Add(row);228 }229 284 FragmentStatistics.Rows["Similarity (exact)"].Values.Add(s1); 230 #endregion231 285 232 286 #endregion -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Analyzers/SymbolicExpressionTreeGenealogyAnalyzer.cs
r7799 r7800 263 263 264 264 foreach (var parent in parents) { 265 object data; 265 object data = ((List<ISymbolicExpressionTreeNode>)child.IterateNodesBreadth())[((IntValue)GlobalFragmentMap[child]).Value]; 266 graph.AddArc(parent, child, null, data); 266 267 if (GlobalTraceMap.ContainsKey(parent)) { 267 268 double quality = Evaluate(parent); … … 271 272 foreach (var p in pp) { 272 273 data = ((List<ISymbolicExpressionTreeNode>)parent.IterateNodesBreadth())[((IntValue)GlobalFragmentMap[parent]).Value]; 273 graph.AddArc(p, parent, data);274 graph.AddArc(p, parent, null, data); 274 275 } 275 276 } 276 data = ((List<ISymbolicExpressionTreeNode>)child.IterateNodesBreadth())[((IntValue)GlobalFragmentMap[child]).Value];277 graph.AddArc(parent, child, data);278 277 } 279 278 } … … 334 333 } 335 334 336 337 338 335 private double Evaluate(ISymbolicExpressionTree tree) { 339 336 // we perform evaluation by adding a temporary subscope with the tree in it, and calling evaluator.Apply() -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/GenealogyGraph.cs
r7799 r7800 136 136 } 137 137 // add forward and reverse arcs 138 src.AddForwardArc(dest );139 dest.AddReverseArc(src );138 src.AddForwardArc(dest, data1); 139 dest.AddReverseArc(src, data2); 140 140 } 141 141 -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3/Plugin.cs
r7799 r7800 26 26 /// Plugin class for HeuristicLab.Selection plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Selection", "3.3.6.779 2")]28 [Plugin("HeuristicLab.Selection", "3.3.6.7799")] 29 29 [PluginFile("HeuristicLab.Selection-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")]
Note: See TracChangeset
for help on using the changeset viewer.