- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 8 edited
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/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.