Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/07/16 10:18:05 (8 years ago)
Author:
ascheibe
Message:

#2582 created branch for Hive Web Job Manager

Location:
branches/WebJobManager
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/WebJobManager/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs

    r12504 r13656  
    4242    private CancellationTokenSource cancellationTokenSource;
    4343
    44     public string ItemName {
     44    public string ItemName
     45    {
    4546      get { return ItemAttribute.GetName(this.GetType()); }
    4647    }
    47     public string ItemDescription {
     48    public string ItemDescription
     49    {
    4850      get { return ItemAttribute.GetDescription(this.GetType()); }
    4951    }
    50     public Version ItemVersion {
     52    public Version ItemVersion
     53    {
    5154      get { return ItemAttribute.GetVersion(this.GetType()); }
    5255    }
    53     public static Image StaticItemImage {
    54       get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
    55     }
    56     public Image ItemImage {
    57       get {
     56    public static Image StaticItemImage
     57    {
     58      get { return new Bitmap(25, 25); }
     59    }
     60    public Image ItemImage
     61    {
     62      get
     63      {
    5864        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
    5965        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
     
    6975    [Storable]
    7076    private IBenchmark benchmark;
    71     public IBenchmark Benchmark {
     77    public IBenchmark Benchmark
     78    {
    7279      get { return benchmark; }
    73       set {
     80      set
     81      {
    7482        if (value == null) throw new ArgumentNullException();
    7583        benchmark = value;
     
    7987    [Storable]
    8088    private ExecutionState executionState;
    81     public ExecutionState ExecutionState {
     89    public ExecutionState ExecutionState
     90    {
    8291      get { return executionState; }
    83       private set {
     92      private set
     93      {
    8494        if (executionState != value) {
    8595          executionState = value;
     
    92102    [Storable]
    93103    private TimeSpan executionTime;
    94     public TimeSpan ExecutionTime {
     104    public TimeSpan ExecutionTime
     105    {
    95106      get { return executionTime; }
    96       private set {
     107      private set
     108      {
    97109        executionTime = value;
    98110        OnExecutionTimeChanged();
     
    102114    [Storable]
    103115    private bool storeAlgorithmInEachRun;
    104     public bool StoreAlgorithmInEachRun {
     116    public bool StoreAlgorithmInEachRun
     117    {
    105118      get { return storeAlgorithmInEachRun; }
    106       set {
     119      set
     120      {
    107121        if (storeAlgorithmInEachRun != value) {
    108122          storeAlgorithmInEachRun = value;
     
    117131    [Storable]
    118132    private RunCollection runs = new RunCollection();
    119     public RunCollection Runs {
     133    public RunCollection Runs
     134    {
    120135      get { return runs; }
    121       private set {
     136      private set
     137      {
    122138        if (value == null) throw new ArgumentNullException();
    123139        if (runs != value) {
     
    131147    [Storable]
    132148    private ResultCollection results;
    133     public ResultCollection Results {
     149    public ResultCollection Results
     150    {
    134151      get { return results; }
    135152    }
    136153
    137     public Type ProblemType {
    138       get {
     154    public Type ProblemType
     155    {
     156      get
     157      {
    139158        // BenchmarkAlgorithm does not have a problem, so return a type which is no problem for sure
    140159        return typeof(BenchmarkAlgorithm);
     
    142161    }
    143162
    144     public IProblem Problem {
     163    public IProblem Problem
     164    {
    145165      get { return null; }
    146166      set { throw new NotImplementedException("BenchmarkAlgorithm does not have a problem."); }
     
    149169    [Storable]
    150170    private string name;
    151     public string Name {
     171    public string Name
     172    {
    152173      get { return name; }
    153       set {
     174      set
     175      {
    154176        if (!CanChangeName) throw new NotSupportedException("Name cannot be changed.");
    155177        if (!(name.Equals(value) || (value == null) && (name == string.Empty))) {
     
    164186      }
    165187    }
    166     public bool CanChangeName {
     188    public bool CanChangeName
     189    {
    167190      get { return true; }
    168191    }
     
    170193    [Storable]
    171194    private string description;
    172     public string Description {
     195    public string Description
     196    {
    173197      get { return description; }
    174       set {
     198      set
     199      {
    175200        if (!CanChangeDescription) throw new NotSupportedException("Description cannot be changed.");
    176201        if (!(description.Equals(value) || (value == null) && (description == string.Empty))) {
     
    180205      }
    181206    }
    182     public bool CanChangeDescription {
     207    public bool CanChangeDescription
     208    {
    183209      get { return true; }
    184210    }
     
    186212    [Storable]
    187213    private ParameterCollection parameters = new ParameterCollection();
    188     public IKeyedItemCollection<string, IParameter> Parameters {
     214    public IKeyedItemCollection<string, IParameter> Parameters
     215    {
    189216      get { return parameters; }
    190217    }
    191218    private ReadOnlyKeyedItemCollection<string, IParameter> readOnlyParameters;
    192     IKeyedItemCollection<string, IParameter> IParameterizedItem.Parameters {
    193       get {
     219    IKeyedItemCollection<string, IParameter> IParameterizedItem.Parameters
     220    {
     221      get
     222      {
    194223        if (readOnlyParameters == null) readOnlyParameters = parameters.AsReadOnly();
    195224        return readOnlyParameters;
     
    197226    }
    198227
    199     public IEnumerable<IOptimizer> NestedOptimizers {
     228    public IEnumerable<IOptimizer> NestedOptimizers
     229    {
    200230      get { return Enumerable.Empty<IOptimizer>(); }
    201231    }
    202232
    203233    #region Parameter Properties
    204     public IConstrainedValueParameter<IBenchmark> BenchmarkParameter {
     234    public IConstrainedValueParameter<IBenchmark> BenchmarkParameter
     235    {
    205236      get { return (IConstrainedValueParameter<IBenchmark>)Parameters["Benchmark"]; }
    206237    }
    207     private ValueParameter<IntValue> ChunkSizeParameter {
     238    private ValueParameter<IntValue> ChunkSizeParameter
     239    {
    208240      get { return (ValueParameter<IntValue>)Parameters["ChunkSize"]; }
    209241    }
    210     private ValueParameter<DoubleValue> TimeLimitParameter {
     242    private ValueParameter<DoubleValue> TimeLimitParameter
     243    {
    211244      get { return (ValueParameter<DoubleValue>)Parameters["TimeLimit"]; }
    212245    }
Note: See TracChangeset for help on using the changeset viewer.