using HeuristicLab.Algorithms.Bandits.BanditPolicies; using HeuristicLab.Algorithms.GeneticProgramming; using HeuristicLab.Algorithms.GrammaticalOptimization; using HeuristicLab.Algorithms.MonteCarloTreeSearch; using HeuristicLab.Problems.GrammaticalOptimization; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Linq; namespace Evaluation.ViewModel { public class EvaluationViewModel : INotifyPropertyChanged { private List problems; public List Problems { get { return this.problems; } set { this.problems = value; this.OnPropertyChanged("Problems"); } } private ISymbolicExpressionTreeProblem selectedProblem; public ISymbolicExpressionTreeProblem SelectedProblem { get { return this.selectedProblem; } set { this.selectedProblem = value; this.OnPropertyChanged("SelectedProblem"); } } private List algorithms; public List Algorithms { get { return this.algorithms; } set { this.algorithms = value; this.OnPropertyChanged("Algorithms"); } } private Type selectedAlgorithm; public Type SelectedAlgorithm { get { return this.selectedAlgorithm; } set { this.selectedAlgorithm = value; this.OnPropertyChanged("SelectedAlgorithm"); } } private List policies; public List Policies { get { return this.policies; } set { this.policies = value; this.OnPropertyChanged("Policies"); } } private Type selectedPolicy; public Type SelectedPolicy { get { return this.selectedPolicy; } set { this.selectedPolicy = value; this.OnPropertyChanged("SelectedPolicy"); } } private int nrRuns; public int NrRuns { get { return this.nrRuns; } set { this.nrRuns = value; this.OnPropertyChanged("NrRuns"); } } private int maxLen; public int MaxLen { get { return this.maxLen; } set { this.maxLen = value; this.OnPropertyChanged("MaxLen"); } } private int maxIterations; public int MaxIterations { get { return this.maxIterations; } set { this.maxIterations = value; this.OnPropertyChanged("MaxIterations"); } } private int maxThreads; public int MaxThreads { get { return this.maxThreads; } set { this.maxThreads = value; this.OnPropertyChanged("MaxThreads"); } } private double _policyParameter; public double PolicyParameter { get { return this._policyParameter; } set { this._policyParameter = value; this.OnPropertyChanged("PolicyParameter"); } } private ObservableCollection runs = new ObservableCollection(); public ObservableCollection Runs { get { return this.runs; } set { runs = value; this.OnPropertyChanged("Runs"); } } private Run selectedRun; public Run SelectedRun { get { return this.selectedRun; } set { selectedRun = value; this.OnPropertyChanged("SelectedRun"); } } private string completedRuns; public string CompletedRuns { get { return this.completedRuns; } set { completedRuns = value; this.OnPropertyChanged("CompletedRuns"); } } public EvaluationViewModel() { InitializeProblems(); InitializeAlgorithms(); InitializePolicies(); } private void InitializePolicies() { this.policies = new List(); this.policies.Add(typeof(ActiveLearningPolicy)); this.policies.Add(typeof(BernoulliThompsonSamplingPolicy)); this.policies.Add(typeof(BoltzmannExplorationPolicy)); this.policies.Add(typeof(EpsGreedyPolicy)); this.policies.Add(typeof(GenericThompsonSamplingPolicy)); this.policies.Add(typeof(ModifiedUCTPolicy)); this.policies.Add(typeof(RandomPolicy)); this.policies.Add(typeof(ThresholdAscentPolicy)); this.policies.Add(typeof(UCB1Policy)); this.policies.Add(typeof(UCB1TunedPolicy)); this.policies.Add(typeof(UCBNormalPolicy)); this.policies.Add(typeof(UCTPolicy)); this.selectedPolicy = typeof(UCB1Policy); } private void InitializeAlgorithms() { this.algorithms = new List(); this.algorithms.Add(typeof(RandomSearch)); this.algorithms.Add(typeof(SequentialSearch)); this.algorithms.Add(typeof(MonteCarloTreeSearch)); this.algorithms.Add(typeof(MonteCarloTreeSearch_PruneLeaves)); this.algorithms.Add(typeof(StandardGP)); this.algorithms.Add(typeof(OffspringSelectionGP)); this.selectedAlgorithm = typeof(MonteCarloTreeSearch_PruneLeaves); } private void InitializeProblems() { this.problems = new List(); this.problems.Add(new SymbolicRegressionPoly10Problem()); this.problems.Add(new SantaFeAntProblem()); this.problems.Add(new EvenParityProblem()); this.problems.Add(new RoyalPairProblem()); this.problems.Add(new PalindromeProblem()); this.problems.Add(new PermutationProblem()); this.problems.Add(new RoyalSymbolProblem()); // TODO: still some missing... this.selectedProblem = problems.FirstOrDefault(); } #region INotifyPropertyChanged members public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } #endregion INotifyPropertyChanged members } }