Changeset 2818


Ignore:
Timestamp:
02/17/10 05:24:03 (11 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • corrected several bugs in order to get SGA working
Location:
trunk/sources
Files:
1 deleted
63 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/Auxiliary.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Text;
    2524using System.Windows.Forms;
  • trunk/sources/HeuristicLab.Core.Views/3.3/CreateParameterDialog.cs

    r2796 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Data;
    26 using System.Drawing;
    27 using System.Text;
    28 using System.Linq;
    2923using System.Windows.Forms;
    30 using HeuristicLab.PluginInfrastructure;
    31 using HeuristicLab.Core;
    3224
    3325namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.cs

    r2796 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    2823using System.Windows.Forms;
    29 using HeuristicLab.Core;
    3024using HeuristicLab.Common;
    3125using HeuristicLab.MainForm;
  • trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLabCoreViewsPlugin.cs.frame

    r2796 r2818  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs

    r2790 r2818  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Data;
    2624using System.Drawing;
    27 using System.Text;
    2825using System.Windows.Forms;
    2926using HeuristicLab.Collections;
    30 using HeuristicLab.Common;
    3127using HeuristicLab.MainForm;
    3228using HeuristicLab.MainForm.WindowsForms;
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r2790 r2818  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Data;
    26 using System.Drawing;
    27 using System.Text;
    2824using System.Windows.Forms;
    2925using HeuristicLab.Collections;
    30 using HeuristicLab.Common;
    3126using HeuristicLab.MainForm;
    3227using HeuristicLab.MainForm.WindowsForms;
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs

    r2790 r2818  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Data;
    2624using System.Drawing;
    27 using System.Text;
    2825using System.Windows.Forms;
    2926using HeuristicLab.Collections;
    30 using HeuristicLab.Common;
    3127using HeuristicLab.MainForm;
    3228using HeuristicLab.MainForm.WindowsForms;
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemSetView.cs

    r2790 r2818  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Data;
    26 using System.Drawing;
    27 using System.Text;
    2823using System.Windows.Forms;
    2924using HeuristicLab.Collections;
    30 using HeuristicLab.Common;
    3125using HeuristicLab.MainForm;
    3226
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemView.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    28 using System.Xml;
    29 using System.Windows.Forms;
    3023using HeuristicLab.MainForm;
    3124using HeuristicLab.MainForm.WindowsForms;
  • trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemCollectionView.cs

    r2790 r2818  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Data;
    26 using System.Drawing;
    27 using System.Text;
    2823using System.Windows.Forms;
    2924using HeuristicLab.Collections;
    30 using HeuristicLab.Common;
    3125using HeuristicLab.MainForm;
    3226
  • trunk/sources/HeuristicLab.Core.Views/3.3/NamedItemView.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    2824using System.Windows.Forms;
    2925using HeuristicLab.MainForm;
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorCollectionView.cs

    r2727 r2818  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Drawing;
    5 using System.Data;
    6 using System.Linq;
    7 using System.Text;
    8 using System.Windows.Forms;
     1using System.Windows.Forms;
     2using HeuristicLab.Collections;
    93using HeuristicLab.MainForm;
    10 using HeuristicLab.Collections;
    114
    125namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorGraphView.cs

    r2801 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.ComponentModel;
    2524using System.Drawing;
    26 using System.Data;
    27 using System.Linq;
    28 using System.Text;
    2925using System.Windows.Forms;
    30 using HeuristicLab.PluginInfrastructure;
    31 using HeuristicLab.Common;
    3226using HeuristicLab.MainForm;
    33 using HeuristicLab.Collections;
    3427
    3528namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorListView.cs

    r2727 r2818  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Drawing;
    5 using System.Data;
    6 using System.Linq;
    7 using System.Text;
    8 using System.Windows.Forms;
     1using System.Windows.Forms;
     2using HeuristicLab.Collections;
    93using HeuristicLab.MainForm;
    10 using HeuristicLab.Collections;
    114
    125namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorSetView.cs

    r2727 r2818  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Drawing;
    5 using System.Data;
    6 using System.Linq;
    7 using System.Text;
    8 using System.Windows.Forms;
     1using System.Windows.Forms;
     2using HeuristicLab.Collections;
    93using HeuristicLab.MainForm;
    10 using HeuristicLab.Collections;
    114
    125namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs

    r2790 r2818  
    2424using System.ComponentModel;
    2525using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    2826using System.Windows.Forms;
    29 using HeuristicLab.PluginInfrastructure;
    30 using HeuristicLab.Common;
     27using HeuristicLab.Collections;
    3128using HeuristicLab.MainForm;
    32 using HeuristicLab.Collections;
    3329
    3430namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorsSidebar.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    2823using System.Windows.Forms;
    29 using System.Linq;
    30 using HeuristicLab.MainForm;
    31 using HeuristicLab.MainForm.WindowsForms;
    3224
    3325namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs

    r2796 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Linq;
    28 using System.Text;
    2923using System.Windows.Forms;
     24using HeuristicLab.Collections;
    3025using HeuristicLab.MainForm;
    31 using HeuristicLab.Collections;
    3226
    3327namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ScopeListView.cs

    r2727 r2818  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Drawing;
    5 using System.Data;
    6 using System.Linq;
    7 using System.Text;
    8 using System.Windows.Forms;
     1using HeuristicLab.Collections;
    92using HeuristicLab.MainForm;
    10 using HeuristicLab.Collections;
    113
    124namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ScopeView.cs

    r2790 r2818  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    2824using System.Windows.Forms;
    29 using HeuristicLab.PluginInfrastructure;
    30 using HeuristicLab.Common;
     25using HeuristicLab.Collections;
    3126using HeuristicLab.MainForm;
    32 using HeuristicLab.Collections;
    3327
    3428namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelector.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
     23using System.Linq;
    2724using System.Text;
    2825using System.Windows.Forms;
    29 using System.Linq;
    3026using HeuristicLab.Common;
    3127using HeuristicLab.PluginInfrastructure;
    32 using HeuristicLab.MainForm;
    3328
    3429namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/TypeSelectorDialog.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections;
    24 using System.Collections.Generic;
    25 using System.ComponentModel;
    26 using System.Data;
    27 using System.Drawing;
    28 using System.Text;
    2923using System.Windows.Forms;
    30 using HeuristicLab.PluginInfrastructure;
    3124
    3225namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ValueParameterCollectionView.cs

    r2796 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Linq;
    28 using System.Text;
    2923using System.Windows.Forms;
     24using HeuristicLab.Collections;
    3025using HeuristicLab.MainForm;
    31 using HeuristicLab.Collections;
    3226
    3327namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/VariableCollectionView.cs

    r2727 r2818  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Drawing;
    5 using System.Data;
    6 using System.Linq;
    7 using System.Text;
    8 using System.Windows.Forms;
     1using HeuristicLab.Collections;
    92using HeuristicLab.MainForm;
    10 using HeuristicLab.Collections;
    113
    124namespace HeuristicLab.Core.Views {
  • trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    2823using System.Windows.Forms;
     24using HeuristicLab.Common;
    2925using HeuristicLab.MainForm;
    3026
     
    9591      } else {
    9692        Caption = Content.Name + " (" + Content.GetType().Name + ")";
    97         dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType().FullName;
     93        dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType().GetPrettyName();
    9894        dataTypeTextBox.Enabled = Content.Value != null;
    9995        setValueButton.Enabled = Content.Value == null;
     
    108104        Invoke(new EventHandler(Content_ValueChanged), sender, e);
    109105      else {
    110         dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType().FullName;
     106        dataTypeTextBox.Text = Content.Value == null ? "-" : Content.Value.GetType().GetPrettyName();
    111107        dataTypeTextBox.Enabled = Content.Value != null;
    112108        setValueButton.Enabled = Content.Value == null;
  • trunk/sources/HeuristicLab.Core.Views/3.3/ViewHost.cs

    r2817 r2818  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
     24using System.Linq;
    2825using System.Windows.Forms;
    29 using System.Linq;
    3026using HeuristicLab.Common;
    3127using HeuristicLab.MainForm;
  • trunk/sources/HeuristicLab.Core/3.3/Variable.cs

    r2793 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
     23using HeuristicLab.Common;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.Common;
    2825
    2926namespace HeuristicLab.Core {
     
    9188        return string.Format("{0}: null", Name);
    9289      else
    93         return string.Format("{0}: {1} ({2})", Name, Value.ToString(), Value.GetType().Name);
     90        return string.Format("{0}: {1} ({2})", Name, Value.ToString(), Value.GetType().GetPrettyName());
    9491    }
    9592
  • trunk/sources/HeuristicLab.Evolutionary/3.3/ChildrenCreator.cs

    r2794 r2818  
    6868      for (int i = 0; i < children; i++) {
    6969        IScope child = new Scope(i.ToString());
    70         for (int j = 0; j < parents; j++) {
     70        for (int j = 0; j < parentsPerChild; j++) {
    7171          IScope parent = CurrentScope.SubScopes[0];
    7272          CurrentScope.SubScopes.RemoveAt(0);
  • trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj

    r2805 r2818  
    9494    <Compile Include="ParallelSubScopesProcessor.cs" />
    9595    <Compile Include="Placeholder.cs" />
    96     <Compile Include="SingleCallOperator.cs" />
    9796    <Compile Include="IntCounter.cs" />
    9897    <Compile Include="ScopeCleaner.cs" />
  • trunk/sources/HeuristicLab.Operators/3.3/MultipleCallsOperator.cs

    r2796 r2818  
    2929namespace HeuristicLab.Operators {
    3030  /// <summary>
    31   /// An operator which applies multiple operators sequentially on the current scope.
     31  /// A base class for operators which apply multiple user-defined operators.
    3232  /// </summary>
    33   [Item("MultipleCallsOperator", "An operator which applies multiple operators sequentially on the current scope.")]
    34   [Creatable("Test")]
    35   public class MultipleCallsOperator : SingleSuccessorOperator {
     33  [Item("MultipleCallsOperator", "A base class for operators which apply multiple user-defined operators.")]
     34  public abstract class MultipleCallsOperator : SingleSuccessorOperator {
    3635    protected IValueParameter<IOperator>[] OperatorParameters {
    3736      get {
     
    106105      operators[index] = opParam.Value;
    107106    }
    108 
    109     public override IExecutionSequence Apply() {
    110       ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    111       for (int i = Operators.Count - 1; i >= 0; i--)
    112         next.Insert(0, ExecutionContext.CreateContext(Operators[i]));
    113       return next;
    114     }
    115107  }
    116108}
  • trunk/sources/HeuristicLab.Operators/3.3/SubScopesSorter.cs

    r2794 r2818  
    5858    public override IExecutionSequence Apply() {
    5959      descending = DescendingParameter.ActualValue.Value;
    60       actualName = LookupParameter<DoubleData>.TranslateName(ValueParameter.Name, ExecutionContext);
     60      actualName = LookupParameter<ItemArray<DoubleData>>.TranslateName(ValueParameter.Name, ExecutionContext);
    6161      CurrentScope.SubScopes.Sort(SortScopes);
    6262      return base.Apply();
     
    6767      IVariable var2;
    6868      x.Variables.TryGetValue(actualName, out var1);
    69       x.Variables.TryGetValue(actualName, out var2);
     69      y.Variables.TryGetValue(actualName, out var2);
    7070      if ((var1 == null) && (var2 == null))
    7171        return 0;
  • trunk/sources/HeuristicLab.Operators/3.3/UniformParallelSubScopesProcessor.cs

    r2796 r2818  
    3131  [Creatable("Test")]
    3232  [EmptyStorableClass]
    33   public sealed class UniformParallelSubScopesProcessor : SingleCallOperator {
     33  public sealed class UniformParallelSubScopesProcessor : SingleSuccessorOperator {
     34    private OperatorParameter OperatorParameter {
     35      get { return (OperatorParameter)Parameters["Operator"]; }
     36    }
     37    public IOperator Operator {
     38      get { return OperatorParameter.Value; }
     39      set { OperatorParameter.Value = value; }
     40    }
     41
    3442    public UniformParallelSubScopesProcessor()
    3543      : base() {
    36       Parameters.Remove("Operator");
    3744      Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied on all sub-scopes of the current scope in parallel."));
    3845    }
  • trunk/sources/HeuristicLab.Operators/3.3/UniformSequentialSubScopesProcessor.cs

    r2796 r2818  
    3131  [Creatable("Test")]
    3232  [EmptyStorableClass]
    33   public sealed class UniformSequentialSubScopesProcessor : SingleCallOperator {
     33  public sealed class UniformSequentialSubScopesProcessor : SingleSuccessorOperator {
     34    private OperatorParameter OperatorParameter {
     35      get { return (OperatorParameter)Parameters["Operator"]; }
     36    }
     37    public IOperator Operator {
     38      get { return OperatorParameter.Value; }
     39      set { OperatorParameter.Value = value; }
     40    }
     41
    3442    public UniformSequentialSubScopesProcessor()
    3543      : base() {
    36       Parameters.Remove("Operator");
    3744      Parameters.Add(new OperatorParameter("Operator", "The operator which should be applied sequentially on all sub-scopes of the current scope."));
    3845    }
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/HeuristicLab.Parameters.Views-3.3.csproj

    r2803 r2818  
    105105      <Name>HeuristicLab.Common.Resources-3.2</Name>
    106106    </ProjectReference>
     107    <ProjectReference Include="..\..\HeuristicLab.Common\3.2\HeuristicLab.Common-3.2.csproj">
     108      <Project>{1FC004FC-59AF-4249-B1B6-FF25873A20E4}</Project>
     109      <Name>HeuristicLab.Common-3.2</Name>
     110    </ProjectReference>
    107111    <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
    108112      <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/HeuristicLabParametersViewsPlugin.cs.frame

    r2790 r2818  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
     
    3128  [Plugin("HeuristicLab.Parameters.Views", "3.3.0.$WCREV$")]
    3229  [PluginFile("HeuristicLab.Parameters.Views-3.3.dll", PluginFileType.Assembly)]
     30  [PluginDependency("HeuristicLab.Common", "3.2")]
    3331  [PluginDependency("HeuristicLab.Common.Resources", "3.2")]
    3432  [PluginDependency("HeuristicLab.Core", "3.3")]
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/LookupParameterView.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    28 using System.Windows.Forms;
    2923using HeuristicLab.Core;
    3024using HeuristicLab.Core.Views;
     
    3630  /// </summary>
    3731  [Content(typeof(LookupParameter<>), true)]
    38   [Content(typeof(SubScopesLookupParameter<>), true)]
    3932  [Content(typeof(ILookupParameter<>), false)]
    4033  public partial class LookupParameterView<T> : ParameterView where T : class, IItem {
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ParameterView.cs

    r2790 r2818  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    28 using System.Windows.Forms;
     22using HeuristicLab.Common;
    2923using HeuristicLab.Core;
    3024using HeuristicLab.Core.Views;
     
    7367      } else {
    7468        Caption = Content.Name + " (" + Content.GetType().Name + ")";
    75         dataTypeTextBox.Text = Content.DataType.Name;
     69        dataTypeTextBox.Text = Content.DataType.GetPrettyName();
    7670        dataTypeTextBox.Enabled = true;
    7771      }
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    2823using System.Windows.Forms;
    2924using HeuristicLab.Core;
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.ComponentModel;
    25 using System.Drawing;
    26 using System.Data;
    27 using System.Text;
    2823using System.Windows.Forms;
    2924using HeuristicLab.Core;
  • trunk/sources/HeuristicLab.Parameters/3.3/HeuristicLabParametersPlugin.cs.frame

    r2790 r2818  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
  • trunk/sources/HeuristicLab.Parameters/3.3/LookupParameter.cs

    r2805 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2623using HeuristicLab.Common;
    2724using HeuristicLab.Core;
     
    7168
    7269    public override string ToString() {
    73       return string.Format("{0}: {1} ({2})", Name, ActualName, DataType.Name);
    74     }
    75 
    76     private IValueParameter<T> GetParameter(out string name) {
    77       IValueParameter<T> valueParam = this as IValueParameter<T>;
    78       ILookupParameter<T> lookupParam = this as ILookupParameter<T>;
     70      return string.Format("{0}: {1} ({2})", Name, ActualName, DataType.GetPrettyName());
     71    }
     72
     73    private IValueParameter GetParameter(out string name) {
     74      IValueParameter valueParam = this as IValueParameter;
     75      ILookupParameter lookupParam = this as ILookupParameter;
    7976      ExecutionContext current = ExecutionContext;
    8077
    8178      name = Name;
    82       while ((valueParam != null) && (lookupParam != null)) {
     79      while ((valueParam != null) || (lookupParam != null)) {
    8380        if ((valueParam != null) && (valueParam.Value != null)) return valueParam;
    8481        if (lookupParam != null) name = lookupParam.ActualName;
     
    8986
    9087        if (current != null) {
    91           valueParam = current.Operator.Parameters[name] as IValueParameter<T>;
    92           lookupParam = current.Operator.Parameters[name] as ILookupParameter<T>;
     88          valueParam = current.Operator.Parameters[name] as IValueParameter;
     89          lookupParam = current.Operator.Parameters[name] as ILookupParameter;
    9390          if ((valueParam == null) && (lookupParam == null))
    9491            throw new InvalidOperationException(
    9592              string.Format("Parameter look-up chain broken. Parameter \"{0}\" is not an \"{1}\" or an \"{2}\".",
    9693                            name,
    97                             typeof(IValueParameter<T>).GetPrettyName(),
    98                             typeof(ILookupParameter<T>).GetPrettyName())
     94                            typeof(IValueParameter).GetPrettyName(),
     95                            typeof(ILookupParameter).GetPrettyName())
    9996            );
    10097        } else {
     
    111108      return scope != null ? scope.Variables[actualName] : null;
    112109    }
    113     private IValueParameter<T> GetProblemParameter(string name) {
    114       IValueParameter<T> param = null;
     110    private IValueParameter GetProblemParameter(string name) {
     111      IValueParameter param = null;
    115112      if (ExecutionContext.Problem.Parameters.ContainsKey(name)) {
    116         param = ExecutionContext.Problem.Parameters[name] as IValueParameter<T>;
     113        param = ExecutionContext.Problem.Parameters[name] as IValueParameter;
    117114        if (param == null)
    118115          throw new InvalidOperationException(
    119116            string.Format("Parameter look-up chain broken. Parameter \"{0}\" is not an \"{1}\".",
    120117                          name,
    121                           typeof(IValueParameter<T>).GetPrettyName())
     118                          typeof(IValueParameter).GetPrettyName())
    122119          );
    123120      }
     
    127124      string name;
    128125      // try to get value from context stack
    129       IValueParameter<T> param = GetParameter(out name);
     126      IValueParameter param = GetParameter(out name);
    130127      if (param != null) return param.Value;
    131128
     
    144141
    145142      // try to get value from problem
    146       IValueParameter<T> problemParam = GetProblemParameter(name);
     143      IValueParameter problemParam = GetProblemParameter(name);
    147144      if (problemParam != null) return problemParam.Value;
    148145
     
    158155      // try to set value in context stack
    159156      string name;
    160       IValueParameter<T> param = GetParameter(out name);
     157      IValueParameter param = GetParameter(out name);
    161158      if (param != null) {
    162159        param.Value = val;
     
    172169
    173170      // try to set value in problem
    174       IValueParameter<T> problemParam = GetProblemParameter(name);
     171      IValueParameter problemParam = GetProblemParameter(name);
    175172      if (problemParam != null) {
    176173        problemParam.Value = val;
     
    193190      ExecutionContext currentContext = context;
    194191      IParameter param;
    195       ILookupParameter<T> lookupParam;
     192      ILookupParameter lookupParam;
    196193
    197194      while (currentContext != null) {
    198195        currentContext.Operator.Parameters.TryGetValue(currentName, out param);
    199196        if (param != null) {
    200           lookupParam = param as ILookupParameter<T>;
     197          lookupParam = param as ILookupParameter;
    201198          if (lookupParam == null)
    202199            throw new InvalidOperationException(
    203200              string.Format("Parameter look-up chain broken. Parameter \"{0}\" is not an \"{1}\".",
    204201                            currentName,
    205                             typeof(ILookupParameter<T>).GetPrettyName())
     202                            typeof(ILookupParameter).GetPrettyName())
    206203            );
    207204          currentName = lookupParam.ActualName;
  • trunk/sources/HeuristicLab.Parameters/3.3/OperatorParameter.cs

    r2790 r2818  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
  • trunk/sources/HeuristicLab.Parameters/3.3/Parameter.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
     23using HeuristicLab.Common;
    2624using HeuristicLab.Core;
    2725using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    8482
    8583    public override string ToString() {
    86       return string.Format("{0} ({1})", Name, DataType.Name);
     84      return string.Format("{0} ({1})", Name, DataType.GetPrettyName());
    8785    }
    8886
  • trunk/sources/HeuristicLab.Parameters/3.3/ScopeParameter.cs

    r2790 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
     23using HeuristicLab.Common;
    2624using HeuristicLab.Core;
    2725using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    5048
    5149    public override string ToString() {
    52       return string.Format("{0} ({1})", Name, DataType.Name);
     50      return string.Format("{0} ({1})", Name, DataType.GetPrettyName());
    5351    }
    5452
  • trunk/sources/HeuristicLab.Parameters/3.3/SubScopesLookupParameter.cs

    r2796 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2623using HeuristicLab.Common;
    2724using HeuristicLab.Core;
    28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2925
    3026namespace HeuristicLab.Parameters {
     
    3935
    4036    protected override IItem GetActualValue() {
    41       string name = LookupParameter<T>.TranslateName(Name, ExecutionContext);
     37      string name = LookupParameter<ItemArray<T>>.TranslateName(Name, ExecutionContext);
    4238      IScope scope = ExecutionContext.Scope;
    4339      ItemArray<T> values = new ItemArray<T>(scope.SubScopes.Count);
     
    6864        );
    6965
    70       string name = LookupParameter<T>.TranslateName(Name, ExecutionContext);
     66      string name = LookupParameter<ItemArray<T>>.TranslateName(Name, ExecutionContext);
    7167      IScope scope = ExecutionContext.Scope;
    7268      IVariable var;
  • trunk/sources/HeuristicLab.Parameters/3.3/ValueLookupParameter.cs

    r2796 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2623using HeuristicLab.Common;
    2724using HeuristicLab.Core;
     
    8582
    8683    public override string ToString() {
    87       return string.Format("{0}: {1} ({2})", Name, Value != null ? Value.ToString() : ActualName, DataType.Name);
     84      return string.Format("{0}: {1} ({2})", Name, Value != null ? Value.ToString() : ActualName, DataType.GetPrettyName());
    8885    }
    8986
  • trunk/sources/HeuristicLab.Parameters/3.3/ValueParameter.cs

    r2796 r2818  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2623using HeuristicLab.Common;
    2724using HeuristicLab.Core;
     
    8582
    8683    public override string ToString() {
    87       return string.Format("{0}: {1} ({2})", Name, Value != null ? Value.ToString() : "null", DataType.Name);
     84      return string.Format("{0}: {1} ({2})", Name, Value != null ? Value.ToString() : "null", DataType.GetPrettyName());
    8885    }
    8986
  • trunk/sources/HeuristicLab.Random/3.3/RandomCreator.cs

    r2794 r2818  
    6060
    6161    public override IExecutionSequence Apply() {
    62       bool setSeedRandomly = SetSeedRandomlyParameter.ActualValue == null ? true : SetSeedRandomlyParameter.ActualValue.Value;
     62      if (SetSeedRandomlyParameter.ActualValue == null) SetSeedRandomlyParameter.ActualValue = new BoolData(true);
     63      bool setSeedRandomly = SetSeedRandomlyParameter.ActualValue.Value;
     64      if (SeedParameter.ActualValue == null) SeedParameter.ActualValue = new IntData(0);
    6365      IntData seed = SeedParameter.ActualValue;
    64       IRandom random = RandomParameter.ActualValue;
    6566
    66       if (seed == null) seed = new IntData(0);
    6767      if (setSeedRandomly) seed.Value = new System.Random().Next();
    6868      RandomParameter.ActualValue = new MersenneTwister((uint)seed.Value);
  • trunk/sources/HeuristicLab.Selection/3.3/HeuristicLabSelectionPlugin.cs.frame

    r2805 r2818  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
  • trunk/sources/HeuristicLab.Selection/3.3/LeftReducer.cs

    r2817 r2818  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    25 using HeuristicLab.Parameters;
    2623using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2724
  • trunk/sources/HeuristicLab.Selection/3.3/LeftSelector.cs

    r2817 r2818  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    25 using HeuristicLab.Parameters;
    2623using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2724
  • trunk/sources/HeuristicLab.Selection/3.3/LinearRankSelector.cs

    r2817 r2818  
    2121
    2222using System.Linq;
    23 using System.Collections.Generic;
    2423using HeuristicLab.Core;
    2524using HeuristicLab.Data;
    26 using HeuristicLab.Parameters;
    2725using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2826
     
    5452      else
    5553        temp = temp.OrderByDescending(x => x.Value);
    56       var list = temp.Select((x, lots) => new { x.index, lots }).ToList();
     54      var list = temp.Select((x, index) => new { x.index, lots = index + 1 }).ToList();
    5755
    5856      int lotSum = list.Count * (list.Count + 1) / 2;
  • trunk/sources/HeuristicLab.Selection/3.3/MergingReducer.cs

    r2817 r2818  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    25 using HeuristicLab.Parameters;
    2623using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2724
  • trunk/sources/HeuristicLab.Selection/3.3/ProportionalSelector.cs

    r2817 r2818  
    2020#endregion
    2121
     22using System;
     23using System.Collections.Generic;
    2224using System.Linq;
    23 using System.Collections.Generic;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
    2627using HeuristicLab.Parameters;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    28 using System;
    2929
    3030namespace HeuristicLab.Selection {
     
    5656      IRandom random = RandomParameter.ActualValue;
    5757      bool maximization = MaximizationParameter.ActualValue.Value;
    58       List<DoubleData> qualities = new List<DoubleData>(QualityParameter.ActualValue);
    5958      bool windowing = WindowingParameter.Value.Value;
    6059      ScopeList selected = new ScopeList();
    6160
    6261      // prepare qualities for proportional selection
    63       double minQuality = qualities.Min(x => x.Value);
    64       double maxQuality = qualities.Max(x => x.Value);
     62      var qualities = QualityParameter.ActualValue.Select(x => x.Value);
     63      double minQuality = qualities.Min();
     64      double maxQuality = qualities.Max();
    6565      if (minQuality == maxQuality) {  // all quality values are equal
    66         qualities.ForEach(x => x.Value = 1);
     66        qualities = qualities.Select(x => 1.0);
    6767      } else {
    6868        if (windowing) {
    6969          if (maximization)
    70             qualities.ForEach(x => x.Value = x.Value - minQuality);
     70            qualities = qualities.Select(x => x - minQuality);
    7171          else
    72             qualities.ForEach(x => x.Value = maxQuality - x.Value);
     72            qualities = qualities.Select(x => maxQuality - x);
    7373        } else {
    7474          if (minQuality < 0.0) throw new InvalidOperationException("Proportional selection without windowing does not work with quality values < 0.");
    7575          if (!maximization) {
    7676            double limit = Math.Min(maxQuality * 2, double.MaxValue);
    77             qualities.ForEach(x => x.Value = limit - x.Value);
     77            qualities = qualities.Select(x => limit - x);
    7878          }
    7979        }
    8080      }
    8181
    82       double qualitySum = qualities.Sum(x => x.Value);
     82      List<double> list = qualities.ToList();
     83      double qualitySum = qualities.Sum();
    8384      for (int i = 0; i < count; i++) {
    8485        double selectedQuality = random.NextDouble() * qualitySum;
    8586        int index = 0;
    86         double currentQuality = qualities[index].Value;
     87        double currentQuality = list[index];
    8788        while (currentQuality < selectedQuality) {
    8889          index++;
    89           currentQuality += qualities[index].Value;
     90          currentQuality += list[index];
    9091        }
    9192        if (copy)
     
    9495          selected.Add(scopes[index]);
    9596          scopes.RemoveAt(index);
    96           qualitySum -= qualities[index].Value;
    97           qualities.RemoveAt(index);
     97          qualitySum -= list[index];
     98          list.RemoveAt(index);
    9899        }
    99100      }
  • trunk/sources/HeuristicLab.Selection/3.3/RandomSelector.cs

    r2817 r2818  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    25 using HeuristicLab.Parameters;
    2623using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2724
  • trunk/sources/HeuristicLab.Selection/3.3/Reducer.cs

    r2817 r2818  
    2020#endregion
    2121
    22 using System;
    2322using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2523using HeuristicLab.Operators;
    2624using HeuristicLab.Parameters;
  • trunk/sources/HeuristicLab.Selection/3.3/RightReducer.cs

    r2817 r2818  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    25 using HeuristicLab.Parameters;
    2623using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2724
  • trunk/sources/HeuristicLab.Selection/3.3/RightSelector.cs

    r2817 r2818  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    25 using HeuristicLab.Parameters;
    2623using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2724
  • trunk/sources/HeuristicLab.Selection/3.3/Selector.cs

    r2817 r2818  
    2020#endregion
    2121
    22 using System;
    2322using HeuristicLab.Core;
    2423using HeuristicLab.Data;
  • trunk/sources/HeuristicLab.Selection/3.3/StochasticSelector.cs

    r2805 r2818  
    2121
    2222using HeuristicLab.Core;
    23 using HeuristicLab.Data;
    24 using HeuristicLab.Operators;
    2523using HeuristicLab.Parameters;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
  • trunk/sources/HeuristicLab.Selection/3.3/StochasticSingleObjectiveSelector.cs

    r2805 r2818  
    2222using HeuristicLab.Core;
    2323using HeuristicLab.Data;
    24 using HeuristicLab.Operators;
    2524using HeuristicLab.Parameters;
    2625using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
  • trunk/sources/HeuristicLab.Selection/3.3/TournamentSelector.cs

    r2817 r2818  
    2121
    2222using System.Collections.Generic;
     23using System.Linq;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    4849      IRandom random = RandomParameter.ActualValue;
    4950      bool maximization = MaximizationParameter.ActualValue.Value;
    50       List<DoubleData> qualities = new List<DoubleData>(QualityParameter.ActualValue);
     51      List<double> qualities = QualityParameter.ActualValue.Select(x => x.Value).ToList();
    5152      int groupSize = GroupSizeParameter.ActualValue.Value;
    5253      ScopeList selected = new ScopeList();
     
    5758        for (int j = 1; j < groupSize; j++) {
    5859          index = random.Next(scopes.Count);
    59           if (((maximization) && (qualities[index].Value > qualities[best].Value)) ||
    60               ((!maximization) && (qualities[index].Value < qualities[best].Value))) {
     60          if (((maximization) && (qualities[index] > qualities[best])) ||
     61              ((!maximization) && (qualities[index] < qualities[best]))) {
    6162            best = index;
    6263          }
  • trunk/sources/HeuristicLab.SequentialEngine/3.3/SequentialEngine.cs

    r2790 r2818  
    6262        for (int i = coll.Count - 1; i >= 0; i--)
    6363          ExecutionStack.Push(coll[i]);
    64         next = ExecutionStack.Pop();
     64        next = ExecutionStack.Count > 0 ? ExecutionStack.Pop() : null;
    6565        coll = next as ExecutionContextCollection;
    6666      }
    6767      ExecutionContext context = next as ExecutionContext;
    68       try {
    69         currentOperator = context.Operator;
    70         ExecutionStack.Push(context.Operator.Execute(context));
    71         currentOperator = null;
     68      if (context != null) {
     69        try {
     70          currentOperator = context.Operator;
     71          ExecutionStack.Push(context.Operator.Execute(context));
     72          currentOperator = null;
     73        }
     74        catch (Exception ex) {
     75          ExecutionStack.Push(context);
     76          Stop();
     77          OnExceptionOccurred(ex);
     78        }
     79        if (context.Operator.Breakpoint)
     80          Stop();
    7281      }
    73       catch (Exception ex) {
    74         ExecutionStack.Push(context);
    75         Stop();
    76         OnExceptionOccurred(ex);
    77       }
    78       if (context.Operator.Breakpoint)
    79         Stop();
    8082    }
    8183  }
Note: See TracChangeset for help on using the changeset viewer.