- Timestamp:
- 08/03/15 11:37:49 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml
r12832 r12833 46 46 DisplayMemberPath="Name" 47 47 SelectedValue="{Binding SelectedPolicy}" 48 Width="200" Margin="5,0,0,0"></ComboBox> 48 Width="200" Margin="5,0,0,0" 49 SelectionChanged="ComboBoxPolicies_OnSelectionChanged"></ComboBox> 50 <TextBlock Name="TextBlockEpsylon" Text="Epsylon:" Visibility="Hidden" Margin="5,0,0,0" VerticalAlignment="Center"></TextBlock> 51 <TextBox Name="TextBoxEpsylon" Text="{Binding Epsylon}" Visibility="Hidden" Margin="5,0,0,0" VerticalAlignment="Center" Width="50"></TextBox> 49 52 <Button Name="ButtonRun" Margin="5,0,0,0" Click="ButtonRun_OnClick" Height="22" VerticalAlignment="Top">Run</Button> 50 53 <Button Name="ButtonPause" Margin="5,0,0,0" Click="ButtonPause_OnClick" IsEnabled="False">Pause</Button> … … 74 77 <TextBox Name="TextBoxMaxIterations" Margin="2" Grid.Column="1" Grid.Row="1" Width="100" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding MaxIterations}"></TextBox> 75 78 <TextBlock Margin="2" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center">MaxThreads:</TextBlock> 76 <TextBox Name=" MaxThreads" Margin="2" Grid.Column="3" Grid.Row="1" Width="100" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding MaxThreads}"></TextBox>79 <TextBox Name="TextBoxMaxThreads" Margin="2" Grid.Column="3" Grid.Row="1" Width="100" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding MaxThreads}"></TextBox> 77 80 <TextBlock Margin="2" Grid.Column="2" Grid.Row="0" VerticalAlignment="Center">MaxLen:</TextBlock> 78 81 <TextBox Name="TextBoxMaxLen" Margin="2" Grid.Column="3" Grid.Row="0" Width="100" VerticalAlignment="Center" TextAlignment="Right" Text="{Binding MaxLen}"></TextBox> -
branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/MainWindow.xaml.cs
r12832 r12833 156 156 TextBoxMaxLen.IsEnabled = true; 157 157 TextBoxRuns.IsEnabled = true; 158 TextBoxMaxThreads.IsEnabled = true; 158 159 } 159 160 … … 181 182 policyInstance = new BoltzmannExplorationPolicy(2); 182 183 } 184 else if (policy == typeof (EpsGreedyPolicy)) 185 { 186 policyInstance = new EpsGreedyPolicy(vm.Epsylon); 187 } 183 188 else 184 189 { 185 190 policyInstance = (IBanditPolicy)Activator.CreateInstance(policy); 186 191 } 187 188 189 192 190 193 for (int i = 0; i < vm.NrRuns; i++) … … 428 431 Clipboard.SetData(DataFormats.Text, tableExport.ToString()); 429 432 } 433 434 private void ComboBoxPolicies_OnSelectionChanged(object sender, SelectionChangedEventArgs e) 435 { 436 if (vm.SelectedPolicy == typeof (EpsGreedyPolicy)) 437 { 438 TextBoxEpsylon.Visibility = Visibility.Visible; 439 TextBlockEpsylon.Visibility = Visibility.Visible; 440 } 441 else 442 { 443 TextBoxEpsylon.Visibility = Visibility.Hidden; 444 TextBlockEpsylon.Visibility = Visibility.Hidden; 445 } 446 } 430 447 } 431 448 } -
branches/HeuristicLab.Problems.GrammaticalOptimization/Evaluation/ViewModel/EvaluationViewModel.cs
r12832 r12833 119 119 this.maxThreads = value; 120 120 this.OnPropertyChanged("MaxThreads"); 121 } 122 } 123 124 private double epsylon; 125 126 public double Epsylon 127 { 128 get { return this.epsylon; } 129 set 130 { 131 this.epsylon = value; 132 this.OnPropertyChanged("Epsylon"); 121 133 } 122 134 }
Note: See TracChangeset
for help on using the changeset viewer.