Changeset 11730 for branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/SentenceSetStatistics.cs
- Timestamp:
- 01/02/15 16:08:21 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Problems.GrammaticalOptimization/SentenceSetStatistics.cs
r11727 r11730 4 4 using System.Text; 5 5 using System.Threading.Tasks; 6 using HeuristicLab.Common; 6 7 7 8 namespace HeuristicLab.Problems.GrammaticalOptimization { … … 12 13 public string LastSentence { get; private set; } 13 14 public double BestSentenceQuality { get; private set; } 15 public double BestSentenceIndex { get; private set; } 14 16 public double FirstSentenceQuality { get; private set; } 15 17 public double LastSentenceQuality { get; private set; } … … 19 21 20 22 public void AddSentence(string sentence, double quality) { 21 if (NumberOfSentences == 0) { 23 sumQualities += quality; 24 NumberOfSentences++; 25 26 if (NumberOfSentences == 1) { 22 27 FirstSentence = sentence; 23 28 FirstSentenceQuality = quality; … … 27 32 BestSentence = sentence; 28 33 BestSentenceQuality = quality; 34 BestSentenceIndex = NumberOfSentences; 29 35 } 30 31 sumQualities += quality;32 NumberOfSentences++;33 36 34 37 LastSentence = sentence; … … 38 41 public override string ToString() { 39 42 return 40 string.Format("Sentences: {0,10} avg.-quality {1,7:F5} best {2,7:F5} {3 } first {4,7:F5} {5} last {6,7:F5} {7}",43 string.Format("Sentences: {0,10} avg.-quality {1,7:F5} best {2,7:F5} {3,2} {4,10} {5} first {6,7:F5} {7} last {8,7:F5} {9}", 41 44 NumberOfSentences, AverageQuality, 42 BestSentenceQuality, BestSentence, 45 BestSentenceQuality, BestSentenceQuality.IsAlmost(1.0)?1.0:0.0, 46 BestSentenceIndex, BestSentence, 43 47 FirstSentenceQuality, FirstSentence, 44 48 LastSentenceQuality, LastSentence
Note: See TracChangeset
for help on using the changeset viewer.