- Timestamp:
- 07/09/15 13:07:30 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering
- Property svn:mergeinfo changed
-
Property
svn:global-ignores
set to
*.nuget
packages
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/HLScript/HeuristicLab.Core merged eligible /stable/HeuristicLab.Core merged eligible /trunk/sources/HeuristicLab.Core merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.Core 10321-10322 /branches/Algorithms.GradientDescent/HeuristicLab.Core 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Core 6917-7005 /branches/CloningRefactoring/HeuristicLab.Core 4656-4721 /branches/CodeEditor/HeuristicLab.Core 11700-11806 /branches/DataAnalysis Refactoring/HeuristicLab.Core 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Core 5815-6180 /branches/DataAnalysis/HeuristicLab.Core 4458-4459,4462,4464 /branches/DataPreprocessing/HeuristicLab.Core 10085-11101 /branches/GP.Grammar.Editor/HeuristicLab.Core 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Core 5060 /branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Core 11570-12508 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Core 6123-9799 /branches/LogResidualEvaluator/HeuristicLab.Core 10202-10483 /branches/NET40/sources/HeuristicLab.Core 5138-5162 /branches/NSGA-II Changes/HeuristicLab.Core 12033-12122 /branches/NewItemDialog/HeuristicLab.Core 12240,12246 /branches/ParallelEngine/HeuristicLab.Core 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Core 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Core 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Core 6828 /branches/RuntimeOptimizer/HeuristicLab.Core 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Core 7787-8333 /branches/SlaveShutdown/HeuristicLab.Core 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Core 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.Core 5370-5682 /branches/Trunk/HeuristicLab.Core 6829-6865 /branches/UnloadJobs/HeuristicLab.Core 9168-9215 /branches/VNS/HeuristicLab.Core 5594-5752 /branches/histogram/HeuristicLab.Core 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/Log.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 30 30 [Item("Log", "A log for logging string messages.")] 31 31 [StorableClass] 32 public class Log : Item, ILog, IStorableContent {32 public sealed class Log : Item, ILog, IStorableContent { 33 33 public string Filename { get; set; } 34 34 … … 38 38 39 39 [Storable] 40 pr otectedIList<string> messages;41 public virtualIEnumerable<string> Messages {40 private IList<string> messages; 41 public IEnumerable<string> Messages { 42 42 get { return messages; } 43 43 } 44 44 45 45 [Storable] 46 pr otectedlong maxMessageCount;47 public virtuallong MaxMessageCount {46 private long maxMessageCount; 47 public long MaxMessageCount { 48 48 get { return maxMessageCount; } 49 49 } 50 50 51 51 [StorableConstructor] 52 pr otectedLog(bool deserializing) : base(deserializing) { }53 pr otectedLog(Log original, Cloner cloner)52 private Log(bool deserializing) : base(deserializing) { } 53 private Log(Log original, Cloner cloner) 54 54 : base(original, cloner) { 55 55 this.messages = new List<string>(original.messages); … … 66 66 } 67 67 68 public v irtual void Clear() {68 public void Clear() { 69 69 messages.Clear(); 70 70 OnCleared(); 71 71 } 72 public v irtual void LogMessage(string message) {72 public void LogMessage(string message) { 73 73 string s = FormatLogMessage(message); 74 74 messages.Add(s); … … 76 76 OnMessageAdded(s); 77 77 } 78 public v irtual void LogException(Exception ex) {78 public void LogException(Exception ex) { 79 79 string s = FormatException(ex); 80 80 messages.Add(s); … … 82 82 OnMessageAdded(s); 83 83 } 84 pr otected virtualvoid CapMessages() {84 private void CapMessages() { 85 85 while (maxMessageCount >= 0 && messages.Count > maxMessageCount) { 86 86 messages.RemoveAt(0); 87 87 } 88 88 } 89 p rotected virtualstring FormatLogMessage(string message) {89 public static string FormatLogMessage(string message) { 90 90 return DateTime.Now.ToString() + "\t" + message; 91 91 } 92 p rotected virtualstring FormatException(Exception ex) {92 public static string FormatException(Exception ex) { 93 93 return DateTime.Now.ToString() + "\t" + "Exception occurred:" + Environment.NewLine + ErrorHandling.BuildErrorMessage(ex); 94 94 } 95 95 96 96 public event EventHandler<EventArgs<string>> MessageAdded; 97 pr otected virtualvoid OnMessageAdded(string message) {97 private void OnMessageAdded(string message) { 98 98 EventHandler<EventArgs<string>> handler = MessageAdded; 99 99 if (handler != null) handler(this, new EventArgs<string>(message)); 100 100 } 101 101 public event EventHandler Cleared; 102 pr otected virtualvoid OnCleared() {102 private void OnCleared() { 103 103 EventHandler handler = Cleared; 104 104 if (handler != null) handler(this, EventArgs.Empty);
Note: See TracChangeset
for help on using the changeset viewer.