Changeset 2796


Ignore:
Timestamp:
02/15/10 05:26:02 (11 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on operators, parameters and problems
Location:
trunk/sources
Files:
15 added
55 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab 3.3.sln

    r2790 r2796  
    7575    {958B43BC-CC5C-4FA2-8628-2B3B01D890B6} = {958B43BC-CC5C-4FA2-8628-2B3B01D890B6}
    7676    {AB687BBE-1BFE-476B-906D-44237135431D} = {AB687BBE-1BFE-476B-906D-44237135431D}
     77    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C} = {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}
    7778    {102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B} = {102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}
    7879    {EE2034D9-6E27-48A1-B855-42D45F69A4FC} = {EE2034D9-6E27-48A1-B855-42D45F69A4FC}
     
    133134EndProject
    134135Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Netron-3.0.2672.12446", "HeuristicLab.ExtLibs\HeuristicLab.Netron\3.0.2672.12446\HeuristicLab.Netron-3.0.2672.12446\HeuristicLab.Netron-3.0.2672.12446.csproj", "{BB994448-2B21-4564-BB2E-38D8FFF8CF18}"
     136EndProject
     137Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Routing.TSP.Views-3.3", "HeuristicLab.Routing.TSP.Views\3.3\HeuristicLab.Routing.TSP.Views-3.3.csproj", "{DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}"
    135138EndProject
    136139Global
     
    578581    {BB994448-2B21-4564-BB2E-38D8FFF8CF18}.Release|x64.ActiveCfg = Release|Any CPU
    579582    {BB994448-2B21-4564-BB2E-38D8FFF8CF18}.Release|x86.ActiveCfg = Release|Any CPU
     583    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     584    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
     585    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Debug|x64.ActiveCfg = Debug|Any CPU
     586    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Debug|x86.ActiveCfg = Debug|Any CPU
     587    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
     588    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Release|Any CPU.Build.0 = Release|Any CPU
     589    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Release|x64.ActiveCfg = Release|Any CPU
     590    {DF2E61C4-A76D-4315-9D0B-53A077B1AC2C}.Release|x86.ActiveCfg = Release|Any CPU
    580591  EndGlobalSection
    581592  GlobalSection(SolutionProperties) = preSolution
  • trunk/sources/HeuristicLab 3.3/Files.txt

    r2772 r2796  
    2929HeuristicLab.Random\3.3:HeuristicLab.Random-3.3.dll
    3030HeuristicLab.Routing.TSP\3.3:HeuristicLab.Routing.TSP-3.3.dll
     31HeuristicLab.Routing.TSP.Views\3.3:HeuristicLab.Routing.TSP.Views-3.3.dll
    3132HeuristicLab.Selection\3.3:HeuristicLab.Selection-3.3.dll
    3233HeuristicLab.Selection.OffspringSelection\3.3:HeuristicLab.Selection.OffspringSelection-3.3.dll
  • trunk/sources/HeuristicLab.Core.Views/3.3/CreateParameterDialog.Designer.cs

    r2790 r2796  
    120120      this.descriptionTextBox.Name = "descriptionTextBox";
    121121      this.descriptionTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    122       this.descriptionTextBox.Size = new System.Drawing.Size(452, 103);
     122      this.descriptionTextBox.Size = new System.Drawing.Size(452, 102);
    123123      this.descriptionTextBox.TabIndex = 4;
    124124      //
     
    127127      this.dataTypeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    128128      this.dataTypeLabel.AutoSize = true;
    129       this.dataTypeLabel.Location = new System.Drawing.Point(9, 426);
     129      this.dataTypeLabel.Location = new System.Drawing.Point(12, 425);
    130130      this.dataTypeLabel.Name = "dataTypeLabel";
    131131      this.dataTypeLabel.Size = new System.Drawing.Size(60, 13);
     
    138138                  | System.Windows.Forms.AnchorStyles.Right)));
    139139      this.dataTypeTextBox.Enabled = false;
    140       this.dataTypeTextBox.Location = new System.Drawing.Point(78, 423);
     140      this.dataTypeTextBox.Location = new System.Drawing.Point(78, 422);
    141141      this.dataTypeTextBox.Name = "dataTypeTextBox";
    142142      this.dataTypeTextBox.ReadOnly = true;
    143       this.dataTypeTextBox.Size = new System.Drawing.Size(423, 20);
     143      this.dataTypeTextBox.Size = new System.Drawing.Size(422, 20);
    144144      this.dataTypeTextBox.TabIndex = 6;
    145145      //
     
    149149      this.setDataTypeButton.Enabled = false;
    150150      this.setDataTypeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Add;
    151       this.setDataTypeButton.Location = new System.Drawing.Point(507, 421);
     151      this.setDataTypeButton.Location = new System.Drawing.Point(506, 420);
    152152      this.setDataTypeButton.Name = "setDataTypeButton";
    153       this.setDataTypeButton.Size = new System.Drawing.Size(23, 23);
     153      this.setDataTypeButton.Size = new System.Drawing.Size(24, 24);
    154154      this.setDataTypeButton.TabIndex = 7;
    155155      this.toolTip.SetToolTip(this.setDataTypeButton, "Set Data Type");
     
    193193      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
    194194      this.Text = "Create Parameter";
    195       this.Load += new System.EventHandler(this.CreateParameterDialog_Load);
    196195      this.ResumeLayout(false);
    197196      this.PerformLayout();
  • trunk/sources/HeuristicLab.Core.Views/3.3/CreateParameterDialog.cs

    r2790 r2796  
    3535    protected TypeSelectorDialog typeSelectorDialog;
    3636
     37    public TypeSelector ParameterTypeSelector {
     38      get { return parameterTypeSelector; }
     39    }
    3740    public IParameter Parameter {
    3841      get {
     
    5659    public CreateParameterDialog() {
    5760      InitializeComponent();
     61      parameterTypeSelector.Configure(typeof(IParameter), false, true);
    5862    }
    5963
     
    7074      }
    7175      okButton.Enabled = dataTypeTextBox.Tag != null;
    72     }
    73 
    74     protected virtual void CreateParameterDialog_Load(object sender, EventArgs e) {
    75       parameterTypeSelector.Configure(typeof(IParameter), false, true);
    7676    }
    7777
  • trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.Designer.cs

    r2790 r2796  
    3333    protected override void Dispose(bool disposing) {
    3434      if (disposing) {
     35        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
    3536        if (components != null) components.Dispose();
    3637      }
     
    5455      this.startButton = new System.Windows.Forms.Button();
    5556      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     57      this.newProblemButton = new System.Windows.Forms.Button();
     58      this.openProblemButton = new System.Windows.Forms.Button();
     59      this.saveProblemButton = new System.Windows.Forms.Button();
     60      this.newOperatorGraphButton = new System.Windows.Forms.Button();
     61      this.openOperatorGraphButton = new System.Windows.Forms.Button();
     62      this.saveOperatorGraphButton = new System.Windows.Forms.Button();
    5663      this.tabControl = new System.Windows.Forms.TabControl();
    5764      this.operatorGraphTabPage = new System.Windows.Forms.TabPage();
    5865      this.globalScopeTabPage = new System.Windows.Forms.TabPage();
     66      this.problemTabPage = new System.Windows.Forms.TabPage();
     67      this.problemViewHost = new HeuristicLab.Core.Views.ViewHost();
     68      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
     69      this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
    5970      this.tabControl.SuspendLayout();
    6071      this.operatorGraphTabPage.SuspendLayout();
    6172      this.globalScopeTabPage.SuspendLayout();
     73      this.problemTabPage.SuspendLayout();
    6274      this.SuspendLayout();
    6375      //
     
    8799                  | System.Windows.Forms.AnchorStyles.Right)));
    88100      this.operatorGraphView.Caption = "Operator Graph";
    89       this.operatorGraphView.Location = new System.Drawing.Point(6, 6);
     101      this.operatorGraphView.Content = null;
     102      this.operatorGraphView.Location = new System.Drawing.Point(6, 36);
    90103      this.operatorGraphView.Name = "operatorGraphView";
    91       this.operatorGraphView.Size = new System.Drawing.Size(782, 573);
    92       this.operatorGraphView.TabIndex = 0;
     104      this.operatorGraphView.Size = new System.Drawing.Size(782, 542);
     105      this.operatorGraphView.TabIndex = 3;
    93106      //
    94107      // scopeView
     
    98111                  | System.Windows.Forms.AnchorStyles.Right)));
    99112      this.scopeView.Caption = "Scope";
     113      this.scopeView.Content = null;
    100114      this.scopeView.Location = new System.Drawing.Point(6, 6);
    101115      this.scopeView.Name = "scopeView";
    102       this.scopeView.Size = new System.Drawing.Size(782, 573);
     116      this.scopeView.Size = new System.Drawing.Size(782, 572);
    103117      this.scopeView.TabIndex = 0;
    104118      //
     
    107121      this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    108122      this.resetButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Restart;
    109       this.resetButton.Location = new System.Drawing.Point(58, 617);
     123      this.resetButton.Location = new System.Drawing.Point(60, 616);
    110124      this.resetButton.Name = "resetButton";
    111       this.resetButton.Size = new System.Drawing.Size(23, 23);
     125      this.resetButton.Size = new System.Drawing.Size(24, 24);
    112126      this.resetButton.TabIndex = 3;
    113127      this.toolTip.SetToolTip(this.resetButton, "Reset Engine");
     
    120134      this.stopButton.Enabled = false;
    121135      this.stopButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Stop;
    122       this.stopButton.Location = new System.Drawing.Point(29, 617);
     136      this.stopButton.Location = new System.Drawing.Point(30, 616);
    123137      this.stopButton.Name = "stopButton";
    124       this.stopButton.Size = new System.Drawing.Size(23, 23);
     138      this.stopButton.Size = new System.Drawing.Size(24, 24);
    125139      this.stopButton.TabIndex = 2;
    126140      this.toolTip.SetToolTip(this.stopButton, "Stop Engine");
     
    132146      this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    133147      this.startButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Play;
    134       this.startButton.Location = new System.Drawing.Point(0, 617);
     148      this.startButton.Location = new System.Drawing.Point(0, 616);
    135149      this.startButton.Name = "startButton";
    136       this.startButton.Size = new System.Drawing.Size(23, 23);
     150      this.startButton.Size = new System.Drawing.Size(24, 24);
    137151      this.startButton.TabIndex = 1;
    138152      this.toolTip.SetToolTip(this.startButton, "Start Engine");
    139153      this.startButton.UseVisualStyleBackColor = true;
    140154      this.startButton.Click += new System.EventHandler(this.startButton_Click);
     155      //
     156      // newProblemButton
     157      //
     158      this.newProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument;
     159      this.newProblemButton.Location = new System.Drawing.Point(6, 6);
     160      this.newProblemButton.Name = "newProblemButton";
     161      this.newProblemButton.Size = new System.Drawing.Size(24, 24);
     162      this.newProblemButton.TabIndex = 0;
     163      this.toolTip.SetToolTip(this.newProblemButton, "Create New Problem");
     164      this.newProblemButton.UseVisualStyleBackColor = true;
     165      this.newProblemButton.Click += new System.EventHandler(this.newProblemButton_Click);
     166      //
     167      // openProblemButton
     168      //
     169      this.openProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open;
     170      this.openProblemButton.Location = new System.Drawing.Point(36, 6);
     171      this.openProblemButton.Name = "openProblemButton";
     172      this.openProblemButton.Size = new System.Drawing.Size(24, 24);
     173      this.openProblemButton.TabIndex = 1;
     174      this.toolTip.SetToolTip(this.openProblemButton, "Open Problem");
     175      this.openProblemButton.UseVisualStyleBackColor = true;
     176      this.openProblemButton.Click += new System.EventHandler(this.openProblemButton_Click);
     177      //
     178      // saveProblemButton
     179      //
     180      this.saveProblemButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save;
     181      this.saveProblemButton.Location = new System.Drawing.Point(66, 6);
     182      this.saveProblemButton.Name = "saveProblemButton";
     183      this.saveProblemButton.Size = new System.Drawing.Size(24, 24);
     184      this.saveProblemButton.TabIndex = 2;
     185      this.toolTip.SetToolTip(this.saveProblemButton, "Save Problem");
     186      this.saveProblemButton.UseVisualStyleBackColor = true;
     187      this.saveProblemButton.Click += new System.EventHandler(this.saveProblemButton_Click);
     188      //
     189      // newOperatorGraphButton
     190      //
     191      this.newOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument;
     192      this.newOperatorGraphButton.Location = new System.Drawing.Point(6, 6);
     193      this.newOperatorGraphButton.Name = "newOperatorGraphButton";
     194      this.newOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     195      this.newOperatorGraphButton.TabIndex = 0;
     196      this.toolTip.SetToolTip(this.newOperatorGraphButton, "Create New Operator Graph");
     197      this.newOperatorGraphButton.UseVisualStyleBackColor = true;
     198      this.newOperatorGraphButton.Click += new System.EventHandler(this.newOperatorGraphButton_Click);
     199      //
     200      // openOperatorGraphButton
     201      //
     202      this.openOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Open;
     203      this.openOperatorGraphButton.Location = new System.Drawing.Point(36, 6);
     204      this.openOperatorGraphButton.Name = "openOperatorGraphButton";
     205      this.openOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     206      this.openOperatorGraphButton.TabIndex = 1;
     207      this.toolTip.SetToolTip(this.openOperatorGraphButton, "Open Operator Graph");
     208      this.openOperatorGraphButton.UseVisualStyleBackColor = true;
     209      this.openOperatorGraphButton.Click += new System.EventHandler(this.openOperatorGraphButton_Click);
     210      //
     211      // saveOperatorGraphButton
     212      //
     213      this.saveOperatorGraphButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Save;
     214      this.saveOperatorGraphButton.Location = new System.Drawing.Point(66, 6);
     215      this.saveOperatorGraphButton.Name = "saveOperatorGraphButton";
     216      this.saveOperatorGraphButton.Size = new System.Drawing.Size(24, 24);
     217      this.saveOperatorGraphButton.TabIndex = 2;
     218      this.toolTip.SetToolTip(this.saveOperatorGraphButton, "Save Operator Graph");
     219      this.saveOperatorGraphButton.UseVisualStyleBackColor = true;
     220      this.saveOperatorGraphButton.Click += new System.EventHandler(this.saveOperatorGraphButton_Click);
    141221      //
    142222      // tabControl
     
    147227      this.tabControl.Controls.Add(this.operatorGraphTabPage);
    148228      this.tabControl.Controls.Add(this.globalScopeTabPage);
     229      this.tabControl.Controls.Add(this.problemTabPage);
    149230      this.tabControl.Location = new System.Drawing.Point(0, 0);
    150231      this.tabControl.Name = "tabControl";
    151232      this.tabControl.SelectedIndex = 0;
    152       this.tabControl.Size = new System.Drawing.Size(802, 611);
    153       this.tabControl.TabIndex = 0;
     233      this.tabControl.Size = new System.Drawing.Size(802, 610);
     234      this.tabControl.TabIndex = 3;
    154235      //
    155236      // operatorGraphTabPage
    156237      //
     238      this.operatorGraphTabPage.Controls.Add(this.saveOperatorGraphButton);
     239      this.operatorGraphTabPage.Controls.Add(this.openOperatorGraphButton);
     240      this.operatorGraphTabPage.Controls.Add(this.newOperatorGraphButton);
    157241      this.operatorGraphTabPage.Controls.Add(this.operatorGraphView);
    158242      this.operatorGraphTabPage.Location = new System.Drawing.Point(4, 22);
    159243      this.operatorGraphTabPage.Name = "operatorGraphTabPage";
    160244      this.operatorGraphTabPage.Padding = new System.Windows.Forms.Padding(3);
    161       this.operatorGraphTabPage.Size = new System.Drawing.Size(794, 585);
     245      this.operatorGraphTabPage.Size = new System.Drawing.Size(794, 584);
    162246      this.operatorGraphTabPage.TabIndex = 0;
    163247      this.operatorGraphTabPage.Text = "Operator Graph";
     
    170254      this.globalScopeTabPage.Name = "globalScopeTabPage";
    171255      this.globalScopeTabPage.Padding = new System.Windows.Forms.Padding(3);
    172       this.globalScopeTabPage.Size = new System.Drawing.Size(794, 585);
     256      this.globalScopeTabPage.Size = new System.Drawing.Size(794, 584);
    173257      this.globalScopeTabPage.TabIndex = 1;
    174258      this.globalScopeTabPage.Text = "Global Scope";
    175259      this.globalScopeTabPage.UseVisualStyleBackColor = true;
     260      //
     261      // problemTabPage
     262      //
     263      this.problemTabPage.Controls.Add(this.saveProblemButton);
     264      this.problemTabPage.Controls.Add(this.openProblemButton);
     265      this.problemTabPage.Controls.Add(this.newProblemButton);
     266      this.problemTabPage.Controls.Add(this.problemViewHost);
     267      this.problemTabPage.Location = new System.Drawing.Point(4, 22);
     268      this.problemTabPage.Name = "problemTabPage";
     269      this.problemTabPage.Padding = new System.Windows.Forms.Padding(3);
     270      this.problemTabPage.Size = new System.Drawing.Size(794, 584);
     271      this.problemTabPage.TabIndex = 2;
     272      this.problemTabPage.Text = "Problem";
     273      this.problemTabPage.UseVisualStyleBackColor = true;
     274      //
     275      // problemViewHost
     276      //
     277      this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     278                  | System.Windows.Forms.AnchorStyles.Left)
     279                  | System.Windows.Forms.AnchorStyles.Right)));
     280      this.problemViewHost.Content = null;
     281      this.problemViewHost.Location = new System.Drawing.Point(6, 36);
     282      this.problemViewHost.Name = "problemViewHost";
     283      this.problemViewHost.Size = new System.Drawing.Size(782, 542);
     284      this.problemViewHost.TabIndex = 3;
     285      //
     286      // openFileDialog
     287      //
     288      this.openFileDialog.DefaultExt = "hl";
     289      this.openFileDialog.FileName = "Item";
     290      this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*";
     291      this.openFileDialog.Title = "Open File";
     292      //
     293      // saveFileDialog
     294      //
     295      this.saveFileDialog.DefaultExt = "hl";
     296      this.saveFileDialog.FileName = "Item";
     297      this.saveFileDialog.Filter = "Uncompressed HeuristicLab Files|*.hl|HeuristicLab Files|*.hl|All Files|*.*";
     298      this.saveFileDialog.FilterIndex = 2;
     299      this.saveFileDialog.Title = "Save File";
    176300      //
    177301      // EngineView
     
    190314      this.operatorGraphTabPage.ResumeLayout(false);
    191315      this.globalScopeTabPage.ResumeLayout(false);
     316      this.problemTabPage.ResumeLayout(false);
    192317      this.ResumeLayout(false);
    193318      this.PerformLayout();
     
    208333    protected System.Windows.Forms.TabPage operatorGraphTabPage;
    209334    protected System.Windows.Forms.TabPage globalScopeTabPage;
     335    protected System.Windows.Forms.TabPage problemTabPage;
     336    protected ViewHost problemViewHost;
     337    protected System.Windows.Forms.Button newProblemButton;
     338    protected System.Windows.Forms.Button saveOperatorGraphButton;
     339    protected System.Windows.Forms.Button openOperatorGraphButton;
     340    protected System.Windows.Forms.Button newOperatorGraphButton;
     341    protected System.Windows.Forms.Button saveProblemButton;
     342    protected System.Windows.Forms.Button openProblemButton;
     343    protected System.Windows.Forms.OpenFileDialog openFileDialog;
     344    protected System.Windows.Forms.SaveFileDialog saveFileDialog;
    210345
    211346  }
  • trunk/sources/HeuristicLab.Core.Views/3.3/EngineView.cs

    r2790 r2796  
    3030using HeuristicLab.Common;
    3131using HeuristicLab.MainForm;
     32using HeuristicLab.Persistence.Default.Xml;
    3233
    3334namespace HeuristicLab.Core.Views {
     
    3839  [Content(typeof(IEngine), false)]
    3940  public partial class EngineView : ItemView {
     41    protected TypeSelectorDialog typeSelectorDialog;
    4042    private int executionTimeCounter;
    4143
     
    6668    protected override void DeregisterContentEvents() {
    6769      Content.OperatorGraphChanged -= new EventHandler(Content_OperatorGraphChanged);
     70      Content.ProblemChanged -= new EventHandler(Content_ProblemChanged);
    6871      Content.Prepared -= new EventHandler(Content_Prepared);
    6972      Content.Started -= new EventHandler(Content_Started);
     
    8184      base.RegisterContentEvents();
    8285      Content.OperatorGraphChanged += new EventHandler(Content_OperatorGraphChanged);
     86      Content.ProblemChanged += new EventHandler(Content_ProblemChanged);
    8387      Content.Prepared += new EventHandler(Content_Prepared);
    8488      Content.Started += new EventHandler(Content_Started);
     
    96100      stopButton.Enabled = false;
    97101      if (Content == null) {
     102        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = false;
    98103        operatorGraphView.Enabled = false;
    99104        scopeView.Enabled = false;
    100         startButton.Enabled = false;
    101         resetButton.Enabled = false;
     105        newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = false;
     106        problemViewHost.Enabled = false;
     107        startButton.Enabled = resetButton.Enabled = false;
    102108        executionTimeTextBox.Enabled = false;
    103109      } else {
     110        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = true;
    104111        operatorGraphView.Content = Content.OperatorGraph;
     112        operatorGraphView.Enabled = true;
    105113        scopeView.Content = Content.GlobalScope;
     114        scopeView.Enabled = true;
     115        newProblemButton.Enabled = openProblemButton.Enabled = true;
     116        saveProblemButton.Enabled = Content.Problem != null;
     117        problemViewHost.Content = Content.Problem;
     118        problemViewHost.Enabled = true;
    106119        startButton.Enabled = !Content.Finished;
    107120        resetButton.Enabled = true;
     
    118131        operatorGraphView.Content = Content.OperatorGraph;
    119132    }
     133    protected void Content_ProblemChanged(object sender, EventArgs e) {
     134      if (InvokeRequired)
     135        Invoke(new EventHandler(Content_ProblemChanged), sender, e);
     136      else {
     137        saveProblemButton.Enabled = Content.Problem != null;
     138        problemViewHost.Content = Content.Problem;
     139      }
     140    }
    120141    protected virtual void Content_Prepared(object sender, EventArgs e) {
    121142      if (InvokeRequired)
    122143        Invoke(new EventHandler(Content_Prepared), sender, e);
    123144      else {
     145        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = true;
    124146        operatorGraphView.Enabled = true;
    125147        scopeView.Enabled = true;
     148        newProblemButton.Enabled = openProblemButton.Enabled = true;
     149        saveProblemButton.Enabled = Content.Problem != null;
     150        problemViewHost.Enabled = true;
    126151        startButton.Enabled = !Content.Finished;
    127152        stopButton.Enabled = false;
     
    135160        Invoke(new EventHandler(Content_Started), sender, e);
    136161      else {
     162        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = false;
    137163        operatorGraphView.Enabled = false;
    138164        scopeView.Enabled = false;
     165        newProblemButton.Enabled = openProblemButton.Enabled = saveProblemButton.Enabled = false;
     166        problemViewHost.Enabled = false;
    139167        startButton.Enabled = false;
    140168        stopButton.Enabled = true;
     
    147175        Invoke(new EventHandler(Content_Stopped), sender, e);
    148176      else {
     177        newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = saveOperatorGraphButton.Enabled = true;
    149178        operatorGraphView.Enabled = true;
    150179        scopeView.Enabled = true;
     180        newProblemButton.Enabled = openProblemButton.Enabled = true;
     181        saveProblemButton.Enabled = Content.Problem != null;
     182        problemViewHost.Enabled = true;
    151183        startButton.Enabled = !Content.Finished;
    152184        stopButton.Enabled = false;
     
    171203
    172204    #region Button events
     205    protected void newOperatorGraphButton_Click(object sender, EventArgs e) {
     206      Content.OperatorGraph = new OperatorGraph();
     207    }
     208    protected void openOperatorGraphButton_Click(object sender, EventArgs e) {
     209      openFileDialog.Title = "Open Operator Graph";
     210      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
     211        OperatorGraph operatorGraph = null;
     212        try {
     213          operatorGraph = XmlParser.Deserialize(openFileDialog.FileName) as OperatorGraph;
     214        }
     215        catch (Exception ex) {
     216          Auxiliary.ShowErrorMessageBox(ex);
     217        }
     218        if (operatorGraph == null)
     219          MessageBox.Show(this, "Selected file does not contain an operator graph.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);
     220        else
     221          Content.OperatorGraph = operatorGraph;
     222      }
     223    }
     224    protected void saveOperatorGraphButton_Click(object sender, EventArgs e) {
     225      saveFileDialog.Title = "Save Operator Graph";
     226      if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {
     227        try {
     228          if (saveFileDialog.FilterIndex == 1)
     229            XmlGenerator.Serialize(Content.OperatorGraph, saveFileDialog.FileName, 0);
     230          else
     231            XmlGenerator.Serialize(Content.OperatorGraph, saveFileDialog.FileName, 9);
     232        }
     233        catch (Exception ex) {
     234          Auxiliary.ShowErrorMessageBox(ex);
     235        }
     236      }
     237    }
     238    protected void newProblemButton_Click(object sender, EventArgs e) {
     239      if (typeSelectorDialog == null) {
     240        typeSelectorDialog = new TypeSelectorDialog();
     241      }
     242      typeSelectorDialog.Caption = "Select Problem";
     243      typeSelectorDialog.TypeSelector.Configure(typeof(IProblem), false, false);
     244
     245      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     246        Content.Problem = (IProblem)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     247      }
     248    }
     249    protected void openProblemButton_Click(object sender, EventArgs e) {
     250      openFileDialog.Title = "Open Problem";
     251      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
     252        IProblem problem = null;
     253        try {
     254          problem = XmlParser.Deserialize(openFileDialog.FileName) as IProblem;
     255        }
     256        catch (Exception ex) {
     257          Auxiliary.ShowErrorMessageBox(ex);
     258        }
     259        if (problem == null)
     260          MessageBox.Show(this, "Selected file does not contain a problem.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);
     261        else
     262          Content.Problem = problem;
     263      }
     264    }
     265    protected void saveProblemButton_Click(object sender, EventArgs e) {
     266      saveFileDialog.Title = "Save Problem";
     267      if (saveFileDialog.ShowDialog(this) == DialogResult.OK) {
     268        try {
     269          if (saveFileDialog.FilterIndex == 1)
     270            XmlGenerator.Serialize(Content.Problem, saveFileDialog.FileName, 0);
     271          else
     272            XmlGenerator.Serialize(Content.Problem, saveFileDialog.FileName, 9);
     273        }
     274        catch (Exception ex) {
     275          Auxiliary.ShowErrorMessageBox(ex);
     276        }
     277      }
     278    }
    173279    protected virtual void startButton_Click(object sender, EventArgs e) {
    174280      Content.Start();
  • trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLab.Core.Views-3.3.csproj

    r2754 r2796  
    5353  <ItemGroup>
    5454    <None Include="HeuristicLabCoreViewsPlugin.cs.frame" />
     55    <Compile Include="ValueParameterCollectionView.cs">
     56      <SubType>UserControl</SubType>
     57    </Compile>
     58    <Compile Include="ValueParameterCollectionView.Designer.cs">
     59      <DependentUpon>ValueParameterCollectionView.cs</DependentUpon>
     60    </Compile>
    5561    <Compile Include="ItemArrayView.cs">
    5662      <SubType>UserControl</SubType>
     
    107113    <Compile Include="OperatorTreeView.Designer.cs">
    108114      <DependentUpon>OperatorTreeView.cs</DependentUpon>
     115    </Compile>
     116    <Compile Include="OperatorView.cs">
     117      <SubType>UserControl</SubType>
     118    </Compile>
     119    <Compile Include="OperatorView.Designer.cs">
     120      <DependentUpon>OperatorView.cs</DependentUpon>
     121    </Compile>
     122    <Compile Include="ProblemView.cs">
     123      <SubType>UserControl</SubType>
     124    </Compile>
     125    <Compile Include="ProblemView.Designer.cs">
     126      <DependentUpon>ProblemView.cs</DependentUpon>
    109127    </Compile>
    110128    <Compile Include="TypeSelectorDialog.cs">
     
    223241      <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
    224242      <Name>HeuristicLab.MainForm-3.2</Name>
     243    </ProjectReference>
     244    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
     245      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
     246      <Name>HeuristicLab.Persistence-3.3</Name>
    225247    </ProjectReference>
    226248    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
  • trunk/sources/HeuristicLab.Core.Views/3.3/HeuristicLabCoreViewsPlugin.cs.frame

    r2790 r2796  
    3737  [PluginDependency("HeuristicLab.MainForm", "3.2")]
    3838  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.2")]
     39  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    3940  public class HeuristicLabCoreViewsPlugin : PluginBase {
    4041  }
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.Designer.cs

    r2790 r2796  
    9696      this.moveUpButton.Location = new System.Drawing.Point(3, 3);
    9797      this.moveUpButton.Name = "moveUpButton";
    98       this.moveUpButton.Size = new System.Drawing.Size(23, 23);
     98      this.moveUpButton.Size = new System.Drawing.Size(24, 24);
    9999      this.moveUpButton.TabIndex = 0;
    100100      this.toolTip.SetToolTip(this.moveUpButton, "Move Up");
     
    106106      this.moveDownButton.Enabled = false;
    107107      this.moveDownButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ArrowDown;
    108       this.moveDownButton.Location = new System.Drawing.Point(32, 3);
     108      this.moveDownButton.Location = new System.Drawing.Point(33, 3);
    109109      this.moveDownButton.Name = "moveDownButton";
    110       this.moveDownButton.Size = new System.Drawing.Size(23, 23);
     110      this.moveDownButton.Size = new System.Drawing.Size(24, 24);
    111111      this.moveDownButton.TabIndex = 1;
    112112      this.toolTip.SetToolTip(this.moveDownButton, "Move Down");
     
    124124      this.itemsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    125125      this.itemsListView.HideSelection = false;
    126       this.itemsListView.Location = new System.Drawing.Point(3, 32);
     126      this.itemsListView.Location = new System.Drawing.Point(3, 33);
    127127      this.itemsListView.Name = "itemsListView";
    128128      this.itemsListView.ShowItemToolTips = true;
    129       this.itemsListView.Size = new System.Drawing.Size(194, 287);
     129      this.itemsListView.Size = new System.Drawing.Size(194, 286);
    130130      this.itemsListView.SmallImageList = this.imageList;
    131131      this.itemsListView.TabIndex = 2;
     
    153153                  | System.Windows.Forms.AnchorStyles.Right)));
    154154      this.detailsGroupBox.Controls.Add(this.viewHost);
    155       this.detailsGroupBox.Location = new System.Drawing.Point(3, 26);
     155      this.detailsGroupBox.Location = new System.Drawing.Point(3, 27);
    156156      this.detailsGroupBox.Name = "detailsGroupBox";
    157157      this.detailsGroupBox.Size = new System.Drawing.Size(283, 294);
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.Designer.cs

    r2790 r2796  
    104104      this.itemsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    105105      this.itemsListView.HideSelection = false;
    106       this.itemsListView.Location = new System.Drawing.Point(3, 32);
     106      this.itemsListView.Location = new System.Drawing.Point(3, 33);
    107107      this.itemsListView.Name = "itemsListView";
    108108      this.itemsListView.ShowItemToolTips = true;
    109       this.itemsListView.Size = new System.Drawing.Size(244, 328);
     109      this.itemsListView.Size = new System.Drawing.Size(244, 327);
    110110      this.itemsListView.SmallImageList = this.imageList;
    111111      this.itemsListView.TabIndex = 4;
     
    131131      this.sortDescendingButton.Enabled = false;
    132132      this.sortDescendingButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.SortUp;
    133       this.sortDescendingButton.Location = new System.Drawing.Point(32, 3);
     133      this.sortDescendingButton.Location = new System.Drawing.Point(33, 3);
    134134      this.sortDescendingButton.Name = "sortDescendingButton";
    135       this.sortDescendingButton.Size = new System.Drawing.Size(23, 23);
     135      this.sortDescendingButton.Size = new System.Drawing.Size(24, 24);
    136136      this.sortDescendingButton.TabIndex = 1;
    137137      this.toolTip.SetToolTip(this.sortDescendingButton, "Sort Descending");
     
    143143      this.sortAscendingButton.Enabled = false;
    144144      this.sortAscendingButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Sort;
    145       this.sortAscendingButton.Location = new System.Drawing.Point(61, 3);
     145      this.sortAscendingButton.Location = new System.Drawing.Point(63, 3);
    146146      this.sortAscendingButton.Name = "sortAscendingButton";
    147       this.sortAscendingButton.Size = new System.Drawing.Size(23, 23);
     147      this.sortAscendingButton.Size = new System.Drawing.Size(24, 24);
    148148      this.sortAscendingButton.TabIndex = 2;
    149149      this.toolTip.SetToolTip(this.sortAscendingButton, "Sort Ascending");
     
    155155      this.removeButton.Enabled = false;
    156156      this.removeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    157       this.removeButton.Location = new System.Drawing.Point(90, 3);
     157      this.removeButton.Location = new System.Drawing.Point(93, 3);
    158158      this.removeButton.Name = "removeButton";
    159       this.removeButton.Size = new System.Drawing.Size(23, 23);
     159      this.removeButton.Size = new System.Drawing.Size(24, 24);
    160160      this.removeButton.TabIndex = 3;
    161161      this.toolTip.SetToolTip(this.removeButton, "Remove");
     
    168168      this.addButton.Location = new System.Drawing.Point(3, 3);
    169169      this.addButton.Name = "addButton";
    170       this.addButton.Size = new System.Drawing.Size(23, 23);
     170      this.addButton.Size = new System.Drawing.Size(24, 24);
    171171      this.addButton.TabIndex = 0;
    172172      this.toolTip.SetToolTip(this.addButton, "Add");
     
    180180                  | System.Windows.Forms.AnchorStyles.Right)));
    181181      this.detailsGroupBox.Controls.Add(this.viewHost);
    182       this.detailsGroupBox.Location = new System.Drawing.Point(3, 26);
     182      this.detailsGroupBox.Location = new System.Drawing.Point(3, 27);
    183183      this.detailsGroupBox.Name = "detailsGroupBox";
    184184      this.detailsGroupBox.Size = new System.Drawing.Size(266, 335);
     
    192192                  | System.Windows.Forms.AnchorStyles.Left)
    193193                  | System.Windows.Forms.AnchorStyles.Right)));
     194      this.viewHost.Content = null;
    194195      this.viewHost.Location = new System.Drawing.Point(6, 19);
    195196      this.viewHost.Name = "viewHost";
    196       this.viewHost.Content = null;
    197197      this.viewHost.Size = new System.Drawing.Size(254, 310);
    198198      this.viewHost.TabIndex = 0;
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.Designer.cs

    r2790 r2796  
    9696      this.removeButton.Enabled = false;
    9797      this.removeButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    98       this.removeButton.Location = new System.Drawing.Point(90, 3);
     98      this.removeButton.Location = new System.Drawing.Point(93, 3);
    9999      this.removeButton.Name = "removeButton";
    100       this.removeButton.Size = new System.Drawing.Size(23, 23);
     100      this.removeButton.Size = new System.Drawing.Size(24, 24);
    101101      this.removeButton.TabIndex = 3;
    102102      this.toolTip.SetToolTip(this.removeButton, "Remove");
     
    108108      this.moveUpButton.Enabled = false;
    109109      this.moveUpButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ArrowUp;
    110       this.moveUpButton.Location = new System.Drawing.Point(32, 3);
     110      this.moveUpButton.Location = new System.Drawing.Point(33, 3);
    111111      this.moveUpButton.Name = "moveUpButton";
    112       this.moveUpButton.Size = new System.Drawing.Size(23, 23);
     112      this.moveUpButton.Size = new System.Drawing.Size(24, 24);
    113113      this.moveUpButton.TabIndex = 1;
    114114      this.toolTip.SetToolTip(this.moveUpButton, "Move Up");
     
    120120      this.moveDownButton.Enabled = false;
    121121      this.moveDownButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ArrowDown;
    122       this.moveDownButton.Location = new System.Drawing.Point(61, 3);
     122      this.moveDownButton.Location = new System.Drawing.Point(63, 3);
    123123      this.moveDownButton.Name = "moveDownButton";
    124       this.moveDownButton.Size = new System.Drawing.Size(23, 23);
     124      this.moveDownButton.Size = new System.Drawing.Size(24, 24);
    125125      this.moveDownButton.TabIndex = 2;
    126126      this.toolTip.SetToolTip(this.moveDownButton, "Move Down");
     
    138138      this.itemsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
    139139      this.itemsListView.HideSelection = false;
    140       this.itemsListView.Location = new System.Drawing.Point(3, 32);
     140      this.itemsListView.Location = new System.Drawing.Point(3, 33);
    141141      this.itemsListView.Name = "itemsListView";
    142142      this.itemsListView.ShowItemToolTips = true;
    143       this.itemsListView.Size = new System.Drawing.Size(194, 287);
     143      this.itemsListView.Size = new System.Drawing.Size(194, 286);
    144144      this.itemsListView.SmallImageList = this.imageList;
    145145      this.itemsListView.TabIndex = 4;
     
    166166      this.addButton.Location = new System.Drawing.Point(3, 3);
    167167      this.addButton.Name = "addButton";
    168       this.addButton.Size = new System.Drawing.Size(23, 23);
     168      this.addButton.Size = new System.Drawing.Size(24, 24);
    169169      this.addButton.TabIndex = 0;
    170170      this.toolTip.SetToolTip(this.addButton, "Add");
     
    178178                  | System.Windows.Forms.AnchorStyles.Right)));
    179179      this.detailsGroupBox.Controls.Add(this.viewHost);
    180       this.detailsGroupBox.Location = new System.Drawing.Point(3, 26);
     180      this.detailsGroupBox.Location = new System.Drawing.Point(3, 27);
    181181      this.detailsGroupBox.Name = "detailsGroupBox";
    182182      this.detailsGroupBox.Size = new System.Drawing.Size(283, 294);
     
    190190                  | System.Windows.Forms.AnchorStyles.Left)
    191191                  | System.Windows.Forms.AnchorStyles.Right)));
     192      this.viewHost.Content = null;
    192193      this.viewHost.Location = new System.Drawing.Point(6, 19);
    193194      this.viewHost.Name = "viewHost";
    194       this.viewHost.Content = null;
    195195      this.viewHost.Size = new System.Drawing.Size(271, 269);
    196196      this.viewHost.TabIndex = 0;
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorView.Designer.cs

    r2795 r2796  
    2020#endregion
    2121
    22 namespace HeuristicLab.Operators.Views {
     22namespace HeuristicLab.Core.Views {
    2323  partial class OperatorView {
    2424    /// <summary>
     
    9494    protected HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView;
    9595
    96 
    9796  }
    9897}
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorView.cs

    r2795 r2796  
    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;
    29 using HeuristicLab.Core;
    30 using HeuristicLab.Core.Views;
    3122using HeuristicLab.MainForm;
    3223
    33 namespace HeuristicLab.Operators.Views {
     24namespace HeuristicLab.Core.Views {
    3425  /// <summary>
    3526  /// The base class for visual representations of items.
  • trunk/sources/HeuristicLab.Core.Views/3.3/ParameterCollectionView.cs

    r2727 r2796  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.ComponentModel;
  • trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.Designer.cs

    r2790 r2796  
    112112                  | System.Windows.Forms.AnchorStyles.Right)));
    113113      this.valuePanel.Controls.Add(this.viewHost);
    114       this.valuePanel.Location = new System.Drawing.Point(6, 48);
     114      this.valuePanel.Location = new System.Drawing.Point(6, 49);
    115115      this.valuePanel.Name = "valuePanel";
    116       this.valuePanel.Size = new System.Drawing.Size(347, 100);
     116      this.valuePanel.Size = new System.Drawing.Size(347, 99);
    117117      this.valuePanel.TabIndex = 2;
    118118      this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
     
    122122      // viewHost
    123123      //
     124      this.viewHost.Content = null;
    124125      this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    125126      this.viewHost.Location = new System.Drawing.Point(0, 0);
    126127      this.viewHost.Name = "viewHost";
    127       this.viewHost.Content = null;
    128       this.viewHost.Size = new System.Drawing.Size(347, 100);
     128      this.viewHost.Size = new System.Drawing.Size(347, 99);
    129129      this.viewHost.TabIndex = 0;
    130130      //
     
    132132      //
    133133      this.clearValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    134       this.clearValueButton.Location = new System.Drawing.Point(35, 19);
     134      this.clearValueButton.Location = new System.Drawing.Point(36, 19);
    135135      this.clearValueButton.Name = "clearValueButton";
    136       this.clearValueButton.Size = new System.Drawing.Size(23, 23);
     136      this.clearValueButton.Size = new System.Drawing.Size(24, 24);
    137137      this.clearValueButton.TabIndex = 1;
    138138      this.toolTip.SetToolTip(this.clearValueButton, "Clear Value");
     
    145145      this.setValueButton.Location = new System.Drawing.Point(6, 19);
    146146      this.setValueButton.Name = "setValueButton";
    147       this.setValueButton.Size = new System.Drawing.Size(23, 23);
     147      this.setValueButton.Size = new System.Drawing.Size(24, 24);
    148148      this.setValueButton.TabIndex = 1;
    149149      this.toolTip.SetToolTip(this.setValueButton, "Set Value");
  • trunk/sources/HeuristicLab.Core/3.3/Engine.cs

    r2793 r2796  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
     24using System.Drawing;
    2625using System.Threading;
    27 using System.Drawing;
     26using HeuristicLab.Common;
    2827using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    29 using HeuristicLab.Common;
    3028
    3129namespace HeuristicLab.Core {
     
    4139    }
    4240
    43     /// <summary>
    44     /// Field of the current instance that represent the operator graph.
    45     /// </summary>
    4641    private OperatorGraph operatorGraph;
    4742    /// <summary>
    48     /// Gets the current operator graph.
     43    /// Gets or sets the current operator graph.
    4944    /// </summary>
    5045    [Storable]
     
    7671
    7772    [Storable]
     73    private IProblem problem;
     74    /// <summary>
     75    /// Gets or sets the current problem.
     76    /// </summary>
     77    public IProblem Problem {
     78      get { return problem; }
     79      set {
     80        if (value == null) throw new ArgumentNullException();
     81        if (value != problem) {
     82          problem = value;
     83          OnProblemChanged();
     84          Prepare();
     85        }
     86      }
     87    }
     88
     89    [Storable]
    7890    private TimeSpan executionTime;
    7991    /// <summary>
     
    134146    protected Engine() {
    135147      globalScope = new Scope("Global");
     148      problem = null;
    136149      executionStack = new Stack<IExecutionSequence>();
    137150      OperatorGraph = new OperatorGraph();
     
    149162      clone.OperatorGraph = (OperatorGraph)cloner.Clone(operatorGraph);
    150163      clone.globalScope = (Scope)cloner.Clone(globalScope);
     164      clone.problem = (IProblem)cloner.Clone(problem);
    151165      clone.executionTime = executionTime;
    152166      IExecutionSequence[] contexts = executionStack.ToArray();
     
    169183      ExecutionTime = new TimeSpan();
    170184      executionStack.Clear();
    171       if (OperatorGraph.InitialOperator != null)
    172         executionStack.Push(new ExecutionContext(null, OperatorGraph.InitialOperator, GlobalScope));
     185      if ((OperatorGraph.InitialOperator != null) && (Problem != null))
     186        executionStack.Push(new ExecutionContext(null, OperatorGraph.InitialOperator, GlobalScope, Problem));
    173187      OnPrepared();
    174188    }
     
    228242    }
    229243
     244    /// <summary>
     245    /// Occurs when the operator graph was changed.
     246    /// </summary>
    230247    public event EventHandler OperatorGraphChanged;
     248    /// <summary>
     249    /// Fires a new <c>OperatorGraphChanged</c> event.
     250    /// </summary>
    231251    protected virtual void OnOperatorGraphChanged() {
    232252      if (OperatorGraphChanged != null)
    233253        OperatorGraphChanged(this, EventArgs.Empty);
     254    }
     255    /// <summary>
     256    /// Occurs when the problem was changed.
     257    /// </summary>
     258    public event EventHandler ProblemChanged;
     259    /// <summary>
     260    /// Fires a new <c>ProblemChanged</c> event.
     261    /// </summary>
     262    protected virtual void OnProblemChanged() {
     263      if (ProblemChanged != null)
     264        ProblemChanged(this, EventArgs.Empty);
    234265    }
    235266    /// <summary>
  • trunk/sources/HeuristicLab.Core/3.3/ExecutionContext.cs

    r2790 r2796  
    4545    }
    4646
     47    [Storable]
     48    private IProblem problem;
     49    public IProblem Problem {
     50      get { return problem; }
     51    }
     52
    4753    private ExecutionContext() {
    4854      parent = null;
    4955      op = null;
    5056      scope = null;
     57      problem = null;
    5158    }
    52     public ExecutionContext(ExecutionContext parent, IOperator op, IScope scope) {
    53       if ((op == null) || (scope == null)) throw new ArgumentNullException();
     59    public ExecutionContext(ExecutionContext parent, IOperator op, IScope scope, IProblem problem) {
     60      if ((op == null) || (scope == null) || (problem == null)) throw new ArgumentNullException();
    5461      this.parent = parent;
    5562      this.op = op;
    5663      this.scope = scope;
     64      this.problem = problem;
    5765    }
    5866
     
    6371      clone.op = (IOperator)cloner.Clone(op);
    6472      clone.scope = (IScope)cloner.Clone(scope);
     73      clone.problem = (IProblem)cloner.Clone(problem);
    6574      return clone;
     75    }
     76
     77    public ExecutionContext CreateContext(IOperator op) {
     78      return new ExecutionContext(parent, op, scope, problem);
     79    }
     80    public ExecutionContext CreateContext(IOperator op, IScope scope) {
     81      return new ExecutionContext(parent, op, scope, problem);
     82    }
     83    public ExecutionContext CreateChildContext(IOperator op) {
     84      return new ExecutionContext(this, op, scope, problem);
     85    }
     86    public ExecutionContext CreateChildContext(IOperator op, IScope scope) {
     87      return new ExecutionContext(this, op, scope, problem);
    6688    }
    6789  }
  • trunk/sources/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj

    r2773 r2796  
    104104    <Compile Include="ChangedEventArgs.cs" />
    105105    <None Include="HeuristicLabCorePlugin.cs.frame" />
     106    <Compile Include="ValueParameterCollection.cs" />
     107    <Compile Include="Interfaces\IProblem.cs" />
    106108    <Compile Include="Interfaces\IExecutionSequence.cs" />
    107109    <Compile Include="Interfaces\IValueLookupParameter.cs" />
     
    115117    <Compile Include="Item.cs" />
    116118    <Compile Include="NamedItem.cs" />
     119    <Compile Include="Operator.cs" />
     120    <Compile Include="Problem.cs" />
    117121    <Compile Include="OperatorGraph.cs" />
    118122    <Compile Include="Interfaces\IParameter.cs" />
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IEngine.cs

    r2790 r2796  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2523using HeuristicLab.Common;
    2624
     
    4038    /// </summary>
    4139    IScope GlobalScope { get; }
     40    /// <summary>
     41    /// Gets the problem of the current instance.
     42    /// </summary>
     43    IProblem Problem { get; set; }
    4244
    4345    /// <summary>
     
    7274    void Stop();
    7375
     76    /// <summary>
     77    /// Occurs when the operator graph was changed.
     78    /// </summary>
    7479    event EventHandler OperatorGraphChanged;
     80    /// <summary>
     81    /// Occurs when the problem was changed.
     82    /// </summary>
     83    event EventHandler ProblemChanged;
    7584    /// <summary>
    7685    /// Occurs when the execution time was changed.
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/ILookupParameter.cs

    r2790 r2796  
    2626
    2727namespace HeuristicLab.Core {
    28   public interface ILookupParameter<T> : IParameter where T : class, IItem {
     28  public interface ILookupParameter : IParameter {
    2929    string ActualName { get; set; }
    30 
    3130    event EventHandler ActualNameChanged;
    3231  }
     32
     33  public interface ILookupParameter<T> : ILookupParameter where T : class, IItem {
     34    new T ActualValue { get; set; }
     35  }
    3336}
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IValueLookupParameter.cs

    r2790 r2796  
    2626
    2727namespace HeuristicLab.Core {
    28   public interface IValueLookupParameter<T> : IValueParameter<T>, ILookupParameter<T> where T : class, IItem { }
     28  public interface IValueLookupParameter : IValueParameter, ILookupParameter { }
     29
     30  public interface IValueLookupParameter<T> : IValueLookupParameter, IValueParameter<T>, ILookupParameter<T> where T : class, IItem { }
    2931}
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IValueParameter.cs

    r2790 r2796  
    2626
    2727namespace HeuristicLab.Core {
    28   public interface IValueParameter<T> : IParameter where T : class, IItem {
    29     T Value { get; set; }
    30 
     28  public interface IValueParameter : IParameter {
     29    IItem Value { get; set; }
    3130    event EventHandler ValueChanged;
    3231  }
     32
     33  public interface IValueParameter<T> : IValueParameter where T : class, IItem {
     34    new T Value { get; set; }
     35  }
    3336}
  • trunk/sources/HeuristicLab.Core/3.3/Operator.cs

    r2795 r2796  
    2323using System.Drawing;
    2424using HeuristicLab.Collections;
    25 using HeuristicLab.Core;
    2625using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2726
    28 namespace HeuristicLab.Operators {
     27namespace HeuristicLab.Core {
    2928  /// <summary>
    3029  /// The base class for all operators.
  • trunk/sources/HeuristicLab.Core/3.3/OperatorGraph.cs

    r2793 r2796  
    3434  /// </summary>
    3535  [Item("OperatorGraph", "Represents a graph of operators.")]
    36   [Creatable("Test")]
     36  [Creatable("Algorithms")]
    3737  public class OperatorGraph : Item {
    3838    private OperatorSet operators;
  • trunk/sources/HeuristicLab.Operators.Views/3.3/CombinedOperatorView.cs

    r2790 r2796  
    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;
    2922using HeuristicLab.Core;
    3023using HeuristicLab.Core.Views;
  • trunk/sources/HeuristicLab.Operators.Views/3.3/HeuristicLab.Operators.Views-3.3.csproj

    r2773 r2796  
    7171    </Compile>
    7272    <Compile Include="HeuristicLabOperatorsViewsPlugin.cs" />
    73     <Compile Include="OperatorView.cs">
    74       <SubType>UserControl</SubType>
    75     </Compile>
    76     <Compile Include="OperatorView.Designer.cs">
    77       <DependentUpon>OperatorView.cs</DependentUpon>
    78     </Compile>
    7973    <Compile Include="Properties\AssemblyInfo.cs" />
    8074  </ItemGroup>
  • trunk/sources/HeuristicLab.Operators.Views/3.3/HeuristicLabOperatorsViewsPlugin.cs.frame

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

    r2790 r2796  
    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;
    2922using HeuristicLab.Core;
    3023using HeuristicLab.Core.Views;
  • trunk/sources/HeuristicLab.Operators.Views/3.3/ValuesCollectorView.cs

    r2790 r2796  
    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;
    2922using HeuristicLab.Core;
    3023using HeuristicLab.Core.Views;
  • trunk/sources/HeuristicLab.Operators/3.3/CombinedOperator.cs

    r2794 r2796  
    6666      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    6767      if (operatorGraph.InitialOperator != null)
    68         next.Insert(0, new ExecutionContext(ExecutionContext, operatorGraph.InitialOperator, ExecutionContext.Scope));
     68        next.Insert(0, ExecutionContext.CreateChildContext(operatorGraph.InitialOperator));
    6969      return next;
    7070    }
  • trunk/sources/HeuristicLab.Operators/3.3/ConditionalBranch.cs

    r2794 r2796  
    6161      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    6262      if (ConditionParameter.ActualValue.Value) {
    63         if (TrueBranch != null) next.Insert(0, new ExecutionContext(ExecutionContext.Parent, TrueBranch, ExecutionContext.Scope));
     63        if (TrueBranch != null) next.Insert(0, ExecutionContext.CreateContext(TrueBranch));
    6464      } else {
    65         if (FalseBranch != null) next.Insert(0, new ExecutionContext(ExecutionContext.Parent, FalseBranch, ExecutionContext.Scope));
     65        if (FalseBranch != null) next.Insert(0, ExecutionContext.CreateContext(FalseBranch));
    6666      }
    6767      return next;
  • trunk/sources/HeuristicLab.Operators/3.3/HeuristicLab.Operators-3.3.csproj

    r2794 r2796  
    108108    </Compile>
    109109    <Compile Include="HeuristicLabOperatorsPlugin.cs" />
    110     <Compile Include="Operator.cs" />
    111110    <Compile Include="Properties\AssemblyInfo.cs" />
    112111    <Compile Include="SingleSuccessorOperator.cs" />
  • trunk/sources/HeuristicLab.Operators/3.3/MultipleCallsOperator.cs

    r2794 r2796  
    110110      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    111111      for (int i = Operators.Count - 1; i >= 0; i--)
    112         next.Insert(0, new ExecutionContext(ExecutionContext.Parent, Operators[i], ExecutionContext.Scope));
     112        next.Insert(0, ExecutionContext.CreateContext(Operators[i]));
    113113      return next;
    114114    }
  • trunk/sources/HeuristicLab.Operators/3.3/ParallelSubScopesProcessor.cs

    r2794 r2796  
    3939        inner.Parallel = true;
    4040        for (int i = 0; (i < ExecutionContext.Scope.SubScopes.Count) && (i < Operators.Count); i++)
    41           inner.Add(new ExecutionContext(ExecutionContext.Parent, Operators[i], ExecutionContext.Scope.SubScopes[i]));
     41          inner.Add(ExecutionContext.CreateContext(Operators[i], ExecutionContext.Scope.SubScopes[i]));
    4242        next.Insert(0, inner);
    4343      }
  • trunk/sources/HeuristicLab.Operators/3.3/Placeholder.cs

    r2794 r2796  
    4545      IOperator op = OperatorParameter.ActualValue;
    4646      if (op != null)
    47         next.Insert(0, new ExecutionContext(ExecutionContext.Parent, op, ExecutionContext.Scope));
     47        next.Insert(0, ExecutionContext.CreateContext(op));
    4848      return next;
    4949    }
  • trunk/sources/HeuristicLab.Operators/3.3/SequentialSubScopesProcessor.cs

    r2794 r2796  
    3838        ExecutionContextCollection inner = new ExecutionContextCollection();
    3939        for (int i = 0; (i < ExecutionContext.Scope.SubScopes.Count) && (i < Operators.Count); i++)
    40           inner.Add(new ExecutionContext(ExecutionContext.Parent, Operators[i], ExecutionContext.Scope.SubScopes[i]));
     40          inner.Add(ExecutionContext.CreateContext(Operators[i], ExecutionContext.Scope.SubScopes[i]));
    4141        next.Insert(0, inner);
    4242      }
  • trunk/sources/HeuristicLab.Operators/3.3/SingleCallOperator.cs

    r2794 r2796  
    4848      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    4949      if (Operator != null)
    50         next.Insert(0, new ExecutionContext(ExecutionContext.Parent, Operator, ExecutionContext.Scope));
     50        next.Insert(0, ExecutionContext.CreateContext(Operator));
    5151      return next;
    5252    }
  • trunk/sources/HeuristicLab.Operators/3.3/SingleSuccessorOperator.cs

    r2794 r2796  
    4747    public override IExecutionSequence Apply() {
    4848      if (Successor != null)
    49         return new ExecutionContext(ExecutionContext.Parent, Successor, ExecutionContext.Scope);
     49        return ExecutionContext.CreateContext(Successor);
    5050      else
    5151        return null;
  • trunk/sources/HeuristicLab.Operators/3.3/StochasticBranch.cs

    r2794 r2796  
    6565      ExecutionContextCollection next = new ExecutionContextCollection(base.Apply());
    6666      if (RandomParameter.ActualValue.NextDouble() < ProbabilityParameter.ActualValue.Value) {
    67         if (FirstBranch != null) next.Insert(0, new ExecutionContext(ExecutionContext.Parent, FirstBranch, ExecutionContext.Scope));
     67        if (FirstBranch != null) next.Insert(0, ExecutionContext.CreateContext(FirstBranch));
    6868      } else {
    69         if (SecondBranch != null) next.Insert(0, new ExecutionContext(ExecutionContext.Parent, SecondBranch, ExecutionContext.Scope));
     69        if (SecondBranch != null) next.Insert(0, ExecutionContext.CreateContext(SecondBranch));
    7070      }
    7171      return next;
  • trunk/sources/HeuristicLab.Operators/3.3/UniformParallelSubScopesProcessor.cs

    r2794 r2796  
    4444        inner.Parallel = true;
    4545        for (int i = 0; i < ExecutionContext.Scope.SubScopes.Count; i++)
    46           inner.Add(new ExecutionContext(ExecutionContext.Parent, Operator, ExecutionContext.Scope.SubScopes[i]));
     46          inner.Add(ExecutionContext.CreateContext(Operator, ExecutionContext.Scope.SubScopes[i]));
    4747        next.Insert(0, inner);
    4848      }
  • trunk/sources/HeuristicLab.Operators/3.3/UniformSequentialSubScopesProcessor.cs

    r2794 r2796  
    4343        ExecutionContextCollection inner = new ExecutionContextCollection();
    4444        for (int i = 0; i < ExecutionContext.Scope.SubScopes.Count; i++)
    45           inner.Add(new ExecutionContext(ExecutionContext.Parent, Operator, ExecutionContext.Scope.SubScopes[i]));
     45          inner.Add(ExecutionContext.CreateContext(Operator, ExecutionContext.Scope.SubScopes[i]));
    4646        next.Insert(0, inner);
    4747      }
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/NewMenuItem.cs

    r2790 r2796  
    2323using System.Drawing;
    2424using System.Windows.Forms;
    25 using HeuristicLab.Common.Resources;
    2625
    2726namespace HeuristicLab.Optimizer.MenuItems {
     
    3736    }
    3837    public override Image Image {
    39       get { return Resources.NewIcon; }
     38      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument; }
    4039    }
    4140    public override Keys ShortCutKeys {
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OpenMenuItem.cs

    r2790 r2796  
    2323using System.Drawing;
    2424using System.Windows.Forms;
    25 using HeuristicLab.Common.Resources;
    2625
    2726namespace HeuristicLab.Optimizer.MenuItems {
     
    3736    }
    3837    public override Image Image {
    39       get { return Resources.OpenIcon; }
     38      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Open; }
    4039    }
    4140    public override Keys ShortCutKeys {
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs

    r2790 r2796  
    2525using System.Linq;
    2626using System.Windows.Forms;
    27 using HeuristicLab.Common.Resources;
    2827using HeuristicLab.Core;
    2928using HeuristicLab.MainForm;
     
    4140    }
    4241    public override Image Image {
    43       get { return Resources.SaveAllIcon; }
     42      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.SaveAll; }
    4443    }
    4544
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs

    r2790 r2796  
    2424using System.Drawing;
    2525using System.Windows.Forms;
    26 using HeuristicLab.Common.Resources;
    2726using HeuristicLab.Core;
    2827using HeuristicLab.MainForm;
     
    4039    }
    4140    public override Image Image {
    42       get { return Resources.SaveIcon; }
     41      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Save; }
    4342    }
    4443    public override Keys ShortCutKeys {
  • trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/NewToolBarItem.cs

    r2790 r2796  
    2121
    2222using System.Drawing;
    23 using HeuristicLab.Common.Resources;
    2423
    2524namespace HeuristicLab.Optimizer {
     
    3534    }
    3635    public override Image Image {
    37       get { return Resources.NewIcon; }
     36      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.NewDocument; }
    3837    }
    3938
  • trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/OpenToolBarItem.cs

    r2790 r2796  
    2121
    2222using System.Drawing;
    23 using HeuristicLab.Common.Resources;
    2423
    2524namespace HeuristicLab.Optimizer {
     
    3534    }
    3635    public override Image Image {
    37       get { return Resources.OpenIcon; }
     36      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Open; }
    3837    }
    3938
  • trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveAllToolBarItem.cs

    r2790 r2796  
    2424using System.Linq;
    2525using System.Windows.Forms;
    26 using HeuristicLab.Common.Resources;
    2726using HeuristicLab.Core;
    2827using HeuristicLab.MainForm;
     
    4039    }
    4140    public override Image Image {
    42       get { return Resources.SaveAllIcon; }
     41      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.SaveAll; }
    4342    }
    4443
  • trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveToolBarItem.cs

    r2790 r2796  
    2323using System.Drawing;
    2424using System.Windows.Forms;
    25 using HeuristicLab.Common.Resources;
    2625using HeuristicLab.Core;
    2726using HeuristicLab.MainForm;
     
    3938    }
    4039    public override Image Image {
    41       get { return Resources.SaveIcon; }
     40      get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Save; }
    4241    }
    4342
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.Designer.cs

    r2790 r2796  
    111111                  | System.Windows.Forms.AnchorStyles.Right)));
    112112      this.valuePanel.Controls.Add(this.viewHost);
    113       this.valuePanel.Location = new System.Drawing.Point(6, 48);
     113      this.valuePanel.Location = new System.Drawing.Point(6, 49);
    114114      this.valuePanel.Name = "valuePanel";
    115       this.valuePanel.Size = new System.Drawing.Size(374, 115);
     115      this.valuePanel.Size = new System.Drawing.Size(374, 114);
    116116      this.valuePanel.TabIndex = 0;
    117117      this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
     
    125125      this.viewHost.Location = new System.Drawing.Point(0, 0);
    126126      this.viewHost.Name = "viewHost";
    127       this.viewHost.Size = new System.Drawing.Size(374, 115);
     127      this.viewHost.Size = new System.Drawing.Size(374, 114);
    128128      this.viewHost.TabIndex = 0;
    129129      //
     
    132132      this.clearValueButton.Enabled = false;
    133133      this.clearValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    134       this.clearValueButton.Location = new System.Drawing.Point(35, 19);
     134      this.clearValueButton.Location = new System.Drawing.Point(36, 19);
    135135      this.clearValueButton.Name = "clearValueButton";
    136       this.clearValueButton.Size = new System.Drawing.Size(23, 23);
     136      this.clearValueButton.Size = new System.Drawing.Size(24, 24);
    137137      this.clearValueButton.TabIndex = 1;
    138138      this.toolTip.SetToolTip(this.clearValueButton, "Clear Value");
     
    145145      this.setValueButton.Location = new System.Drawing.Point(6, 19);
    146146      this.setValueButton.Name = "setValueButton";
    147       this.setValueButton.Size = new System.Drawing.Size(23, 23);
     147      this.setValueButton.Size = new System.Drawing.Size(24, 24);
    148148      this.setValueButton.TabIndex = 0;
    149149      this.toolTip.SetToolTip(this.setValueButton, "Set Value");
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.Designer.cs

    r2790 r2796  
    9797                  | System.Windows.Forms.AnchorStyles.Right)));
    9898      this.valuePanel.Controls.Add(this.viewHost);
    99       this.valuePanel.Location = new System.Drawing.Point(6, 48);
     99      this.valuePanel.Location = new System.Drawing.Point(6, 49);
    100100      this.valuePanel.Name = "valuePanel";
    101       this.valuePanel.Size = new System.Drawing.Size(374, 141);
     101      this.valuePanel.Size = new System.Drawing.Size(374, 140);
    102102      this.valuePanel.TabIndex = 0;
    103103      this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
     
    111111      this.viewHost.Location = new System.Drawing.Point(0, 0);
    112112      this.viewHost.Name = "viewHost";
    113       this.viewHost.Size = new System.Drawing.Size(374, 141);
     113      this.viewHost.Size = new System.Drawing.Size(374, 140);
    114114      this.viewHost.TabIndex = 0;
    115115      //
     
    118118      this.clearValueButton.Enabled = false;
    119119      this.clearValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    120       this.clearValueButton.Location = new System.Drawing.Point(35, 19);
     120      this.clearValueButton.Location = new System.Drawing.Point(36, 19);
    121121      this.clearValueButton.Name = "clearValueButton";
    122       this.clearValueButton.Size = new System.Drawing.Size(23, 23);
     122      this.clearValueButton.Size = new System.Drawing.Size(24, 24);
    123123      this.clearValueButton.TabIndex = 1;
    124124      this.toolTip.SetToolTip(this.clearValueButton, "Clear Value");
     
    131131      this.setValueButton.Location = new System.Drawing.Point(6, 19);
    132132      this.setValueButton.Name = "setValueButton";
    133       this.setValueButton.Size = new System.Drawing.Size(23, 23);
     133      this.setValueButton.Size = new System.Drawing.Size(24, 24);
    134134      this.setValueButton.TabIndex = 0;
    135135      this.toolTip.SetToolTip(this.setValueButton, "Set Value");
  • trunk/sources/HeuristicLab.Parameters/3.3/SubScopesLookupParameter.cs

    r2793 r2796  
    3333  /// </summary>
    3434  [Item("SubScopesLookupParameter<T>", "A generic parameter representing instances of type T which are collected from or written to the sub-scopes of the current scope.")]
    35   public class SubScopesLookupParameter<T> : Parameter, ILookupParameter<T> where T : class, IItem {
    36     [Storable]
    37     private string actualName;
    38     public string ActualName {
    39       get { return actualName; }
    40       set {
    41         if (value == null) throw new ArgumentNullException();
    42         if (!actualName.Equals(value)) {
    43           actualName = value;
    44           OnActualNameChanged();
    45         }
    46       }
    47     }
    48 
    49     public new ItemArray<T> ActualValue {
    50       get { return (ItemArray<T>)GetActualValue(); }
    51       set { SetActualValue(value); }
    52     }
    53 
    54     public SubScopesLookupParameter()
    55       : base("Anonymous", typeof(ItemArray<T>)) {
    56       actualName = Name;
    57     }
    58     public SubScopesLookupParameter(string name)
    59       : base(name, typeof(ItemArray<T>)) {
    60       actualName = Name;
    61     }
    62     public SubScopesLookupParameter(string name, string description)
    63       : base(name, description, typeof(ItemArray<T>)) {
    64       actualName = Name;
    65     }
    66 
    67     public override IDeepCloneable Clone(Cloner cloner) {
    68       SubScopesLookupParameter<T> clone = (SubScopesLookupParameter<T>)base.Clone(cloner);
    69       clone.actualName = actualName;
    70       return clone;
    71     }
    72 
    73     public override string ToString() {
    74       return string.Format("{0}: {1} ({2})", Name, ActualName, DataType.Name);
    75     }
     35  public class SubScopesLookupParameter<T> : LookupParameter<ItemArray<T>> where T : class, IItem {
     36    public SubScopesLookupParameter() : base() { }
     37    public SubScopesLookupParameter(string name) : base(name) { }
     38    public SubScopesLookupParameter(string name, string description) : base(name, description) { }
    7639
    7740    protected override IItem GetActualValue() {
     
    11578      }
    11679    }
    117 
    118     public event EventHandler ActualNameChanged;
    119     private void OnActualNameChanged() {
    120       if (ActualNameChanged != null)
    121         ActualNameChanged(this, EventArgs.Empty);
    122       OnChanged();
    123     }
    12480  }
    12581}
  • trunk/sources/HeuristicLab.Parameters/3.3/ValueLookupParameter.cs

    r2793 r2796  
    4747      }
    4848    }
     49    IItem IValueParameter.Value {
     50      get { return Value; }
     51      set {
     52        T val = value as T;
     53        if (val == null)
     54          throw new InvalidOperationException(
     55            string.Format("Type mismatch. Value is not a \"{0}\".",
     56                          typeof(T).GetPrettyName())
     57          );
     58        Value = val;
     59      }
     60    }
    4961
    5062    public ValueLookupParameter()
  • trunk/sources/HeuristicLab.Parameters/3.3/ValueParameter.cs

    r2793 r2796  
    4747      }
    4848    }
    49     public new T ActualValue {
     49    IItem IValueParameter.Value {
    5050      get { return Value; }
    51       set { Value = value; }
     51      set {
     52        T val = value as T;
     53        if (val == null)
     54          throw new InvalidOperationException(
     55            string.Format("Type mismatch. Value is not a \"{0}\".",
     56                          typeof(T).GetPrettyName())
     57          );
     58        Value = val;
     59      }
    5260    }
    5361
     
    8492    }
    8593    protected override void SetActualValue(IItem value) {
    86       T val = value as T;
    87       if (val == null)
    88         throw new InvalidOperationException(
    89           string.Format("Type mismatch. Value is not a \"{0}\".",
    90                         typeof(T).GetPrettyName())
    91         );
    92       Value = val;
     94      ((IValueParameter)this).Value = value;
    9395    }
    9496
  • trunk/sources/HeuristicLab.Routing.TSP/3.3/HeuristicLab.Routing.TSP-3.3.csproj

    r2790 r2796  
    8686  <ItemGroup>
    8787    <None Include="HeuristicLabRoutingTSPPlugin.cs.frame" />
     88    <Compile Include="TSP.cs" />
    8889    <Compile Include="HeuristicLabRoutingTSPPlugin.cs" />
    8990    <Compile Include="Properties\AssemblyInfo.cs" />
     91    <Compile Include="TSPParser.cs" />
    9092  </ItemGroup>
    9193  <ItemGroup>
    92     <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
    93       <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>
    94       <Name>HeuristicLab.Core.Views-3.3</Name>
     94    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
     95      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
     96      <Name>HeuristicLab.Collections-3.3</Name>
    9597    </ProjectReference>
    9698    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
     
    101103      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    102104      <Name>HeuristicLab.Data-3.3</Name>
    103     </ProjectReference>
    104     <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.2\HeuristicLab.MainForm.WindowsForms-3.2.csproj">
    105       <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
    106       <Name>HeuristicLab.MainForm.WindowsForms-3.2</Name>
    107     </ProjectReference>
    108     <ProjectReference Include="..\..\HeuristicLab.MainForm\3.2\HeuristicLab.MainForm-3.2.csproj">
    109       <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
    110       <Name>HeuristicLab.MainForm-3.2</Name>
    111105    </ProjectReference>
    112106    <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
  • trunk/sources/HeuristicLab.Routing.TSP/3.3/HeuristicLabRoutingTSPPlugin.cs.frame

    r2790 r2796  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
     
    3128  [Plugin("HeuristicLab.Routing.TSP", "3.3.0.$WCREV$")]
    3229  [PluginFile("HeuristicLab.Routing.TSP-3.3.dll", PluginFileType.Assembly)]
     30  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3331  [PluginDependency("HeuristicLab.Core", "3.3")]
    34   [PluginDependency("HeuristicLab.Core.Views", "3.3")]
    3532  [PluginDependency("HeuristicLab.Data", "3.3")]
    36   [PluginDependency("HeuristicLab.MainForm", "3.2")]
    37   [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.2")]
    3833  [PluginDependency("HeuristicLab.Operators", "3.3")]
    3934  [PluginDependency("HeuristicLab.Permutation", "3.3")]
  • trunk/sources/HeuristicLab.Routing.TSP/3.3/Properties/AssemblyInfo.frame

    r2790 r2796  
    2121
    2222using System.Reflection;
    23 using System.Runtime.CompilerServices;
    2423using System.Runtime.InteropServices;
    2524
  • trunk/sources/HeuristicLab.Routing.TSP/3.3/TSPParser.cs

    r1530 r2796  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
     23using System.Globalization;
    2524using System.IO;
    26 using System.Globalization;
    2725
    2826namespace HeuristicLab.Routing.TSP {
    2927  /// <summary>
    30   /// Parses a *.tsp file and extracts its information about a TSP.
     28  /// Parses a *.tsp file in the TSPLIB format and extracts its information about a TSP.
    3129  /// </summary>
    3230  public class TSPParser {
Note: See TracChangeset for help on using the changeset viewer.