Changeset 10358
- Timestamp:
- 01/20/14 17:33:22 (11 years ago)
- Location:
- branches/HLScript
- Files:
-
- 32 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HLScript
- Property svn:mergeinfo changed
/trunk/sources (added) merged: 10346,10348,10355
- Property svn:mergeinfo changed
-
branches/HLScript/HeuristicLab 3.3.sln
r10332 r10358 112 112 {AB687BBE-1BFE-476B-906D-44237135431D} = {AB687BBE-1BFE-476B-906D-44237135431D} 113 113 {66D249C3-A01D-42A8-82A2-919BC8EC3D83} = {66D249C3-A01D-42A8-82A2-919BC8EC3D83} 114 {21977CC3-1757-4B3B-87BD-FF817AAA900F} = {21977CC3-1757-4B3B-87BD-FF817AAA900F} 114 115 {E4CFB0C3-0589-4893-B38E-8BEDF885C765} = {E4CFB0C3-0589-4893-B38E-8BEDF885C765} 115 116 {E6CB1FC5-78EC-4EB8-BF12-35303C36F962} = {E6CB1FC5-78EC-4EB8-BF12-35303C36F962} 117 {0C2917C8-7AA8-4E18-800A-C4D064F992ED} = {0C2917C8-7AA8-4E18-800A-C4D064F992ED} 116 118 {79271BC8-4446-40E2-BB89-9BE4E17174FE} = {79271BC8-4446-40E2-BB89-9BE4E17174FE} 117 119 {7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086} = {7A2531CE-3F7C-4F13-BCCA-ED6DC27A7086} … … 1862 1864 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1863 1865 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Debug|Any CPU.Build.0 = Debug|Any CPU 1864 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Debug|x64.ActiveCfg = Debug|x64 1865 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Debug|x64.Build.0 = Debug|x64 1866 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Debug|x86.ActiveCfg = Debug|x86 1867 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Debug|x86.Build.0 = Debug|x86 1866 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Debug|x64.ActiveCfg = Debug|Any CPU 1867 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Debug|x86.ActiveCfg = Debug|Any CPU 1868 1868 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Release|Any CPU.ActiveCfg = Release|Any CPU 1869 1869 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Release|Any CPU.Build.0 = Release|Any CPU 1870 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Release|x64.ActiveCfg = Release|x64 1871 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Release|x64.Build.0 = Release|x64 1872 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Release|x86.ActiveCfg = Release|x86 1873 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Release|x86.Build.0 = Release|x86 1870 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Release|x64.ActiveCfg = Release|Any CPU 1871 {21977CC3-1757-4B3B-87BD-FF817AAA900F}.Release|x86.ActiveCfg = Release|Any CPU 1874 1872 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1875 1873 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Debug|Any CPU.Build.0 = Debug|Any CPU 1876 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Debug|x64.ActiveCfg = Debug|x64 1877 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Debug|x64.Build.0 = Debug|x64 1878 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Debug|x86.ActiveCfg = Debug|x86 1879 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Debug|x86.Build.0 = Debug|x86 1874 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Debug|x64.ActiveCfg = Debug|Any CPU 1875 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Debug|x86.ActiveCfg = Debug|Any CPU 1880 1876 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Release|Any CPU.ActiveCfg = Release|Any CPU 1881 1877 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Release|Any CPU.Build.0 = Release|Any CPU 1882 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Release|x64.ActiveCfg = Release|x64 1883 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Release|x64.Build.0 = Release|x64 1884 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Release|x86.ActiveCfg = Release|x86 1885 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Release|x86.Build.0 = Release|x86 1878 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Release|x64.ActiveCfg = Release|Any CPU 1879 {0C2917C8-7AA8-4E18-800A-C4D064F992ED}.Release|x86.ActiveCfg = Release|Any CPU 1886 1880 EndGlobalSection 1887 1881 GlobalSection(SolutionProperties) = preSolution -
branches/HLScript/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SuccessfulOffspringAnalysis/SuccessfulOffspringAnalyzer.cs
r9456 r10358 81 81 Parameters.Add(new LookupParameter<ResultCollection>("SuccessfulOffspringAnalysis", "The successful offspring analysis which is created.")); 82 82 Parameters.Add(new ValueParameter<IntValue>("Depth", "The depth of the individuals in the scope tree.", new IntValue(1))); 83 84 CollectedValuesParameter.Value.Add(new StringValue("SelectedCrossoverOperator")); 85 CollectedValuesParameter.Value.Add(new StringValue("SelectedManipulationOperator")); 83 86 } 84 87 … … 110 113 } 111 114 112 //create a data table containing the collected values 113 ResultCollection successfulOffspringAnalysis; 115 if (counts.Count > 0) { 116 //create a data table containing the collected values 117 ResultCollection successfulOffspringAnalysis; 114 118 115 if (SuccessfulOffspringAnalysisParameter.ActualValue == null) { 116 successfulOffspringAnalysis = new ResultCollection(); 117 SuccessfulOffspringAnalysisParameter.ActualValue = successfulOffspringAnalysis; 118 } else { 119 successfulOffspringAnalysis = SuccessfulOffspringAnalysisParameter.ActualValue; 120 } 121 122 string resultKey = "SuccessfulOffspringAnalyzer Results"; 123 if (!results.ContainsKey(resultKey)) { 124 results.Add(new Result(resultKey, successfulOffspringAnalysis)); 125 } else { 126 results[resultKey].Value = successfulOffspringAnalysis; 127 } 128 129 DataTable successProgressAnalysis; 130 if (!successfulOffspringAnalysis.ContainsKey(collected.Value)) { 131 successProgressAnalysis = new DataTable(); 132 successProgressAnalysis.Name = collected.Value; 133 successfulOffspringAnalysis.Add(new Result(collected.Value, successProgressAnalysis)); 134 } else { 135 successProgressAnalysis = successfulOffspringAnalysis[collected.Value].Value as DataTable; 136 } 137 138 int successfulCount = 0; 139 foreach (string key in counts.Keys) { 140 successfulCount += counts[key]; 141 } 142 143 foreach (String value in counts.Keys) { 144 DataRow row; 145 if (!successProgressAnalysis.Rows.ContainsKey(value)) { 146 row = new DataRow(value); 147 int iterations = GenerationsParameter.ActualValue.Value; 148 149 //fill up all values seen the first time 150 for (int i = 1; i < iterations; i++) 151 row.Values.Add(0); 152 153 successProgressAnalysis.Rows.Add(row); 119 if (SuccessfulOffspringAnalysisParameter.ActualValue == null) { 120 successfulOffspringAnalysis = new ResultCollection(); 121 SuccessfulOffspringAnalysisParameter.ActualValue = successfulOffspringAnalysis; 154 122 } else { 155 row = successProgressAnalysis.Rows[value];123 successfulOffspringAnalysis = SuccessfulOffspringAnalysisParameter.ActualValue; 156 124 } 157 125 158 row.Values.Add(counts[value] / (double)successfulCount); 159 } 126 string resultKey = "SuccessfulOffspringAnalyzer Results"; 127 if (!results.ContainsKey(resultKey)) { 128 results.Add(new Result(resultKey, successfulOffspringAnalysis)); 129 } else { 130 results[resultKey].Value = successfulOffspringAnalysis; 131 } 160 132 161 //fill up all values that are not present in the current generation 162 foreach (DataRow row in successProgressAnalysis.Rows) { 163 if (!counts.ContainsKey(row.Name)) 164 row.Values.Add(0); 133 DataTable successProgressAnalysis; 134 if (!successfulOffspringAnalysis.ContainsKey(collected.Value)) { 135 successProgressAnalysis = new DataTable(); 136 successProgressAnalysis.Name = collected.Value; 137 successfulOffspringAnalysis.Add(new Result(collected.Value, successProgressAnalysis)); 138 } else { 139 successProgressAnalysis = successfulOffspringAnalysis[collected.Value].Value as DataTable; 140 } 141 142 int successfulCount = 0; 143 foreach (string key in counts.Keys) { 144 successfulCount += counts[key]; 145 } 146 147 foreach (String value in counts.Keys) { 148 DataRow row; 149 if (!successProgressAnalysis.Rows.ContainsKey(value)) { 150 row = new DataRow(value); 151 int iterations = GenerationsParameter.ActualValue.Value; 152 153 //fill up all values seen the first time 154 for (int i = 1; i < iterations; i++) 155 row.Values.Add(0); 156 157 successProgressAnalysis.Rows.Add(row); 158 } else { 159 row = successProgressAnalysis.Rows[value]; 160 } 161 162 row.Values.Add(counts[value] / (double)successfulCount); 163 } 164 165 //fill up all values that are not present in the current generation 166 foreach (DataRow row in successProgressAnalysis.Rows) { 167 if (!counts.ContainsKey(row.Name)) 168 row.Values.Add(0); 169 } 165 170 } 166 171 } -
branches/HLScript/HeuristicLab.CodeEditor/3.3/CodeEditor.cs
r10332 r10358 306 306 public void AddAssembly(Assembly a) { 307 307 ShowMessage("Loading " + a.GetName().Name + "..."); 308 if ( assemblies.Contains(a))309 return;310 var reference = projectContentRegistry.GetProjectContentForReference(a.GetName().Name, a.Location);311 projectContent.AddReferencedContent(reference);312 assemblies.Add(a);308 if (!assemblies.Contains(a)) { 309 var reference = projectContentRegistry.GetProjectContentForReference(a.GetName().Name, a.Location); 310 projectContent.AddReferencedContent(reference); 311 assemblies.Add(a); 312 } 313 313 ShowMessage("Ready"); 314 314 } 315 315 public void RemoveAssembly(Assembly a) { 316 316 ShowMessage("Unloading " + a.GetName().Name + "..."); 317 if ( !assemblies.Contains(a))318 return;319 var content = projectContentRegistry.GetExistingProjectContent(a.Location);320 if (content != null) {321 projectContent.ReferencedContents.Remove(content);322 projectContentRegistry.UnloadProjectContent(content);317 if (assemblies.Contains(a)) { 318 var content = projectContentRegistry.GetExistingProjectContent(a.Location); 319 if (content != null) { 320 projectContent.ReferencedContents.Remove(content); 321 projectContentRegistry.UnloadProjectContent(content); 322 } 323 323 } 324 324 ShowMessage("Ready"); -
branches/HLScript/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/MultiBinaryVectorCrossover.cs
r10295 r10358 64 64 Operators.Add((IBinaryVectorCrossover)Activator.CreateInstance(type), true); 65 65 } 66 67 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 66 68 } 67 69 -
branches/HLScript/HeuristicLab.Encodings.IntegerVectorEncoding
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding (added) merged: 10346
- Property svn:mergeinfo changed
-
branches/HLScript/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Crossovers/MultiIntegerVectorCrossover.cs
r10295 r10358 70 70 Operators.Add((IIntegerVectorCrossover)Activator.CreateInstance(type), true); 71 71 } 72 73 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 72 74 } 73 75 -
branches/HLScript/HeuristicLab.Encodings.PermutationEncoding
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Encodings.PermutationEncoding (added) merged: 10346
- Property svn:mergeinfo changed
-
branches/HLScript/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/MultiPermutationCrossover.cs
r10295 r10358 64 64 Operators.Add((IPermutationCrossover)Activator.CreateInstance(type), true); 65 65 } 66 67 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 66 68 } 67 69 -
branches/HLScript/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/MultiPermutationManipulator.cs
r10295 r10358 57 57 Operators.Add((IPermutationManipulator)Activator.CreateInstance(type), true); 58 58 } 59 60 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 59 61 } 60 62 -
branches/HLScript/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/MultiRealVectorCrossover.cs
r10295 r10358 70 70 Operators.Add((IRealVectorCrossover)Activator.CreateInstance(type), true); 71 71 } 72 73 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 72 74 } 73 75 -
branches/HLScript/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MultiRealVectorManipulator.cs
r10295 r10358 62 62 Operators.Add(new PolynomialOnePositionManipulator()); 63 63 Operators.Add(new UniformOnePositionManipulator()); 64 65 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 64 66 } 65 67 -
branches/HLScript/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding (added) merged: 10346
- Property svn:mergeinfo changed
-
branches/HLScript/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
r9456 r10358 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/HLScript/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs
r9456 r10358 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/HLScript/HeuristicLab.HLScript.Views/3.3/HLScriptView.Designer.cs
r10332 r10358 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container();48 47 this.compilationLabel = new System.Windows.Forms.Label(); 49 48 this.showCodeButton = new System.Windows.Forms.Button(); 50 49 this.startStopButton = new System.Windows.Forms.Button(); 51 this.toolTip = new System.Windows.Forms.ToolTip(this.components);52 50 this.errorListView = new System.Windows.Forms.ListView(); 53 51 this.categoryColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); … … 63 61 this.outputTabPage = new System.Windows.Forms.TabPage(); 64 62 this.outputTextBox = new System.Windows.Forms.TextBox(); 63 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 65 64 this.variableStoreView = new HeuristicLab.HLScript.Views.VariableStoreView(); 66 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();65 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 67 66 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 68 67 this.splitContainer1.Panel1.SuspendLayout(); … … 78 77 this.SuspendLayout(); 79 78 // 79 // nameTextBox 80 // 81 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 82 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 83 this.nameTextBox.Location = new System.Drawing.Point(60, 0); 84 this.nameTextBox.Size = new System.Drawing.Size(750, 20); 85 // 86 // infoLabel 87 // 88 this.infoLabel.Location = new System.Drawing.Point(816, 4); 89 // 80 90 // compilationLabel 81 91 // 82 92 this.compilationLabel.AutoSize = true; 83 93 this.compilationLabel.ForeColor = System.Drawing.SystemColors.ControlDarkDark; 84 this.compilationLabel.Location = new System.Drawing.Point(63, 9);94 this.compilationLabel.Location = new System.Drawing.Point(63, 32); 85 95 this.compilationLabel.Name = "compilationLabel"; 86 96 this.compilationLabel.Size = new System.Drawing.Size(69, 13); … … 91 101 // 92 102 this.showCodeButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.PrintPreview; 93 this.showCodeButton.Location = new System.Drawing.Point(33, 3);103 this.showCodeButton.Location = new System.Drawing.Point(33, 26); 94 104 this.showCodeButton.Name = "showCodeButton"; 95 105 this.showCodeButton.Size = new System.Drawing.Size(24, 24); … … 103 113 // 104 114 this.startStopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play; 105 this.startStopButton.Location = new System.Drawing.Point(3, 3);115 this.startStopButton.Location = new System.Drawing.Point(3, 26); 106 116 this.startStopButton.Name = "startStopButton"; 107 117 this.startStopButton.Size = new System.Drawing.Size(24, 24); … … 126 136 this.errorListView.Location = new System.Drawing.Point(3, 3); 127 137 this.errorListView.Name = "errorListView"; 128 this.errorListView.Size = new System.Drawing.Size(623, 83);138 this.errorListView.Size = new System.Drawing.Size(623, 79); 129 139 this.errorListView.TabIndex = 0; 130 140 this.errorListView.UseCompatibleStateImageBehavior = false; … … 161 171 this.codeEditor.Name = "codeEditor"; 162 172 this.codeEditor.Prefix = ""; 163 this.codeEditor.Size = new System.Drawing.Size(637, 4 47);173 this.codeEditor.Size = new System.Drawing.Size(637, 428); 164 174 this.codeEditor.Suffix = ""; 165 175 this.codeEditor.TabIndex = 0; … … 169 179 // splitContainer1 170 180 // 171 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 172 | System.Windows.Forms.AnchorStyles.Left) 181 this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 182 | System.Windows.Forms.AnchorStyles.Left) 173 183 | System.Windows.Forms.AnchorStyles.Right))); 174 this.splitContainer1.Location = new System.Drawing.Point(3, 33);184 this.splitContainer1.Location = new System.Drawing.Point(3, 56); 175 185 this.splitContainer1.Name = "splitContainer1"; 176 186 // … … 183 193 this.splitContainer1.Panel2.Controls.Add(this.variableStoreView); 184 194 this.splitContainer1.Panel2.Controls.Add(this.viewHost); 185 this.splitContainer1.Size = new System.Drawing.Size(829, 5 66);195 this.splitContainer1.Size = new System.Drawing.Size(829, 543); 186 196 this.splitContainer1.SplitterDistance = 637; 187 197 this.splitContainer1.TabIndex = 7; … … 201 211 // 202 212 this.splitContainer2.Panel2.Controls.Add(this.tabControl1); 203 this.splitContainer2.Size = new System.Drawing.Size(637, 5 66);204 this.splitContainer2.SplitterDistance = 4 47;213 this.splitContainer2.Size = new System.Drawing.Size(637, 543); 214 this.splitContainer2.SplitterDistance = 428; 205 215 this.splitContainer2.TabIndex = 5; 206 216 // … … 213 223 this.tabControl1.Name = "tabControl1"; 214 224 this.tabControl1.SelectedIndex = 0; 215 this.tabControl1.Size = new System.Drawing.Size(637, 11 5);225 this.tabControl1.Size = new System.Drawing.Size(637, 111); 216 226 this.tabControl1.TabIndex = 1; 217 227 // … … 222 232 this.errorListTabPage.Name = "errorListTabPage"; 223 233 this.errorListTabPage.Padding = new System.Windows.Forms.Padding(3); 224 this.errorListTabPage.Size = new System.Drawing.Size(629, 8 9);234 this.errorListTabPage.Size = new System.Drawing.Size(629, 85); 225 235 this.errorListTabPage.TabIndex = 0; 226 236 this.errorListTabPage.Text = "Error List"; … … 233 243 this.outputTabPage.Name = "outputTabPage"; 234 244 this.outputTabPage.Padding = new System.Windows.Forms.Padding(3); 235 this.outputTabPage.Size = new System.Drawing.Size(629, 8 9);245 this.outputTabPage.Size = new System.Drawing.Size(629, 85); 236 246 this.outputTabPage.TabIndex = 1; 237 247 this.outputTabPage.Text = "Output"; … … 247 257 this.outputTextBox.ReadOnly = true; 248 258 this.outputTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; 249 this.outputTextBox.Size = new System.Drawing.Size(623, 83);259 this.outputTextBox.Size = new System.Drawing.Size(623, 79); 250 260 this.outputTextBox.TabIndex = 0; 251 261 this.outputTextBox.WordWrap = false; 252 //253 // variableStoreView254 //255 this.variableStoreView.Caption = "ItemCollection View";256 this.variableStoreView.Content = null;257 this.variableStoreView.Dock = System.Windows.Forms.DockStyle.Fill;258 this.variableStoreView.Location = new System.Drawing.Point(0, 0);259 this.variableStoreView.Name = "variableStoreView";260 this.variableStoreView.ReadOnly = false;261 this.variableStoreView.Size = new System.Drawing.Size(188, 566);262 this.variableStoreView.TabIndex = 0;263 262 // 264 263 // viewHost … … 271 270 this.viewHost.Name = "viewHost"; 272 271 this.viewHost.ReadOnly = false; 273 this.viewHost.Size = new System.Drawing.Size(188, 5 66);272 this.viewHost.Size = new System.Drawing.Size(188, 543); 274 273 this.viewHost.TabIndex = 0; 275 274 this.viewHost.ViewsLabelVisible = true; 276 275 this.viewHost.ViewType = null; 276 // 277 // variableStoreView 278 // 279 this.variableStoreView.Caption = "ItemCollection View"; 280 this.variableStoreView.Content = null; 281 this.variableStoreView.Dock = System.Windows.Forms.DockStyle.Fill; 282 this.variableStoreView.Location = new System.Drawing.Point(0, 0); 283 this.variableStoreView.Name = "variableStoreView"; 284 this.variableStoreView.ReadOnly = false; 285 this.variableStoreView.Size = new System.Drawing.Size(188, 543); 286 this.variableStoreView.TabIndex = 0; 277 287 // 278 288 // HLScriptView … … 285 295 this.Name = "HLScriptView"; 286 296 this.Size = new System.Drawing.Size(835, 602); 297 this.Controls.SetChildIndex(this.showCodeButton, 0); 298 this.Controls.SetChildIndex(this.compilationLabel, 0); 299 this.Controls.SetChildIndex(this.startStopButton, 0); 300 this.Controls.SetChildIndex(this.splitContainer1, 0); 301 this.Controls.SetChildIndex(this.nameLabel, 0); 302 this.Controls.SetChildIndex(this.nameTextBox, 0); 303 this.Controls.SetChildIndex(this.infoLabel, 0); 304 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 287 305 this.splitContainer1.Panel1.ResumeLayout(false); 288 306 this.splitContainer1.Panel2.ResumeLayout(false); … … 307 325 private System.Windows.Forms.Label compilationLabel; 308 326 private System.Windows.Forms.Button startStopButton; 309 private System.Windows.Forms.ToolTip toolTip;310 327 private System.Windows.Forms.ListView errorListView; 311 328 private System.Windows.Forms.ColumnHeader descriptionColumnHeader; -
branches/HLScript/HeuristicLab.HLScript.Views/3.3/HLScriptView.cs
r10332 r10358 36 36 [View("HLScript View")] 37 37 [Content(typeof(HLScript), true)] 38 public partial class HLScriptView : ItemView {38 public partial class HLScriptView : NamedItemView { 39 39 private bool running; 40 40 … … 69 69 } 70 70 private void Content_ScriptExecutionStarted(object sender, EventArgs e) { 71 ReadOnly= true;71 Locked = true; 72 72 startStopButton.Image = VSImageLibrary.Stop; 73 73 } 74 74 private void Content_ScriptExecutionFinished(object sender, EventArgs e) { 75 ReadOnly= false;75 Locked = false; 76 76 startStopButton.Image = VSImageLibrary.Play; 77 77 running = false; … … 92 92 } else { 93 93 codeEditor.UserCode = Content.Code; 94 foreach (var asm in Content.GetAssemblies()) 95 codeEditor.AddAssembly(asm); 94 96 variableStoreView.Content = Content.VariableStore; 95 97 if (Content.CompileErrors == null) { … … 108 110 protected override void SetEnabledStateOfControls() { 109 111 base.SetEnabledStateOfControls(); 110 startStopButton.Enabled = Content != null ;112 startStopButton.Enabled = Content != null && !Locked; 111 113 showCodeButton.Enabled = Content != null && !string.IsNullOrEmpty(Content.CompilationUnitCode); 112 codeEditor.Enabled = Content != null && ! ReadOnly;114 codeEditor.Enabled = Content != null && !Locked && !ReadOnly; 113 115 } 114 116 … … 137 139 protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { 138 140 if (keyData == Keys.F5) { 139 if (Content == null || ReadOnly)141 if (Content == null || Locked) 140 142 return base.ProcessCmdKey(ref msg, keyData); 141 143 outputTextBox.Clear(); … … 144 146 outputTextBox.Clear(); 145 147 Content.Execute(); 148 running = true; 146 149 } 147 150 return true; … … 156 159 private bool Compile() { 157 160 ReadOnly = true; 161 Locked = true; 158 162 errorListView.Items.Clear(); 159 163 outputTextBox.Clear(); … … 170 174 OnContentChanged(); 171 175 ReadOnly = false; 176 Locked = false; 172 177 } 173 178 } -
branches/HLScript/HeuristicLab.HLScript.Views/3.3/HeuristicLab.HLScript.Views-3.3.csproj
r10332 r10358 115 115 <Private>False</Private> 116 116 </ProjectReference> 117 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 118 <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project> 119 <Name>HeuristicLab.Persistence-3.3</Name> 120 <Private>False</Private> 121 </ProjectReference> 117 122 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> 118 123 <Project>{94186a6a-5176-4402-ae83-886557b53cca}</Project> -
branches/HLScript/HeuristicLab.HLScript.Views/3.3/Plugin.cs.frame
r10332 r10358 34 34 [PluginDependency("HeuristicLab.MainForm", "3.3")] 35 35 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 36 [PluginDependency("HeuristicLab.Persistence", "3.3")] 36 37 public class HeuristicLabHLScriptViewsPlugin : PluginBase { 37 38 } -
branches/HLScript/HeuristicLab.HLScript.Views/3.3/VariableStoreView.Designer.cs
r10332 r10358 61 61 this.valueColumnHeader, 62 62 this.typeColumnHeader}); 63 this.variableListView.FullRowSelect = true; 63 64 this.variableListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; 64 65 this.variableListView.HideSelection = false; -
branches/HLScript/HeuristicLab.HLScript.Views/3.3/VariableStoreView.cs
r10332 r10358 23 23 using System.Collections; 24 24 using System.Collections.Generic; 25 using System.Drawing; 25 26 using System.Linq; 26 27 using System.Windows.Forms; … … 31 32 using HeuristicLab.MainForm; 32 33 using HeuristicLab.MainForm.WindowsForms; 34 using HeuristicLab.Persistence.Core; 35 using HeuristicLab.Persistence.Default.Xml; 33 36 using HeuristicLab.PluginInfrastructure; 34 37 … … 53 56 InitializeComponent(); 54 57 itemListViewItemMapping = new Dictionary<string, ListViewItem>(); 58 variableListView.SmallImageList.Images.AddRange(new Image[] { 59 HeuristicLab.Common.Resources.VSImageLibrary.Error, 60 HeuristicLab.Common.Resources.VSImageLibrary.Object, 61 HeuristicLab.Common.Resources.VSImageLibrary.Nothing 62 }); 55 63 } 56 64 … … 101 109 variableListView.Enabled = false; 102 110 } else { 103 addButton.Enabled = /*!Content.IsReadOnly &&*/!ReadOnly;111 addButton.Enabled = !Locked && !ReadOnly; 104 112 sortAscendingButton.Enabled = variableListView.Items.Count > 1; 105 113 sortDescendingButton.Enabled = variableListView.Items.Count > 1; 106 removeButton.Enabled = /*!Content.IsReadOnly &&*/!ReadOnly && variableListView.SelectedItems.Count > 0;114 removeButton.Enabled = !Locked && !ReadOnly && variableListView.SelectedItems.Count > 0; 107 115 variableListView.Enabled = true; 108 116 } … … 130 138 string value = (variable.Value ?? "null").ToString(); 131 139 string type = variable.Value == null ? "null" : variable.Value.GetType().ToString(); 132 var listViewItem = new ListViewItem(new[] { variable.Key, value, type }) { ToolTipText = GetToolTipText(variable), Tag = variable }; 133 variableListView.SmallImageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.Object); 134 listViewItem.ImageIndex = variableListView.SmallImageList.Images.Count - 1; 140 bool serializable = IsSerializable(variable); 141 var listViewItem = new ListViewItem(new[] { variable.Key, value, type }) { ToolTipText = GetToolTipText(variable, serializable), Tag = variable }; 142 if (serializable) { 143 listViewItem.ImageIndex = variable.Value == null ? 2 : 1; 144 } else listViewItem.ImageIndex = 0; 135 145 variableListView.Items.Add(listViewItem); 136 146 itemListViewItemMapping[variable.Key] = listViewItem; … … 160 170 string value = (variable.Value ?? "null").ToString(); 161 171 string type = variable.Value == null ? "null" : variable.Value.GetType().ToString(); 172 bool serializable = IsSerializable(variable); 173 if (serializable) { 174 listViewItem.ImageIndex = variable.Value == null ? 2 : 1; 175 } else listViewItem.ImageIndex = 0; 162 176 listViewItem.SubItems[1].Text = value; 163 177 listViewItem.SubItems[2].Text = type; 164 listViewItem.ToolTipText = GetToolTipText(variable );178 listViewItem.ToolTipText = GetToolTipText(variable, serializable); 165 179 listViewItem.Tag = variable; 166 180 } else throw new ArgumentException("A variable with the specified name does not exist.", "variable"); … … 169 183 #region ListView Events 170 184 protected virtual void variableListView_SelectedIndexChanged(object sender, EventArgs e) { 171 removeButton.Enabled = (Content != null) /*&& !Content.IsReadOnly*/&& !ReadOnly && variableListView.SelectedItems.Count > 0;185 removeButton.Enabled = (Content != null) && !Locked && !ReadOnly && variableListView.SelectedItems.Count > 0; 172 186 AdjustListViewColumnSizes(); 173 187 } 174 188 protected virtual void variableListView_KeyDown(object sender, KeyEventArgs e) { 175 189 if (e.KeyCode == Keys.Delete) { 176 if ((variableListView.SelectedItems.Count > 0) /*&& !Content.IsReadOnly*/&& !ReadOnly) {190 if ((variableListView.SelectedItems.Count > 0) && !Locked && !ReadOnly) { 177 191 foreach (ListViewItem item in variableListView.SelectedItems) 178 192 Content.Remove(item.Text); … … 207 221 if (items.Count == 1) data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, items[0]); 208 222 else data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, items); 209 if ( /*Content.IsReadOnly ||*/ReadOnly) {223 if (ReadOnly) { 210 224 DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link); 211 225 } else { … … 220 234 protected virtual void variableListView_DragEnter(object sender, DragEventArgs e) { 221 235 validDragOperation = false; 222 if ( /*!Content.IsReadOnly &&*/!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is object)) {236 if (!Locked && !ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is object)) { 223 237 validDragOperation = true; 224 } else if ( /*!Content.IsReadOnly &&*/!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable)) {238 } else if (!Locked && !ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable)) { 225 239 validDragOperation = true; 226 240 IEnumerable items = (IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); … … 361 375 item.SubItems[1].Text = value; 362 376 item.SubItems[2].Text = variable.Value.Value.GetType().ToString(); 363 item.ToolTipText = GetToolTipText(variable.Value );377 item.ToolTipText = GetToolTipText(variable.Value, item.ImageIndex == 0); 364 378 return; 365 379 } … … 382 396 protected virtual void RebuildImageList() { 383 397 variableListView.SmallImageList.Images.Clear(); 398 variableListView.SmallImageList.Images.AddRange(new Image[] { 399 HeuristicLab.Common.Resources.VSImageLibrary.Error, 400 HeuristicLab.Common.Resources.VSImageLibrary.Object, 401 HeuristicLab.Common.Resources.VSImageLibrary.Nothing 402 }); 384 403 foreach (ListViewItem listViewItem in variableListView.Items) { 385 object item = listViewItem.Tag as object; 386 variableListView.SmallImageList.Images.Add(item == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : HeuristicLab.Common.Resources.VSImageLibrary.Object);//item.ItemImage); 387 listViewItem.ImageIndex = variableListView.SmallImageList.Images.Count - 1; 388 } 389 } 390 391 private string GetToolTipText(KeyValuePair<string, object> variable) { 404 var variable = (KeyValuePair<string, object>)listViewItem.Tag; 405 bool serializable = IsSerializable(variable); 406 if (serializable) { 407 listViewItem.ImageIndex = variable.Value == null ? 2 : 1; 408 } else listViewItem.ImageIndex = 0; 409 } 410 } 411 412 private string GetToolTipText(KeyValuePair<string, object> variable, bool serializable) { 392 413 if (string.IsNullOrEmpty(variable.Key)) throw new ArgumentException("The variable must have a name.", "variable"); 393 414 string value = (variable.Value ?? "null").ToString(); 415 string type = variable.Value == null ? "null" : variable.Value.GetType().ToString(); 394 416 string[] lines = { 395 417 "Name: " + variable.Key, 396 418 "Value: " + value, 397 "Type: " + variable.Value.GetType()419 "Type: " + type 398 420 }; 399 return string.Join(Environment.NewLine, lines); 421 string toolTipText = string.Join(Environment.NewLine, lines); 422 if (!serializable) 423 toolTipText += Environment.NewLine + "CAUTION: Type is not serializable!"; 424 return toolTipText; 400 425 } 401 426 … … 411 436 return defaultName; 412 437 } 438 439 private bool IsSerializable(KeyValuePair<string, object> variable) { 440 var ser = new Serializer(variable, ConfigurationService.Instance.GetDefaultConfig(new XmlFormat()), "ROOT", true); 441 try { 442 return ser.Count() > 0; 443 } catch (PersistenceException) { 444 return false; 445 } 446 } 413 447 #endregion 414 448 } -
branches/HLScript/HeuristicLab.HLScript/3.3/HLScript.cs
r10332 r10358 17 17 18 18 namespace HeuristicLab.HLScript { 19 [Item("HL Script", "A HeuristicLab script.")]19 [Item("HL Script", "A HeuristicLab script.")] 20 20 [Creatable("Scripts")] 21 21 [StorableClass] … … 84 84 : base(original, cloner) { 85 85 code = original.code; 86 // variableStore = cloner.Clone(original.variableStore); 87 // compiledHLScript = cloner.Clone(original.compiledHLScript) 86 variableStore = new VariableStore(); 88 87 compilationUnitCode = original.compilationUnitCode; 89 88 if (original.compileErrors != null) … … 92 91 93 92 public HLScript() 94 : base("HL S") {93 : base("HL Script", "A HeuristicLab script.") { 95 94 code = CodeTemplate; 96 variableStore = new VariableStore();97 }98 99 [StorableHook(HookType.AfterDeserialization)]100 private void AfterDeserialization() {101 compiledHLScript = null;102 95 variableStore = new VariableStore(); 103 96 } … … 172 165 } 173 166 167 public IEnumerable<Assembly> GetAssemblies() { 168 var assemblies = new List<Assembly>(); 169 foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) { 170 try { 171 if (File.Exists(a.Location)) assemblies.Add(a); 172 } catch (NotSupportedException) { 173 // NotSupportedException is thrown while accessing 174 // the Location property of the anonymously hosted 175 // dynamic methods assembly, which is related to 176 // LINQ queries 177 } 178 } 179 assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality 180 return assemblies; 181 } 182 174 183 private readonly Regex LineSplitter = new Regex(@"\r\n|\r|\n"); 175 184 private readonly Regex SafeTypeNameCharRegex = new Regex("[_a-zA-Z0-9]+"); … … 177 186 private readonly Regex NamespaceDeclarationRegex = new Regex(@"using\s+(@?[a-z_A-Z]\w+(?:\s*\.\s*@?[a-z_A-Z]\w*)*)\s*;"); 178 187 private readonly Regex NamespaceRegex = new Regex(@"(@?[a-z_A-Z]\w+(?:\s*\.\s*@?[a-z_A-Z]\w*)*)"); 188 private readonly Regex CommentRegex = new Regex(@"((/\*)[^/]+(\*/))|(//.*)"); 179 189 180 190 private CodeCompileUnit CreateCompilationUnit() { … … 191 201 192 202 private IEnumerable<string> GetNamespaces() { 193 var strings = NamespaceDeclarationRegex.Matches( code)203 var strings = NamespaceDeclarationRegex.Matches(CommentRegex.Replace(code, string.Empty)) 194 204 .Cast<Match>() 195 205 .Select(m => m.Value); … … 207 217 yield return trimmedLine; 208 218 } 209 }210 211 private IEnumerable<Assembly> GetAssemblies() {212 var assemblies = new List<Assembly>();213 foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) {214 try {215 if (File.Exists(a.Location)) assemblies.Add(a);216 } catch (NotSupportedException) {217 // NotSupportedException is thrown while accessing218 // the Location property of the anonymously hosted219 // dynamic methods assembly, which is related to220 // LINQ queries221 }222 }223 assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality224 return assemblies;225 219 } 226 220 -
branches/HLScript/HeuristicLab.HLScript/3.3/HLScriptGeneration.cs
r10332 r10358 8 8 namespace HeuristicLab.HLScript { 9 9 public abstract class HLScriptGeneration { 10 protected static dynamic vars; 10 protected dynamic vars; 11 12 private readonly EventWriter console; 13 protected EventWriter Console { 14 get { return console; } 15 } 16 17 protected HLScriptGeneration() { 18 console = new EventWriter(this); 19 } 11 20 12 21 public abstract void Main(); … … 14 23 private void Execute(VariableStore variableStore) { 15 24 vars = new Variables(variableStore); 16 using (new EventWriter(this)) { 17 try { 18 Main(); 19 } catch (ThreadAbortException) { 20 } catch (Exception e) { 21 Console.WriteLine("---"); 22 Console.WriteLine(e); 23 } 25 try { 26 Main(); 27 } catch (ThreadAbortException) { 28 } catch (Exception e) { 29 Console.WriteLine("---"); 30 Console.WriteLine(e); 24 31 } 25 32 } … … 48 55 } 49 56 50 private class EventWriter : TextWriter { 51 private readonly TextWriter consoleOut; 57 protected class EventWriter : TextWriter { 52 58 private readonly HLScriptGeneration hlsg; 53 private bool disposed;54 59 55 60 public EventWriter(HLScriptGeneration hlsg) { 56 61 this.hlsg = hlsg; 57 consoleOut = Console.Out;58 Console.SetOut(this);59 disposed = false;60 62 } 61 63 … … 106 108 #endregion 107 109 #endregion 108 109 protected override void Dispose(bool disposing) {110 if (!disposed && disposing)111 Console.SetOut(consoleOut);112 disposed = true;113 }114 110 } 115 111 } -
branches/HLScript/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic (added) merged: 10346
- Property svn:mergeinfo changed
-
branches/HLScript/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression (added) merged: 10355
- Property svn:mergeinfo changed
-
branches/HLScript/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
r9289 r10358 120 120 <Compile Include="Plugin.cs" /> 121 121 <Compile Include="SingleObjective\ConstantOptimizationAnalyzer.cs" /> 122 <Compile Include="SingleObjective\Evaluators\SymbolicRegressionMeanRelativeErrorEvaluator.cs" /> 122 123 <Compile Include="SingleObjective\SymbolicRegressionSingleObjectiveValidationParetoBestSolutionAnalyzer.cs" /> 123 124 <Compile Include="SingleObjective\SymbolicRegressionSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs" /> -
branches/HLScript/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.cs
r9456 r10358 109 109 InitializeOperators(); 110 110 name = "MultiSymbolicDataAnalysisExpressionCrossover"; 111 112 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 111 113 } 112 114 -
branches/HLScript/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting (added) merged: 10346,10348
- Property svn:mergeinfo changed
-
branches/HLScript/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/BiasedMultiVRPSolutionCrossover.cs
r10298 r10358 67 67 Parameters.Add(new ValueParameter<DoubleValue>("LowerBound", "The depth of the individuals in the scope tree.", new DoubleValue(0.01))); 68 68 Parameters.Add(new ValueParameter<IntValue>("Depth", "The depth of the individuals in the scope tree.", new IntValue(1))); 69 70 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 69 71 } 70 72 -
branches/HLScript/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs
r10295 r10358 67 67 Parameters.Add(new LookupParameter<IVRPEncoding>("Child", "The child permutation resulting from the crossover.")); 68 68 ChildParameter.ActualName = "VRPTours"; 69 70 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 69 71 } 70 72 -
branches/HLScript/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/BiasedMultiVRPSolutionManipulator.cs
r10298 r10358 67 67 Parameters.Add(new ValueParameter<DoubleValue>("LowerBound", "The depth of the individuals in the scope tree.", new DoubleValue(0.01))); 68 68 Parameters.Add(new ValueParameter<IntValue>("Depth", "The depth of the individuals in the scope tree.", new IntValue(1))); 69 70 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 69 71 } 70 72 -
branches/HLScript/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/MultiVRPSolutionManipulator.cs
r10295 r10358 59 59 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 60 60 Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours to be manipulated.")); 61 62 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 61 63 } 62 64
Note: See TracChangeset
for help on using the changeset viewer.