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

Legend:

Unmodified
Added
Removed
  • branches/WebJobManager/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r13238 r13656  
    101101    [Storable]
    102102    private IAlgorithm algorithm;
    103     public IAlgorithm Algorithm {
     103    public IAlgorithm Algorithm
     104    {
    104105      get { return algorithm; }
    105       set {
     106      set
     107      {
    106108        if (ExecutionState != ExecutionState.Prepared && ExecutionState != ExecutionState.Stopped)
    107109          throw new InvalidOperationException("Changing the algorithm is only allowed if the CrossValidation is stopped or prepared.");
     
    128130    [Storable]
    129131    private IDataAnalysisProblem problem;
    130     public IDataAnalysisProblem Problem {
    131       get {
     132    public IDataAnalysisProblem Problem
     133    {
     134      get
     135      {
    132136        if (algorithm == null)
    133137          return null;
    134138        return (IDataAnalysisProblem)algorithm.Problem;
    135139      }
    136       set {
     140      set
     141      {
    137142        if (ExecutionState != ExecutionState.Prepared && ExecutionState != ExecutionState.Stopped)
    138143          throw new InvalidOperationException("Changing the problem is only allowed if the CrossValidation is stopped or prepared.");
     
    143148    }
    144149
    145     IProblem IAlgorithm.Problem {
     150    IProblem IAlgorithm.Problem
     151    {
    146152      get { return Problem; }
    147       set {
     153      set
     154      {
    148155        if (value != null && !ProblemType.IsInstanceOfType(value))
    149156          throw new ArgumentException("Only DataAnalysisProblems could be used for the cross validation.");
     
    151158      }
    152159    }
    153     public Type ProblemType {
     160    public Type ProblemType
     161    {
    154162      get { return typeof(IDataAnalysisProblem); }
    155163    }
     
    158166    private ItemCollection<IAlgorithm> clonedAlgorithms;
    159167
    160     public IEnumerable<IOptimizer> NestedOptimizers {
    161       get {
     168    public IEnumerable<IOptimizer> NestedOptimizers
     169    {
     170      get
     171      {
    162172        if (Algorithm == null) yield break;
    163173        yield return Algorithm;
     
    167177    [Storable]
    168178    private ResultCollection results;
    169     public ResultCollection Results {
     179    public ResultCollection Results
     180    {
    170181      get { return results; }
    171182    }
     
    173184    [Storable]
    174185    private IntValue folds;
    175     public IntValue Folds {
     186    public IntValue Folds
     187    {
    176188      get { return folds; }
    177189    }
    178190    [Storable]
    179191    private IntValue samplesStart;
    180     public IntValue SamplesStart {
     192    public IntValue SamplesStart
     193    {
    181194      get { return samplesStart; }
    182195    }
    183196    [Storable]
    184197    private IntValue samplesEnd;
    185     public IntValue SamplesEnd {
     198    public IntValue SamplesEnd
     199    {
    186200      get { return samplesEnd; }
    187201    }
    188202    [Storable]
    189203    private IntValue numberOfWorkers;
    190     public IntValue NumberOfWorkers {
     204    public IntValue NumberOfWorkers
     205    {
    191206      get { return numberOfWorkers; }
    192207    }
     
    194209    [Storable]
    195210    private bool storeAlgorithmInEachRun;
    196     public bool StoreAlgorithmInEachRun {
     211    public bool StoreAlgorithmInEachRun
     212    {
    197213      get { return storeAlgorithmInEachRun; }
    198       set {
     214      set
     215      {
    199216        if (storeAlgorithmInEachRun != value) {
    200217          storeAlgorithmInEachRun = value;
     
    208225    [Storable]
    209226    private RunCollection runs;
    210     public RunCollection Runs {
     227    public RunCollection Runs
     228    {
    211229      get { return runs; }
    212230    }
     
    214232    [Storable]
    215233    private ExecutionState executionState;
    216     public ExecutionState ExecutionState {
     234    public ExecutionState ExecutionState
     235    {
    217236      get { return executionState; }
    218       private set {
     237      private set
     238      {
    219239        if (executionState != value) {
    220240          executionState = value;
     
    224244      }
    225245    }
    226     public static new Image StaticItemImage {
    227       get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
    228     }
    229     public override Image ItemImage {
    230       get {
     246
     247    public override Image ItemImage
     248    {
     249      get
     250      {
    231251        if (ExecutionState == ExecutionState.Prepared) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
    232252        else if (ExecutionState == ExecutionState.Started) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
     
    237257    }
    238258
    239     public TimeSpan ExecutionTime {
    240       get {
     259    public TimeSpan ExecutionTime
     260    {
     261      get
     262      {
    241263        if (ExecutionState != ExecutionState.Prepared)
    242264          return TimeSpan.FromMilliseconds(clonedAlgorithms.Select(x => x.ExecutionTime.TotalMilliseconds).Sum());
     
    589611    private void Algorithm_ExecutionStateChanged(object sender, EventArgs e) {
    590612      switch (Algorithm.ExecutionState) {
    591         case ExecutionState.Prepared: OnPrepared();
     613        case ExecutionState.Prepared:
     614          OnPrepared();
    592615          break;
    593616        case ExecutionState.Started: throw new InvalidOperationException("Algorithm template can not be started.");
    594617        case ExecutionState.Paused: throw new InvalidOperationException("Algorithm template can not be paused.");
    595         case ExecutionState.Stopped: OnStopped();
     618        case ExecutionState.Stopped:
     619          OnStopped();
    596620          break;
    597621      }
  • branches/WebJobManager/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringModel.cs

    r12509 r13656  
    2121
    2222using System.Collections.Generic;
    23 using System.Drawing;
    2423using System.Linq;
    2524using HeuristicLab.Common;
     
    3534  [Item("KMeansClusteringModel", "Represents a k-Means clustering model.")]
    3635  public sealed class KMeansClusteringModel : NamedItem, IClusteringModel {
    37     public static new Image StaticItemImage {
    38       get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
    39     }
     36
    4037
    4138    [Storable]
    4239    private string[] allowedInputVariables;
    43     public IEnumerable<string> AllowedInputVariables {
     40    public IEnumerable<string> AllowedInputVariables
     41    {
    4442      get { return allowedInputVariables; }
    4543    }
    4644    [Storable]
    4745    private List<double[]> centers;
    48     public IEnumerable<double[]> Centers {
    49       get {
     46    public IEnumerable<double[]> Centers
     47    {
     48      get
     49      {
    5050        return centers.Select(x => (double[])x.Clone());
    5151      }
Note: See TracChangeset for help on using the changeset viewer.