Changeset 12803 for branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerClockAnalyzer.cs
- Timestamp:
- 07/24/15 15:31:54 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityPerClockAnalyzer.cs
r12774 r12803 42 42 } 43 43 44 public I ResultParameter<TimeSpanValue> ExecutionTimeParameter {45 get { return (I ResultParameter<TimeSpanValue>)Parameters["ExecutionTime"]; }44 public ILookupParameter<DateTimeValue> LastUpdateTimeParameter { 45 get { return (ILookupParameter<DateTimeValue>)Parameters["LastUpdateTime"]; } 46 46 } 47 47 … … 56 56 : base() { 57 57 Parameters.Add(new LookupParameter<DoubleValue>("BestQuality", "The quality value that should be compared.")); 58 Parameters.Add(new ResultParameter<TimeSpanValue>("Execution Time", "The execution time."));58 Parameters.Add(new LookupParameter<DateTimeValue>("LastUpdateTime", "The time the analyzer was last run.")); 59 59 Parameters.Add(new ResultParameter<IndexedDataTable<double>>("QualityPerClock", "Data table containing the first hitting graph with elapsed wall clock time (in seconds) as the x-axis.")); 60 60 QualityPerClockParameter.DefaultValue = new IndexedDataTable<double>("Quality per Clock") { … … 75 75 76 76 public override IOperation Apply() { 77 var executionTime = Math.Max(ExecutionTimeParameter.ResultValue.Value.TotalSeconds, 0.2); 77 var lastUpdateTime = LastUpdateTimeParameter.ActualValue; 78 if (lastUpdateTime == null) { 79 lastUpdateTime = new DateTimeValue(DateTime.UtcNow.AddMilliseconds(-1)); 80 LastUpdateTimeParameter.ActualValue = lastUpdateTime; 81 } 82 var now = DateTime.UtcNow; 83 78 84 var bestQuality = BestQualityParameter.ActualValue.Value; 79 85 … … 81 87 var values = dataTable.Rows["First-hit Graph"].Values; 82 88 if (values.Count == 0 || values.Last().Item2 != bestQuality) 83 dataTable.Rows["First-hit Graph"].Values.Add(Tuple.Create( executionTime, bestQuality));89 dataTable.Rows["First-hit Graph"].Values.Add(Tuple.Create((now - lastUpdateTime.Value).TotalSeconds, bestQuality)); 84 90 91 lastUpdateTime.Value = now; 85 92 return base.Apply(); 86 93 }
Note: See TracChangeset
for help on using the changeset viewer.