Changeset 9363 for branches/OaaS/HeuristicLab.Optimization
- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 2 deleted
- 16 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs
r8212 r9363 134 134 storeAlgorithmInEachRun = false; 135 135 runsCounter = 0; 136 Runs = new RunCollection ();136 Runs = new RunCollection { OptimizerName = Name }; 137 137 } 138 138 protected Algorithm(string name) … … 142 142 storeAlgorithmInEachRun = false; 143 143 runsCounter = 0; 144 Runs = new RunCollection ();144 Runs = new RunCollection { OptimizerName = Name }; 145 145 } 146 146 protected Algorithm(string name, ParameterCollection parameters) … … 150 150 storeAlgorithmInEachRun = false; 151 151 runsCounter = 0; 152 Runs = new RunCollection ();152 Runs = new RunCollection { OptimizerName = Name }; 153 153 } 154 154 protected Algorithm(string name, string description) … … 158 158 storeAlgorithmInEachRun = false; 159 159 runsCounter = 0; 160 Runs = new RunCollection ();160 Runs = new RunCollection { OptimizerName = Name }; 161 161 } 162 162 protected Algorithm(string name, string description, ParameterCollection parameters) … … 166 166 storeAlgorithmInEachRun = false; 167 167 runsCounter = 0; 168 Runs = new RunCollection ();168 Runs = new RunCollection { OptimizerName = Name }; 169 169 } 170 170 [StorableConstructor] … … 250 250 251 251 #region Events 252 protected override void OnNameChanged() { 253 base.OnNameChanged(); 254 Runs.OptimizerName = Name; 255 } 256 252 257 public event EventHandler ExecutionStateChanged; 253 258 protected virtual void OnExecutionStateChanged() { -
branches/OaaS/HeuristicLab.Optimization/3.3/Algorithms/UserDefinedAlgorithm.cs
r7259 r9363 107 107 if (Analyzer != null && Problem != null) { 108 108 foreach (IAnalyzer analyzer in Problem.Operators.OfType<IAnalyzer>()) { 109 Analyzer.Operators.Add(analyzer );109 Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault); 110 110 } 111 111 } -
branches/OaaS/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj
r7228 r9363 114 114 </ItemGroup> 115 115 <ItemGroup> 116 <Compile Include="Interfaces\ISingleObjectivePathRelinker.cs" /> 117 <Compile Include="Interfaces\ISingleObjectiveImprovementOperator.cs" /> 118 <Compile Include="Interfaces\ISingleObjectiveSolutionSimilarityCalculator.cs" /> 119 <Compile Include="Interfaces\IImprovementOperator.cs" /> 120 <Compile Include="Interfaces\IPathRelinker.cs" /> 121 <Compile Include="Interfaces\ISimilarityBasedOperator.cs" /> 122 <Compile Include="Interfaces\ISolutionSimilarityCalculator.cs" /> 123 <Compile Include="MetaOptimizers\BatchRun.cs" /> 124 <Compile Include="MetaOptimizers\Experiment.cs" /> 125 <Compile Include="MetaOptimizers\TimeLimitRun.cs" /> 116 126 <Compile Include="RunCollectionModification\RunCollectionRunRemover.cs" /> 117 127 <Compile Include="Plugin.cs" /> … … 123 133 <None Include="Plugin.cs.frame" /> 124 134 <Compile Include="Algorithms\Algorithm.cs" /> 125 <Compile Include="BatchRun.cs" />126 135 <Compile Include="RunCollectionModification\Calculator.cs" /> 127 136 <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" /> … … 166 175 <Compile Include="RunCollectionConstraints\IRunCollectionConstraint.cs" /> 167 176 <Compile Include="OptimizerList.cs" /> 168 <Compile Include="Experiment.cs" />169 177 <Compile Include="Interfaces\IOptimizer.cs" /> 170 178 <Compile Include="RunCollection.cs" /> … … 274 282 --> 275 283 <PropertyGroup> 276 <PreBuildEvent >set Path=%25Path%25;$(ProjectDir);$(SolutionDir)284 <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 277 285 set ProjectDir=$(ProjectDir) 278 286 set SolutionDir=$(SolutionDir) … … 281 289 call PreBuildEvent.cmd 282 290 </PreBuildEvent> 291 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 292 export ProjectDir=$(ProjectDir) 293 export SolutionDir=$(SolutionDir) 294 295 $SolutionDir/PreBuildEvent.sh 296 </PreBuildEvent> 283 297 </PropertyGroup> 284 298 </Project> -
branches/OaaS/HeuristicLab.Optimization/3.3/Interfaces/IMultiAnalyzer.cs
r7259 r9363 26 26 /// An interface which represents a multi analysis operator. 27 27 /// </summary> 28 public interface IMultiAnalyzer : I MultiOperator<IAnalyzer>, IAnalyzer { }28 public interface IMultiAnalyzer : ICheckedMultiOperator<IAnalyzer>, IAnalyzer { } 29 29 } -
branches/OaaS/HeuristicLab.Optimization/3.3/Interfaces/IRunCollectionModifier.cs
r7228 r9363 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
branches/OaaS/HeuristicLab.Optimization/3.3/Plugin.cs.frame
r7259 r9363 26 26 /// Plugin class for HeuristicLab.Optimization plugin. 27 27 /// </summary> 28 [Plugin("HeuristicLab.Optimization", "3.3. 6.$WCREV$")]28 [Plugin("HeuristicLab.Optimization", "3.3.7.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Optimization-3.3.dll", PluginFileType.Assembly)] 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] -
branches/OaaS/HeuristicLab.Optimization/3.3/Properties/AssemblyInfo.cs.frame
r7259 r9363 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3. 6.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.7.$WCREV$")] -
branches/OaaS/HeuristicLab.Optimization/3.3/RunCollection.cs
r7798 r9363 44 44 : base(original, cloner) { 45 45 updateOfRunsInProgress = false; 46 optimizerName = original.optimizerName; 47 46 48 resultNames = new List<string>(original.resultNames); 47 49 parameterNames = new List<string>(original.parameterNames); … … 104 106 } 105 107 108 private string optimizerName = string.Empty; 109 [Storable] 110 public string OptimizerName { 111 get { return optimizerName; } 112 set { 113 if (value != optimizerName && !string.IsNullOrEmpty(value)) { 114 optimizerName = value; 115 OnOptimizerNameChanged(); 116 } 117 } 118 } 119 120 // BackwardsCompatibility3.3 121 #region Backwards compatible code, remove with 3.4 122 [Storable(AllowOneWay = true)] 123 private string AlgorithmName { 124 set { optimizerName = value; } 125 } 126 #endregion 127 106 128 [StorableHook(HookType.AfterDeserialization)] 107 129 private void AfterDeserialization() { … … 120 142 protected virtual void OnUpdateOfRunsInProgressChanged() { 121 143 var handler = UpdateOfRunsInProgressChanged; 144 if (handler != null) handler(this, EventArgs.Empty); 145 } 146 147 public event EventHandler OptimizerNameChanged; 148 protected virtual void OnOptimizerNameChanged() { 149 var handler = OptimizerNameChanged; 122 150 if (handler != null) handler(this, EventArgs.Empty); 123 151 } -
branches/OaaS/HeuristicLab.Optimization/3.3/RunCollectionModification/Calculator.cs
r7228 r9363 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Globalization; 4 25 using System.Linq; 26 using System.Text; 5 27 using System.Text.RegularExpressions; 6 28 using HeuristicLab.Common; … … 8 30 using HeuristicLab.Data; 9 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 10 using System.Text;11 32 12 33 namespace HeuristicLab.Optimization { … … 21 42 [Storable] 22 43 public string Formula { 23 get { return string.Join(" ", tokens); }44 get { return tokens == null ? string.Empty : string.Join(" ", tokens); } 24 45 set { tokens = Tokenize(value).ToList(); } 25 46 } … … 56 77 int i = 0; 57 78 try { 58 for (; i <tokens.Count; i++) {79 for (; i < tokens.Count; i++) { 59 80 var token = tokens[i]; 60 81 double d; … … 64 85 stack.Push(GetVariableValue(variables, token.Substring(1, token.Length - 2).Replace("\\\"", "\""))); 65 86 } else if (token.StartsWith("'")) { 66 stack.Push(token.Substring(1, token.Length -2).Replace("\\'", "'"));87 stack.Push(token.Substring(1, token.Length - 2).Replace("\\'", "'")); 67 88 } else { 68 89 Apply(token, stack, variables); 69 90 } 70 91 } 71 } catch (Exception x) { 92 } 93 catch (Exception x) { 72 94 throw new Exception(string.Format( 73 95 "Calculation of '{1}'{0}failed at token #{2}: {3} {0}current stack is: {0}{4}", Environment.NewLine, 74 Formula, i, TokenWithContext(tokens, i, 3), 96 Formula, i, TokenWithContext(tokens, i, 3), 75 97 string.Join(Environment.NewLine, stack.Select(AsString))), 76 98 x); … … 89 111 private string TokenWithContext(List<string> tokens, int i, int context) { 90 112 var sb = new StringBuilder(); 91 if (i > context +1)113 if (i > context + 1) 92 114 sb.Append("... "); 93 115 int prefix = Math.Max(0, i - context); … … 104 126 private static void Apply(string token, Stack<object> stack, IDictionary<string, IItem> variables) { 105 127 switch (token) { 106 case "null": 107 case "true": 128 case "null": stack.Push(null); break; 129 case "true": stack.Push(true); break; 108 130 case "false": stack.Push(false); break; 109 131 … … 186 208 try { 187 209 stack.Push(func(a)); 188 } catch (Exception) { 210 } 211 catch (Exception) { 189 212 stack.Push(a); 190 213 throw; … … 199 222 try { 200 223 stack.Push(func(a, b)); 201 } catch (Exception) { 224 } 225 catch (Exception) { 202 226 stack.Push(b); 203 227 stack.Push(a); … … 214 238 try { 215 239 stack.Push(func(a, b, c)); 216 } catch (Exception) { 240 } 241 catch (Exception) { 217 242 stack.Push(a); 218 243 stack.Push(b); -
branches/OaaS/HeuristicLab.Optimization/3.3/RunCollectionModification/RunCollectionDiscretizer.cs
r7228 r9363 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
branches/OaaS/HeuristicLab.Optimization/3.3/RunCollectionModification/RunCollectionFormulaModifer.cs
r7228 r9363 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
branches/OaaS/HeuristicLab.Optimization/3.3/RunCollectionModification/RunCollectionGroupCreater.cs
r7228 r9363 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
branches/OaaS/HeuristicLab.Optimization/3.3/RunCollectionModification/RunCollectionRunRemover.cs
r7228 r9363 1 using System.Collections.Generic; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System.Collections.Generic; 2 23 using HeuristicLab.Common; 3 24 using HeuristicLab.Core; -
branches/OaaS/HeuristicLab.Optimization/3.3/RunCollectionModification/RunCollectionSorter.cs
r7228 r9363 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
branches/OaaS/HeuristicLab.Optimization/3.3/RunCollectionModification/RunCollectionValueRemover.cs
r7228 r9363 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq;
Note: See TracChangeset
for help on using the changeset viewer.