Changeset 10456 for branches/HeuristicLab.EvolutionTracking
- Timestamp:
- 02/15/14 13:50:37 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking
- Files:
-
- 2 added
- 1 deleted
- 16 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/branches/HLScript/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding (added) merged: 10358 /trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding merged: 10346,10359
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
r10347 r10456 51 51 this.lineColor = Color.Black; 52 52 this.backgroundColor = Color.White; 53 this.textFont = new Font( "Times New Roman", 14);53 this.textFont = new Font(FontFamily.GenericSerif, 14, GraphicsUnit.Pixel); 54 54 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(); 55 55 layoutAdapter = new SymbolicExpressionTreeLayoutAdapter(); … … 278 278 279 279 #region methods for painting the symbolic expression tree 280 281 280 private void DrawFunctionTree(ISymbolicExpressionTree symbolicExpressionTree, Graphics graphics, int preferredWidth, int preferredHeight, int minHDistance, int minVDistance) { 282 281 var layoutNodes = layoutAdapter.Convert(symbolicExpressionTree).ToList(); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
r9456 r10456 106 106 Operators = checkedItemList.AsReadOnly(); 107 107 Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>>(Operators.CheckedItems)); 108 109 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 108 110 } 109 111 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Formatters/SymbolicExpressionTreeLatexFormatter.cs
r10302 r10456 1 using System.Collections.Generic; 1 using System; 2 using System.Collections.Generic; 3 using System.Globalization; 2 4 using System.Linq; 3 5 using System.Text; … … 8 10 [Item("LaTeX/PDF Formatter", "Formatter for symbolic expression trees for use with latex.")] 9 11 public class SymbolicExpressionTreeLatexFormatter : NamedItem, ISymbolicExpressionTreeStringFormatter { 10 private readonly static Dictionary<string, string> symbolNameMap = new Dictionary<string, string>12 private readonly static Dictionary<string, string> SymbolNamesMap = new Dictionary<string, string> 11 13 { 12 14 {"ProgramRootSymbol", "Prog"}, 13 {"StartSymbol","RPB"} 15 {"StartSymbol","RPB"}, 16 {"Addition", "$+$"}, 17 {"Subtraction", "$-$"}, 18 {"Multiplication", "$\\times$"}, 19 {"Division", "$\\div$"} 14 20 }; 15 21 private readonly ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> layoutEngine; 16 22 private readonly SymbolicExpressionTreeLayoutAdapter layoutAdapter; 17 23 18 19 24 public SymbolicExpressionTreeLatexFormatter() { 20 25 layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode>(); 26 layoutAdapter = new SymbolicExpressionTreeLayoutAdapter(); 21 27 } 22 28 … … 37 43 foreach (var ln in layoutNodes) 38 44 layoutEngine.AddNode(ln.Content, ln); 45 layoutEngine.CalculateLayout(); 39 46 var nodeCoordinates = layoutEngine.GetNodeCoordinates(); 40 47 var sb = new StringBuilder(); 41 sb.AppendLine("\\begin{figure}"); 42 sb.AppendLine("\\begin{tikzpicture}"); 48 var nl = Environment.NewLine; 49 sb.Append("\\documentclass[class=minimal,border=0pt]{standalone}" + nl + 50 "\\usepackage{tikz}" + nl + 51 "\\begin{document}" + nl + 52 "\\begin{tikzpicture}" + nl + 53 "\\def\\ws{1}" + nl + 54 "\\def\\hs{0.7}" + nl); 43 55 44 foreach (var node in symbolicExpressionTree.IterateNodesBreadth()) { 56 const double ws = 1.0, hs = 0.7; // some scaling factors useful for fine-tuning document appearance before latex compilation 57 var nodes = symbolicExpressionTree.IterateNodesBreadth().ToList(); 58 var nodeIndices = new Dictionary<ISymbolicExpressionTreeNode, int>(); 59 for (int i = 0; i < nodes.Count; ++i) { 60 var node = nodes[i]; 61 nodeIndices.Add(node, i); 45 62 var symbolName = node.Symbol.Name; 46 var nodeName = symbolNameMap.ContainsKey(symbolName) ? symbolNameMap[symbolName] : symbolName;63 var nodeName = SymbolNamesMap.ContainsKey(symbolName) ? SymbolNamesMap[symbolName] : symbolName; 47 64 var coord = nodeCoordinates[node]; 48 65 49 sb.AppendLine(string.Format( "\\draw node ({0},{1}) {{{2}}};", coord.X, coord.Y, nodeName));66 sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "\\node ({0}) at (\\ws*{1},\\hs*{2}) {{{3}}};", i, ws * coord.X, -hs * coord.Y, EscapeLatexString(nodeName))); 50 67 } 51 68 52 sb.AppendLine("\\end{figure}"); 53 sb.AppendLine("\\end{tikzpicture}"); 69 for (int i = 0; i < nodes.Count; ++i) { 70 foreach (var s in nodes[i].Subtrees) { 71 sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "\\draw ({0}) -- ({1});", i, nodeIndices[s])); 72 } 73 } 74 75 sb.AppendLine("\\end{tikzpicture}" + nl + "\\end{document}" + nl); 54 76 55 77 return sb.ToString(); 56 78 } 79 80 private static string EscapeLatexString(string s) { 81 return s.Replace("\\", "\\\\").Replace("{", "\\{").Replace("}", "\\}").Replace("_", "\\_"); 82 } 57 83 } 58 84 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/LayoutEngines/SymbolicExpressionTreeLayoutAdapter.cs
r10269 r10456 28 28 public class SymbolicExpressionTreeLayoutAdapter : ILayoutAdapter<ISymbolicExpressionTreeNode> { 29 29 // default conversion function between ISymbolicExpressionTreeNode and ILayoutNode<ISymbolicExpressionTree> 30 ILayoutNode<ISymbolicExpressionTreeNode> defaultConvert(ISymbolicExpressionTreeNode node) {30 static ILayoutNode<ISymbolicExpressionTreeNode> DefaultConvert(ISymbolicExpressionTreeNode node) { 31 31 var layoutNode = new LayoutNode<ISymbolicExpressionTreeNode> { Content = node }; 32 32 layoutNode.Ancestor = layoutNode; … … 40 40 // return an enumerable containing all the layout nodes 41 41 public IEnumerable<ILayoutNode<ISymbolicExpressionTreeNode>> Convert(ISymbolicExpressionTreeNode root, Func<ISymbolicExpressionTreeNode, ILayoutNode<ISymbolicExpressionTreeNode>> convertFunc = null) { 42 var rootLayoutNode = convertFunc == null ? defaultConvert(root) : convertFunc(root);42 var rootLayoutNode = convertFunc == null ? DefaultConvert(root) : convertFunc(root); 43 43 rootLayoutNode.Ancestor = rootLayoutNode; 44 44 … … 63 63 for (int i = 0; i < layoutNode.Content.SubtreeCount; ++i) { 64 64 var subtree = layoutNode.Content.GetSubtree(i); 65 var childLayoutNode = convertFunc == null ? defaultConvert(subtree) : convertFunc(subtree);65 var childLayoutNode = convertFunc == null ? DefaultConvert(subtree) : convertFunc(subtree); 66 66 childLayoutNode.Parent = layoutNode; 67 67 childLayoutNode.Number = i; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs
r9456 r10456 83 83 Operators = checkedItemList.AsReadOnly(); 84 84 Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>>(Operators.CheckedItems)); 85 86 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 85 87 } 86 88 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj
r10347 r10456 116 116 <DependentUpon>FrequentFragmentsDialog.cs</DependentUpon> 117 117 </Compile> 118 <Compile Include="GenealogyGraphChart.cs"> 119 <SubType>UserControl</SubType> 120 </Compile> 118 <Compile Include="GenealogyGraphChart.cs" /> 121 119 <Compile Include="GenealogyGraphChart.Designer.cs"> 122 120 <DependentUpon>GenealogyGraphChart.cs</DependentUpon> … … 132 130 <DependentUpon>Resources.resx</DependentUpon> 133 131 </Compile> 134 <Compile Include="GenealogyGraphView.cs"> 135 <SubType>UserControl</SubType> 136 </Compile> 132 <Compile Include="GenealogyGraphView.cs" /> 137 133 <Compile Include="GenealogyGraphView.Designer.cs"> 138 134 <DependentUpon>GenealogyGraphView.cs</DependentUpon> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/branches/HLScript/HeuristicLab.Problems.DataAnalysis.Symbolic (added) merged: 10358 /trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic merged: 10359,10368,10375,10378,10414,10417,10428
- Property svn:mergeinfo changed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r10347 r10456 300 300 </ItemGroup> 301 301 <ItemGroup> 302 <ProjectReference Include="..\..\ ..\HeuristicLab.EvolutionaryTracking\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj">302 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj"> 303 303 <Project>{423bd94f-963a-438e-ba45-3bb3d61cd03b}</Project> 304 304 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4</Name> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r10347 r10456 173 173 </ItemGroup> 174 174 <ItemGroup> 175 <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs" 175 176 <Compile Include="Analyzers\SymbolicDataAnalysisGenealogyAnalyzer.cs" /> 176 177 <Compile Include="Analyzers\SymbolicDataAnalysisPopulationDiversityAnalyzer.cs" /> … … 188 189 <SubType>Code</SubType> 189 190 </Compile> 191 <Compile Include="SymbolicDataAnalysisExpressionPruningOperator.cs" /> 190 192 <Compile Include="SlidingWindow\GenerationalSlidingWindowAnalyzer.cs" /> 191 193 <Compile Include="SlidingWindow\OffspringSelectionSlidingWindowAnalyzer.cs" /> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimilarityCalculator.cs
r10302 r10456 40 40 41 41 public IScopeTreeLookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { 42 get { 43 return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; 44 } 42 get { return (IScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 45 43 } 46 44 … … 90 88 public SymbolicDataAnalysisExpressionTreeSimilarityCalculator() 91 89 : base() { 92 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, 93 "The symbolic expression trees to analyze.")); 90 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression trees to analyze.")); 94 91 Parameters.Add(new ValueParameter<ISymbolicExpressionTree>(CurrentSymbolicExpressionTreeParameterName, "")); 95 Parameters.Add(new LookupParameter<BoolValue>(MatchVariablesParameterName, 96 "Specify if the symbolic expression tree comparer should match variable names.")); 97 Parameters.Add(new LookupParameter<BoolValue>(MatchVariableWeightsParameterName, 98 "Specify if the symbolic expression tree comparer should match variable weights.")); 99 Parameters.Add(new LookupParameter<BoolValue>(MatchConstantValuesParameterName, 100 "Specify if the symbolic expression tree comparer should match constant values.")); 92 Parameters.Add(new LookupParameter<BoolValue>(MatchVariablesParameterName, "Specify if the symbolic expression tree comparer should match variable names.")); 93 Parameters.Add(new LookupParameter<BoolValue>(MatchVariableWeightsParameterName, "Specify if the symbolic expression tree comparer should match variable weights.")); 94 Parameters.Add(new LookupParameter<BoolValue>(MatchConstantValuesParameterName, "Specify if the symbolic expression tree comparer should match constant values.")); 101 95 Parameters.Add(new LookupParameter<DoubleValue>(SimilarityValuesParmeterName, "")); 102 96 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.TravelingSalesman.Views
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/HeuristicLab.EvolutionTracking/PreBuildEvent.cmd
r10265 r10456 1 SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.frame" "%ProjectDir%\Properties\AssemblyInfo.cs" 2 SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs" 1 IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs" 2 IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling 3 IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs" 4 IF %ERRORLEVEL% NEQ 0 GOTO Error_Handling 5 GOTO Done 6 7 :Error_Handling 8 ECHO There was an error while running subwcrev. Please verify that the *.cs.frame files have been correctly converted to *.cs files, otherwise HeuristicLab won't build. 9 exit 0 10 11 :Done 12
Note: See TracChangeset
for help on using the changeset viewer.