Changeset 12824
- Timestamp:
- 08/01/15 15:43:41 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml
r12815 r12824 160 160 <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding LeaveNodes}" TextAlignment="Right"></TextBlock> 161 161 <TextBlock Grid.Row="4" Grid.Column="0" Text="DeepestLevel:"></TextBlock> 162 <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding DeepestLevel}" TextAlignment="Right"></TextBlock> 162 <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding DeepestLevel}" TextAlignment="Right"></TextBlock> 163 163 </Grid> 164 164 <Frame Grid.Column="1" Name="treeDrawing" Source="pack://application:,,,/WpfTestSvgSample;component/DrawingPage.xaml"/> … … 179 179 </TabItem> 180 180 <TabItem Header="Table"> 181 <ListView ItemsSource="{Binding Path=Runs}"> 181 <ListView Name="ListViewRuns" ItemsSource="{Binding Path=Runs}" SelectionMode="Multiple"> 182 <ListView.ContextMenu> 183 <ContextMenu> 184 <MenuItem Header="Copy to clipboard" Click="MenuItemCopyToClipboard_OnClick" /> 185 </ContextMenu> 186 </ListView.ContextMenu> 182 187 <ListView.View> 183 188 <GridView> … … 185 190 <GridViewColumn DisplayMemberBinding="{Binding Path=RunNumber}" 186 191 Header="Run #"/> 192 <GridViewColumn DisplayMemberBinding="{Binding Path=MaxIterations}" 193 Header="MaxIterations"/> 187 194 <GridViewColumn DisplayMemberBinding="{Binding Path=Evaluations}" 188 195 Header="Evaluations"/> 189 196 <GridViewColumn DisplayMemberBinding="{Binding Path=BestKnownQuality}" 190 197 Header="BestKnownQuality"/> 191 <GridViewColumn DisplayMemberBinding="{Binding Path=Best SolutionQuality}"198 <GridViewColumn DisplayMemberBinding="{Binding Path=BestQuality}" 192 199 Header="BestQuality"/> 200 <GridViewColumn DisplayMemberBinding="{Binding Path=BestSolutionFoundAt}" 201 Header="BestSolutionFoundAt"/> 193 202 <GridViewColumn DisplayMemberBinding="{Binding Path=EvaluationsPerSecond}" 194 203 Header="EvaluationsPerSecond"/> -
branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml.cs
r12815 r12824 1 1 using System.Collections.ObjectModel; 2 2 using System.Security.AccessControl; 3 using System.Text; 3 4 using System.Threading; 5 using System.Windows.Documents; 4 6 using System.Xml.Serialization; 5 7 using Evaluation.ViewModel; … … 390 392 SaveToFile(); 391 393 } 394 395 private void MenuItemCopyToClipboard_OnClick(object sender, RoutedEventArgs e) 396 { 397 StringBuilder tableExport = new StringBuilder(); 398 tableExport.AppendLine( 399 "Run\tMaxIterations\tEvaluations\tBestKnownQuality\tQuality\tQuality %\tFoundAt\tTotalTime\tSolutionTime\tEvaluationsPerSecond\tSolution"); 400 for (int i = 0; i < ListViewRuns.Items.Count; i++) 401 { 402 Run run = (Run)ListViewRuns.Items[i]; 403 tableExport.AppendLine(string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}", run.RunNumber, 404 run.MaxIterations, run.Evaluations, run.BestKnownQuality, run.BestQuality, 405 run.BestQuality / run.BestKnownQuality, run.BestSolutionFoundAt, run.TotalTime, run.BestSolutionTime, 406 run.EvaluationsPerSecond, run.BestSolution)); 407 } 408 Clipboard.SetData(DataFormats.Text, tableExport.ToString()); 409 } 392 410 } 393 411 } -
branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/Run.cs
r12815 r12824 52 52 BestSolution = sentence; 53 53 BestSolutionFoundAt = evaluations; 54 FoundSolutions.Add(new FoundSolution(DateTime.Now, Evaluations, quality, sentence)); 54 FoundSolution solution = new FoundSolution(DateTime.Now, Evaluations, quality, sentence); 55 BestSolutionTime = solution.Time - StartTime; 56 FoundSolutions.Add(solution); 55 57 } 56 58 }; -
branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/SelectionIndicator.cs
r12815 r12824 9 9 public class SelectionIndicator 10 10 { 11 public SelectionIndicator() 12 { 13 14 } 11 15 public SelectionIndicator(int goodSelections, int totalSelections) 12 16 {
Note: See TracChangeset
for help on using the changeset viewer.