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:
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs

    r12012 r13656  
    3737  [StorableClass]
    3838  public abstract class Algorithm : ParameterizedNamedItem, IAlgorithm {
    39     public static new Image StaticItemImage {
    40       get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
    41     }
    42     public override Image ItemImage {
    43       get {
     39    public static new Image StaticItemImage
     40    {
     41      get { return new Bitmap(25, 25); }
     42    }
     43    public override Image ItemImage
     44    {
     45      get
     46      {
    4447        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
    4548        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
     
    5255    [Storable]
    5356    private ExecutionState executionState;
    54     public ExecutionState ExecutionState {
     57    public ExecutionState ExecutionState
     58    {
    5559      get { return executionState; }
    56       private set {
     60      private set
     61      {
    5762        if (executionState != value) {
    5863          executionState = value;
     
    6570    [Storable]
    6671    private TimeSpan executionTime;
    67     public TimeSpan ExecutionTime {
     72    public TimeSpan ExecutionTime
     73    {
    6874      get { return executionTime; }
    69       protected set {
     75      protected set
     76      {
    7077        executionTime = value;
    7178        OnExecutionTimeChanged();
     
    7380    }
    7481
    75     public virtual Type ProblemType {
     82    public virtual Type ProblemType
     83    {
    7684      get { return typeof(IProblem); }
    7785    }
     
    7987    [Storable]
    8088    private IProblem problem;
    81     public IProblem Problem {
     89    public IProblem Problem
     90    {
    8291      get { return problem; }
    83       set {
     92      set
     93      {
    8494        if (problem != value) {
    8595          if ((value != null) && !ProblemType.IsInstanceOfType(value)) throw new ArgumentException("Invalid problem type.");
     
    97107    [Storable]
    98108    private bool storeAlgorithmInEachRun;
    99     public bool StoreAlgorithmInEachRun {
     109    public bool StoreAlgorithmInEachRun
     110    {
    100111      get { return storeAlgorithmInEachRun; }
    101       set {
     112      set
     113      {
    102114        if (storeAlgorithmInEachRun != value) {
    103115          storeAlgorithmInEachRun = value;
     
    112124    [Storable]
    113125    private RunCollection runs;
    114     public RunCollection Runs {
     126    public RunCollection Runs
     127    {
    115128      get { return runs; }
    116       protected set {
     129      protected set
     130      {
    117131        if (value == null) throw new ArgumentNullException();
    118132        if (runs != value) {
     
    124138    }
    125139
    126     public virtual IEnumerable<IOptimizer> NestedOptimizers {
     140    public virtual IEnumerable<IOptimizer> NestedOptimizers
     141    {
    127142      get { return Enumerable.Empty<IOptimizer>(); }
    128143    }
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/MetaOptimizers/BatchRun.cs

    r12504 r13656  
    4141    public string Filename { get; set; }
    4242
    43     public static new Image StaticItemImage {
    44       get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
    45     }
    46     public override Image ItemImage {
    47       get {
     43    public static new Image StaticItemImage
     44    {
     45      get { return new Bitmap(25, 25); }
     46    }
     47    public override Image ItemImage
     48    {
     49      get
     50      {
    4851        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunPrepared;
    4952        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.BatchRunStarted;
     
    5659    [Storable]
    5760    private ExecutionState executionState;
    58     public ExecutionState ExecutionState {
     61    public ExecutionState ExecutionState
     62    {
    5963      get { return executionState; }
    60       private set {
     64      private set
     65      {
    6166        if (executionState != value) {
    6267          executionState = value;
     
    6974    [Storable]
    7075    private TimeSpan executionTime;
    71     public TimeSpan ExecutionTime {
    72       get {
     76    public TimeSpan ExecutionTime
     77    {
     78      get
     79      {
    7380        if ((Optimizer != null) && (Optimizer.ExecutionState != ExecutionState.Stopped))
    7481          return executionTime + Optimizer.ExecutionTime;
     
    7683          return executionTime;
    7784      }
    78       private set {
     85      private set
     86      {
    7987        executionTime = value;
    8088        OnExecutionTimeChanged();
     
    8795    [Storable]
    8896    private IOptimizer optimizer;
    89     public IOptimizer Optimizer {
     97    public IOptimizer Optimizer
     98    {
    9099      get { return optimizer; }
    91       set {
     100      set
     101      {
    92102        if (optimizer != value) {
    93103          if (optimizer != null) {
     
    110120    #region Backwards compatible code (remove with 3.4)
    111121    [Storable(AllowOneWay = true)]
    112     private IAlgorithm algorithm {
     122    private IAlgorithm algorithm
     123    {
    113124      set { optimizer = value; }
    114125    }
     
    117128    [Storable]
    118129    private int repetitions;
    119     public int Repetitions {
     130    public int Repetitions
     131    {
    120132      get { return repetitions; }
    121       set {
     133      set
     134      {
    122135        if (repetitions != value) {
    123136          repetitions = value;
     
    130143    [Storable]
    131144    private int repetitionsCounter;
    132     public int RepetitionsCounter {
     145    public int RepetitionsCounter
     146    {
    133147      get { return repetitionsCounter; }
    134       private set {
     148      private set
     149      {
    135150        if (value != repetitionsCounter) {
    136151          repetitionsCounter = value;
     
    142157    [Storable]
    143158    private RunCollection runs;
    144     public RunCollection Runs {
     159    public RunCollection Runs
     160    {
    145161      get { return runs; }
    146       private set {
     162      private set
     163      {
    147164        if (value == null) throw new ArgumentNullException();
    148165        if (runs != value) {
     
    154171    }
    155172
    156     public IEnumerable<IOptimizer> NestedOptimizers {
    157       get {
     173    public IEnumerable<IOptimizer> NestedOptimizers
     174    {
     175      get
     176      {
    158177        if (Optimizer == null) yield break;
    159178
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/MetaOptimizers/Experiment.cs

    r13000 r13656  
    4040    public string Filename { get; set; }
    4141
    42     public static new Image StaticItemImage {
    43       get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
    44     }
    45     public override Image ItemImage {
    46       get {
     42    public static new Image StaticItemImage
     43    {
     44      get { return new Bitmap(25, 25); }
     45    }
     46    public override Image ItemImage
     47    {
     48      get
     49      {
    4750        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.ExperimentPrepared;
    4851        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.ExperimentStarted;
     
    5558    [Storable]
    5659    private ExecutionState executionState;
    57     public ExecutionState ExecutionState {
     60    public ExecutionState ExecutionState
     61    {
    5862      get { return executionState; }
    59       private set {
     63      private set
     64      {
    6065        if (executionState != value) {
    6166          executionState = value;
     
    6873    [Storable]
    6974    private TimeSpan executionTime;
    70     public TimeSpan ExecutionTime {
     75    public TimeSpan ExecutionTime
     76    {
    7177      get { return executionTime; }
    72       private set {
     78      private set
     79      {
    7380        executionTime = value;
    7481        OnExecutionTimeChanged();
     
    7885    [Storable]
    7986    private OptimizerList optimizers;
    80     public OptimizerList Optimizers {
     87    public OptimizerList Optimizers
     88    {
    8189      get { return optimizers; }
    8290    }
     
    8492    [Storable]
    8593    private RunCollection runs;
    86     public RunCollection Runs {
     94    public RunCollection Runs
     95    {
    8796      get { return runs; }
    88       private set {
     97      private set
     98      {
    8999        if (value == null) throw new ArgumentNullException();
    90100        if (runs != value) {
     
    96106    }
    97107
    98     public IEnumerable<IOptimizer> NestedOptimizers {
    99       get {
     108    public IEnumerable<IOptimizer> NestedOptimizers
     109    {
     110      get
     111      {
    100112        if (Optimizers == null) yield break;
    101113
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/MetaOptimizers/TimeLimitRun.cs

    r13321 r13656  
    4343
    4444    #region ItemImage
    45     public static new Image StaticItemImage {
    46       get { return VSImageLibrary.Event; }
    47     }
    48     public override Image ItemImage {
     45    public static new Image StaticItemImage
     46    {
     47      get { return new Bitmap(25, 25); }
     48    }
     49    public override Image ItemImage
     50    {
    4951      get { return (Algorithm != null) ? Algorithm.ItemImage : VSImageLibrary.ExecutableStopped; }
    5052    }
     
    5658    [Storable]
    5759    private TimeSpan maximumExecutionTime;
    58     public TimeSpan MaximumExecutionTime {
     60    public TimeSpan MaximumExecutionTime
     61    {
    5962      get { return maximumExecutionTime; }
    60       set {
     63      set
     64      {
    6165        if (maximumExecutionTime == value) return;
    6266        maximumExecutionTime = value;
     
    6973    [Storable]
    7074    private ObservableList<TimeSpan> snapshotTimes;
    71     public ObservableList<TimeSpan> SnapshotTimes {
     75    public ObservableList<TimeSpan> SnapshotTimes
     76    {
    7277      get { return snapshotTimes; }
    73       set {
     78      set
     79      {
    7480        if (snapshotTimes == value) return;
    7581        snapshotTimes = value;
     
    8389    private bool storeAlgorithmInEachSnapshot;
    8490    [Storable]
    85     public bool StoreAlgorithmInEachSnapshot {
     91    public bool StoreAlgorithmInEachSnapshot
     92    {
    8693      get { return storeAlgorithmInEachSnapshot; }
    87       set {
     94      set
     95      {
    8896        if (storeAlgorithmInEachSnapshot == value) return;
    8997        storeAlgorithmInEachSnapshot = value;
     
    94102    [Storable]
    95103    private RunCollection snapshots;
    96     public RunCollection Snapshots {
     104    public RunCollection Snapshots
     105    {
    97106      get { return snapshots; }
    98       set {
     107      set
     108      {
    99109        if (snapshots == value) return;
    100110        snapshots = value;
     
    104114
    105115    #region Inherited Properties
    106     public ExecutionState ExecutionState {
     116    public ExecutionState ExecutionState
     117    {
    107118      get { return (Algorithm != null) ? Algorithm.ExecutionState : ExecutionState.Stopped; }
    108119    }
    109120
    110     public TimeSpan ExecutionTime {
     121    public TimeSpan ExecutionTime
     122    {
    111123      get { return (Algorithm != null) ? Algorithm.ExecutionTime : TimeSpan.FromSeconds(0); }
    112124    }
     
    114126    [Storable]
    115127    private IAlgorithm algorithm;
    116     public IAlgorithm Algorithm {
     128    public IAlgorithm Algorithm
     129    {
    117130      get { return algorithm; }
    118       set {
     131      set
     132      {
    119133        if (algorithm == value) return;
    120134        if (algorithm != null) DeregisterAlgorithmEvents();
     
    130144    [Storable]
    131145    private RunCollection runs;
    132     public RunCollection Runs {
     146    public RunCollection Runs
     147    {
    133148      get { return runs; }
    134       private set {
     149      private set
     150      {
    135151        if (value == null) throw new ArgumentNullException();
    136152        if (runs == value) return;
     
    140156    }
    141157
    142     public IEnumerable<IOptimizer> NestedOptimizers {
    143       get {
     158    public IEnumerable<IOptimizer> NestedOptimizers
     159    {
     160      get
     161      {
    144162        if (Algorithm == null) yield break;
    145163        yield return Algorithm;
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/Problems/Problem.cs

    r12012 r13656  
    3535  public abstract class Problem : ParameterizedNamedItem, IProblem {
    3636    private const string OperatorsParameterName = "Operators";
    37     public IFixedValueParameter<ItemCollection<IItem>> OperatorsParameter {
     37    public IFixedValueParameter<ItemCollection<IItem>> OperatorsParameter
     38    {
    3839      get { return (IFixedValueParameter<ItemCollection<IItem>>)Parameters[OperatorsParameterName]; }
    3940    }
    4041
    41     public static new Image StaticItemImage {
    42       get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; }
     42    public static new Image StaticItemImage
     43    {
     44      get { return new Bitmap(25, 25); }
    4345    }
    4446
     
    8587    #region Backwards compatible code, remove with 3.4
    8688    [Storable(Name = "Operators", AllowOneWay = true)]
    87     private IEnumerable<IOperator> StorableOperators {
    88       set {
     89    private IEnumerable<IOperator> StorableOperators
     90    {
     91      set
     92      {
    8993        IParameter operatorsParam;
    9094        if (Parameters.TryGetValue(OperatorsParameterName, out operatorsParam)) {
     
    102106    }
    103107    #endregion
    104     protected ItemCollection<IItem> Operators {
    105       get {
     108    protected ItemCollection<IItem> Operators
     109    {
     110      get
     111      {
    106112        // BackwardsCompatibility3.3
    107113        #region Backwards compatible code, remove with 3.4
     
    120126    }
    121127
    122     public virtual IEnumerable<IParameterizedItem> ExecutionContextItems {
     128    public virtual IEnumerable<IParameterizedItem> ExecutionContextItems
     129    {
    123130      get { yield return this; }
    124131    }
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/Problems/UserDefinedProblem.cs

    r12504 r13656  
    4343    public string Filename { get; set; }
    4444
    45     public static new Image StaticItemImage {
    46       get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; }
    47     }
    48     public new ParameterCollection Parameters {
     45    public static new Image StaticItemImage
     46    {
     47      get { return new Bitmap(25, 25); }
     48    }
     49    public new ParameterCollection Parameters
     50    {
    4951      get { return base.Parameters; }
    5052    }
    51     IKeyedItemCollection<string, IParameter> IParameterizedItem.Parameters {
     53    IKeyedItemCollection<string, IParameter> IParameterizedItem.Parameters
     54    {
    5255      get { return Parameters; }
    5356    }
    5457
    5558    #region Parameters
    56     public IValueParameter<ISingleObjectiveEvaluator> EvaluatorParameter {
     59    public IValueParameter<ISingleObjectiveEvaluator> EvaluatorParameter
     60    {
    5761      get { return (IValueParameter<ISingleObjectiveEvaluator>)Parameters["Evaluator"]; }
    5862    }
    59     public ValueParameter<BoolValue> MaximizationParameter {
     63    public ValueParameter<BoolValue> MaximizationParameter
     64    {
    6065      get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; }
    6166    }
    62     IParameter ISingleObjectiveHeuristicOptimizationProblem.MaximizationParameter {
     67    IParameter ISingleObjectiveHeuristicOptimizationProblem.MaximizationParameter
     68    {
    6369      get { return MaximizationParameter; }
    6470    }
    65     public ValueParameter<ISolutionCreator> SolutionCreatorParameter {
     71    public ValueParameter<ISolutionCreator> SolutionCreatorParameter
     72    {
    6673      get { return (ValueParameter<ISolutionCreator>)Parameters["SolutionCreator"]; }
    6774    }
    68     IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter {
     75    IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter
     76    {
    6977      get { return SolutionCreatorParameter; }
    7078    }
    71     IParameter IHeuristicOptimizationProblem.EvaluatorParameter {
     79    IParameter IHeuristicOptimizationProblem.EvaluatorParameter
     80    {
    7281      get { return EvaluatorParameter; }
    7382    }
    74     public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
     83    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter
     84    {
    7585      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
    7686    }
    77     IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter {
     87    IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter
     88    {
    7889      get { return BestKnownQualityParameter; }
    7990    }
    80     public OptionalValueParameter<IScope> BestKnownSolutionParameter {
     91    public OptionalValueParameter<IScope> BestKnownSolutionParameter
     92    {
    8193      get { return (OptionalValueParameter<IScope>)Parameters["BestKnownSolution"]; }
    8294    }
    83     public ValueParameter<ItemList<IItem>> OperatorsParameter {
     95    public ValueParameter<ItemList<IItem>> OperatorsParameter
     96    {
    8497      get { return (ValueParameter<ItemList<IItem>>)Parameters["Operators"]; }
    8598    }
     
    87100
    88101    #region Properties
    89     public BoolValue Maximization {
     102    public BoolValue Maximization
     103    {
    90104      get { return MaximizationParameter.Value; }
    91105      set { MaximizationParameter.Value = value; }
    92106    }
    93     public ISolutionCreator SolutionCreator {
     107    public ISolutionCreator SolutionCreator
     108    {
    94109      get { return SolutionCreatorParameter.Value; }
    95110      set { SolutionCreatorParameter.Value = value; }
    96111    }
    97     ISolutionCreator IHeuristicOptimizationProblem.SolutionCreator {
     112    ISolutionCreator IHeuristicOptimizationProblem.SolutionCreator
     113    {
    98114      get { return SolutionCreatorParameter.Value; }
    99115    }
    100     public ISingleObjectiveEvaluator Evaluator {
     116    public ISingleObjectiveEvaluator Evaluator
     117    {
    101118      get { return EvaluatorParameter.Value; }
    102119      set { EvaluatorParameter.Value = value; }
    103120    }
    104     ISingleObjectiveEvaluator ISingleObjectiveHeuristicOptimizationProblem.Evaluator {
     121    ISingleObjectiveEvaluator ISingleObjectiveHeuristicOptimizationProblem.Evaluator
     122    {
    105123      get { return EvaluatorParameter.Value; }
    106124    }
    107     IEvaluator IHeuristicOptimizationProblem.Evaluator {
     125    IEvaluator IHeuristicOptimizationProblem.Evaluator
     126    {
    108127      get { return EvaluatorParameter.Value; }
    109128    }
    110     public DoubleValue BestKnownQuality {
     129    public DoubleValue BestKnownQuality
     130    {
    111131      get { return BestKnownQualityParameter.Value; }
    112132      set { BestKnownQualityParameter.Value = value; }
    113133    }
    114     public IEnumerable<IItem> Operators {
     134    public IEnumerable<IItem> Operators
     135    {
    115136      get { return OperatorsParameter.Value; }
    116137    }
    117138
    118     public IEnumerable<IParameterizedItem> ExecutionContextItems {
     139    public IEnumerable<IParameterizedItem> ExecutionContextItems
     140    {
    119141      get { yield return this; }
    120142    }
     
    250272      #region ISingleObjectiveEvaluator Members
    251273
    252       public ILookupParameter<DoubleValue> QualityParameter {
     274      public ILookupParameter<DoubleValue> QualityParameter
     275      {
    253276        get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    254277      }
     
    276299      #endregion
    277300
    278       public static new Image StaticItemImage {
    279         get { return HeuristicLab.Common.Resources.VSImageLibrary.Method; }
     301      public static new Image StaticItemImage
     302      {
     303        get { return new Bitmap(25, 25); }
    280304      }
    281305    }
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/ResultCollection.cs

    r12012 r13656  
    2121
    2222using System.Collections.Generic;
     23using System.Drawing;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    4142    }
    4243
    43     public static new System.Drawing.Image StaticItemImage {
    44       get { return HeuristicLab.Common.Resources.VSImageLibrary.Object; }
     44    public static new System.Drawing.Image StaticItemImage
     45    {
     46      get { return new Bitmap(25, 25); }
    4547    }
    4648
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/Termination/MultiTerminator.cs

    r12529 r13656  
    3535  [StorableClass]
    3636  public sealed class MultiTerminator : CheckedMultiOperator<ITerminator>, ITerminator {
    37     public static new Image StaticItemImage {
    38       get { return HeuristicLab.Common.Resources.VSImageLibrary.FlagRed; }
     37    public static new Image StaticItemImage
     38    {
     39      get { return new Bitmap(25, 25); }
    3940    }
    4041
    41     public ILookupParameter<BoolValue> TerminateParameter {
     42    public ILookupParameter<BoolValue> TerminateParameter
     43    {
    4244      get { return (ILookupParameter<BoolValue>)Parameters["Terminate"]; }
    4345    }
  • branches/WebJobManager/HeuristicLab.Optimization/3.3/Termination/Terminator.cs

    r12529 r13656  
    3333  [StorableClass]
    3434  public abstract class Terminator : SingleSuccessorOperator, ITerminator {
    35     public static new Image StaticItemImage {
    36       get { return HeuristicLab.Common.Resources.VSImageLibrary.FlagRed; }
     35    public static new Image StaticItemImage
     36    {
     37      get { return new Bitmap(25, 25); }
    3738    }
    3839
    39     public ILookupParameter<BoolValue> TerminateParameter {
     40    public ILookupParameter<BoolValue> TerminateParameter
     41    {
    4042      get { return (ILookupParameter<BoolValue>)Parameters["Terminate"]; }
    4143    }
Note: See TracChangeset for help on using the changeset viewer.