Index: /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/AlgorithmServiceNodeView.Designer.cs
===================================================================
--- /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/AlgorithmServiceNodeView.Designer.cs	(revision 11463)
+++ /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/AlgorithmServiceNodeView.Designer.cs	(revision 11463)
@@ -0,0 +1,220 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+namespace HeuristicLab.Optimization.Networks.Views {
+  partial class AlgorithmServiceNodeView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AlgorithmServiceNodeView));
+      this.portCollectionView = new HeuristicLab.Optimization.Networks.Views.PortCollectionView();
+      this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
+      this.portsTabPage = new System.Windows.Forms.TabPage();
+      this.templateTabPage = new System.Windows.Forms.TabPage();
+      this.templatePanel = new System.Windows.Forms.Panel();
+      this.templateViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.clearTemplateButton = new System.Windows.Forms.Button();
+      this.setTemplateButton = new System.Windows.Forms.Button();
+      this.runsTabPage = new System.Windows.Forms.TabPage();
+      this.runCollectionView = new HeuristicLab.Optimization.Views.RunCollectionView();
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
+      this.tabControl.SuspendLayout();
+      this.portsTabPage.SuspendLayout();
+      this.templateTabPage.SuspendLayout();
+      this.templatePanel.SuspendLayout();
+      this.runsTabPage.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // nameTextBox
+      // 
+      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
+      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
+      // 
+      // portCollectionView
+      // 
+      this.portCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.portCollectionView.Caption = "PortCollection View";
+      this.portCollectionView.Content = null;
+      this.portCollectionView.Location = new System.Drawing.Point(6, 6);
+      this.portCollectionView.Name = "portCollectionView";
+      this.portCollectionView.ReadOnly = false;
+      this.portCollectionView.ShowDetails = true;
+      this.portCollectionView.Size = new System.Drawing.Size(625, 453);
+      this.portCollectionView.TabIndex = 0;
+      // 
+      // tabControl
+      // 
+      this.tabControl.AllowDrop = true;
+      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.tabControl.Controls.Add(this.portsTabPage);
+      this.tabControl.Controls.Add(this.templateTabPage);
+      this.tabControl.Controls.Add(this.runsTabPage);
+      this.tabControl.Location = new System.Drawing.Point(0, 26);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(645, 491);
+      this.tabControl.TabIndex = 3;
+      // 
+      // portsTabPage
+      // 
+      this.portsTabPage.Controls.Add(this.portCollectionView);
+      this.portsTabPage.Location = new System.Drawing.Point(4, 22);
+      this.portsTabPage.Name = "portsTabPage";
+      this.portsTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.portsTabPage.Size = new System.Drawing.Size(637, 465);
+      this.portsTabPage.TabIndex = 0;
+      this.portsTabPage.Text = "Ports";
+      this.portsTabPage.UseVisualStyleBackColor = true;
+      // 
+      // templateTabPage
+      // 
+      this.templateTabPage.Controls.Add(this.templatePanel);
+      this.templateTabPage.Controls.Add(this.clearTemplateButton);
+      this.templateTabPage.Controls.Add(this.setTemplateButton);
+      this.templateTabPage.Location = new System.Drawing.Point(4, 22);
+      this.templateTabPage.Name = "templateTabPage";
+      this.templateTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.templateTabPage.Size = new System.Drawing.Size(637, 465);
+      this.templateTabPage.TabIndex = 1;
+      this.templateTabPage.Text = "Algorithm Template";
+      this.templateTabPage.UseVisualStyleBackColor = true;
+      // 
+      // templatePanel
+      // 
+      this.templatePanel.AllowDrop = true;
+      this.templatePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.templatePanel.Controls.Add(this.templateViewHost);
+      this.templatePanel.Location = new System.Drawing.Point(6, 36);
+      this.templatePanel.Name = "templatePanel";
+      this.templatePanel.Size = new System.Drawing.Size(625, 423);
+      this.templatePanel.TabIndex = 2;
+      this.templatePanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.templatePanel_DragDrop);
+      this.templatePanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.templatePanel_DragEnterOver);
+      this.templatePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.templatePanel_DragEnterOver);
+      // 
+      // templateViewHost
+      // 
+      this.templateViewHost.Caption = "View";
+      this.templateViewHost.Content = null;
+      this.templateViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.templateViewHost.Enabled = false;
+      this.templateViewHost.Location = new System.Drawing.Point(0, 0);
+      this.templateViewHost.Name = "templateViewHost";
+      this.templateViewHost.ReadOnly = false;
+      this.templateViewHost.Size = new System.Drawing.Size(625, 423);
+      this.templateViewHost.TabIndex = 0;
+      this.templateViewHost.ViewsLabelVisible = true;
+      this.templateViewHost.ViewType = null;
+      // 
+      // clearTemplateButton
+      // 
+      this.clearTemplateButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Remove;
+      this.clearTemplateButton.Location = new System.Drawing.Point(36, 6);
+      this.clearTemplateButton.Name = "clearTemplateButton";
+      this.clearTemplateButton.Size = new System.Drawing.Size(24, 24);
+      this.clearTemplateButton.TabIndex = 1;
+      this.clearTemplateButton.UseVisualStyleBackColor = true;
+      this.clearTemplateButton.Click += new System.EventHandler(this.clearTemplateButton_Click);
+      // 
+      // setTemplateButton
+      // 
+      this.setTemplateButton.Image =HeuristicLab.Common.Resources.VSImageLibrary.Edit;
+      this.setTemplateButton.Location = new System.Drawing.Point(6, 6);
+      this.setTemplateButton.Name = "setTemplateButton";
+      this.setTemplateButton.Size = new System.Drawing.Size(24, 24);
+      this.setTemplateButton.TabIndex = 0;
+      this.setTemplateButton.UseVisualStyleBackColor = true;
+      this.setTemplateButton.Click += new System.EventHandler(this.setTemplateButton_Click);
+      // 
+      // runsTabPage
+      // 
+      this.runsTabPage.Controls.Add(this.runCollectionView);
+      this.runsTabPage.Location = new System.Drawing.Point(4, 22);
+      this.runsTabPage.Name = "runsTabPage";
+      this.runsTabPage.Size = new System.Drawing.Size(637, 465);
+      this.runsTabPage.TabIndex = 2;
+      this.runsTabPage.Text = "Runs";
+      this.runsTabPage.UseVisualStyleBackColor = true;
+      // 
+      // runCollectionView
+      // 
+      this.runCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.runCollectionView.Caption = "RunCollection View";
+      this.runCollectionView.Content = null;
+      this.runCollectionView.Location = new System.Drawing.Point(3, 3);
+      this.runCollectionView.Name = "runCollectionView";
+      this.runCollectionView.ReadOnly = false;
+      this.runCollectionView.Size = new System.Drawing.Size(631, 459);
+      this.runCollectionView.TabIndex = 0;
+      // 
+      // AlgorithmServiceNodeView
+      // 
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.tabControl);
+      this.Name = "AlgorithmServiceNodeView";
+      this.Controls.SetChildIndex(this.nameLabel, 0);
+      this.Controls.SetChildIndex(this.nameTextBox, 0);
+      this.Controls.SetChildIndex(this.infoLabel, 0);
+      this.Controls.SetChildIndex(this.tabControl, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
+      this.tabControl.ResumeLayout(false);
+      this.portsTabPage.ResumeLayout(false);
+      this.templateTabPage.ResumeLayout(false);
+      this.templatePanel.ResumeLayout(false);
+      this.runsTabPage.ResumeLayout(false);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    protected PortCollectionView portCollectionView;
+    protected System.Windows.Forms.TabPage portsTabPage;
+    protected System.Windows.Forms.Button setTemplateButton;
+    protected System.Windows.Forms.Button clearTemplateButton;
+    protected System.Windows.Forms.Panel templatePanel;
+    protected HeuristicLab.MainForm.WindowsForms.DragOverTabControl tabControl;
+    protected System.Windows.Forms.TabPage templateTabPage;
+    protected MainForm.WindowsForms.ViewHost templateViewHost;
+    protected System.Windows.Forms.TabPage runsTabPage;
+    private Optimization.Views.RunCollectionView runCollectionView;
+
+
+  }
+}
Index: /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/AlgorithmServiceNodeView.cs
===================================================================
--- /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/AlgorithmServiceNodeView.cs	(revision 11463)
+++ /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/AlgorithmServiceNodeView.cs	(revision 11463)
@@ -0,0 +1,130 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Core.Views;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+using System;
+using System.Windows.Forms;
+
+namespace HeuristicLab.Optimization.Networks.Views {
+  [View("AlgorithmServiceNode View")]
+  [Content(typeof(AlgorithmServiceNode), true)]
+  [Content(typeof(IAlgorithmServiceNode), false)]
+  public partial class AlgorithmServiceNodeView : EntityView {
+    protected TypeSelectorDialog typeSelectorDialog;
+
+    public new IAlgorithmServiceNode Content {
+      get { return (IAlgorithmServiceNode)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public AlgorithmServiceNodeView() {
+      InitializeComponent();
+    }
+
+    protected override void Dispose(bool disposing) {
+      if (disposing) {
+        if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
+        if (components != null) components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    protected override void DeregisterContentEvents() {
+      Content.TemplateChanged -= Content_TemplateChanged;
+      base.DeregisterContentEvents();
+    }
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.TemplateChanged += Content_TemplateChanged;
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content == null) {
+        portCollectionView.Content = null;
+        templateViewHost.Content = null;
+        runCollectionView.Content = null;
+      } else {
+        portCollectionView.Content = Content.Ports;
+        templateViewHost.ViewType = null;
+        templateViewHost.Content = Content.Template;
+        runCollectionView.Content = Content.Runs;
+      }
+    }
+
+    protected override void SetEnabledStateOfControls() {
+      base.SetEnabledStateOfControls();
+      portCollectionView.Enabled = Content != null && !ReadOnly;
+      setTemplateButton.Enabled = Content != null && !ReadOnly;
+      clearTemplateButton.Enabled = Content != null && Content.Template != null && !ReadOnly;
+      templatePanel.Enabled = Content != null;
+      runCollectionView.Enabled = Content != null && !ReadOnly;
+    }
+
+    protected virtual void Content_TemplateChanged(object sender, System.EventArgs e) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(Content_TemplateChanged), sender, e);
+      else {
+        clearTemplateButton.Enabled = Content.Template != null && !ReadOnly;
+        templateViewHost.ViewType = null;
+        templateViewHost.Content = Content.Template;
+      }
+    }
+
+    protected virtual void setTemplateButton_Click(object sender, EventArgs e) {
+      if (typeSelectorDialog == null) {
+        typeSelectorDialog = new TypeSelectorDialog();
+        typeSelectorDialog.Caption = "Select Algorithm Template";
+        typeSelectorDialog.TypeSelector.Configure(typeof(IAlgorithm), false, true);
+      }
+      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK) {
+        try {
+          Content.Template = (IAlgorithm)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
+        }
+        catch (Exception ex) {
+          ErrorHandling.ShowErrorDialog(this, ex);
+        }
+      }
+    }
+    protected virtual void clearTemplateButton_Click(object sender, EventArgs e) {
+      Content.Template = null;
+    }
+    protected virtual void templatePanel_DragEnterOver(object sender, DragEventArgs e) {
+      e.Effect = DragDropEffects.None;
+      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IAlgorithm)) {
+        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
+        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
+        else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
+        else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move;
+        else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link;
+      }
+    }
+    protected virtual void templatePanel_DragDrop(object sender, DragEventArgs e) {
+      if (e.Effect != DragDropEffects.None) {
+        IAlgorithm alg = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IAlgorithm;
+        if (e.Effect.HasFlag(DragDropEffects.Copy)) alg = (IAlgorithm)alg.Clone();
+        Content.Template = alg;
+      }
+    }
+  }
+}
Index: /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj
===================================================================
--- /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj	(revision 11462)
+++ /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj	(revision 11463)
@@ -85,4 +85,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="AlgorithmServiceNodeView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="AlgorithmServiceNodeView.Designer.cs">
+      <DependentUpon>AlgorithmServiceNodeView.cs</DependentUpon>
+    </Compile>
     <Compile Include="EntitySelector.cs">
       <SubType>UserControl</SubType>
@@ -216,4 +222,8 @@
       <Name>HeuristicLab.Core-3.3</Name>
     </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
+      <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project>
+      <Name>HeuristicLab.Data-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">
       <Project>{ab687bbe-1bfe-476b-906d-44237135431d}</Project>
@@ -227,4 +237,8 @@
       <Project>{7cf51332-0e37-447c-8017-82a258c59ef2}</Project>
       <Name>HeuristicLab.Optimization.Networks-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj">
+      <Project>{662b4b15-8f4d-4ae5-b3eb-d91c215f5af2}</Project>
+      <Name>HeuristicLab.Optimization.Views-3.3</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
Index: /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Plugin.cs.frame
===================================================================
--- /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Plugin.cs.frame	(revision 11462)
+++ /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Plugin.cs.frame	(revision 11463)
@@ -33,7 +33,9 @@
   [PluginDependency("HeuristicLab.Core", "3.3")]
   [PluginDependency("HeuristicLab.Core.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
   [PluginDependency("HeuristicLab.MainForm", "3.3")]
   [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
   [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization.Views", "3.3")]
   [PluginDependency("HeuristicLab.Optimization.Networks", "3.3")]
   public class HeuristicLabOptimizationNetworksViewsPlugin : PluginBase {
Index: /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/AlgorithmServiceNode.cs
===================================================================
--- /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/AlgorithmServiceNode.cs	(revision 11463)
+++ /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/AlgorithmServiceNode.cs	(revision 11463)
@@ -0,0 +1,228 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+
+namespace HeuristicLab.Optimization.Networks {
+  [Item("AlgorithmServiceNode", "A node of an optimization network which provides a HeuristicLab algorithm as a service.")]
+  [StorableClass]
+  public class AlgorithmServiceNode : Node, IAlgorithmServiceNode {
+    private object locker = new object();
+    private Dictionary<IAlgorithm, AutoResetEvent> waitHandles = new Dictionary<IAlgorithm,AutoResetEvent>();
+
+    new public PortCollection Ports {
+      get { return base.Ports; }
+    }
+
+    [Storable]
+    private IAlgorithm template;
+    public IAlgorithm Template {
+      get { return template; }
+      set {
+        if (value != template) {
+          template = value;
+          OnTemplateChanged();
+        }
+      }
+    }
+
+    [Storable]
+    private RunCollection runs;
+    public RunCollection Runs {
+      get { return runs; }
+    }
+
+    [StorableConstructor]
+    protected AlgorithmServiceNode(bool deserializing) : base(deserializing) { }
+    protected AlgorithmServiceNode(AlgorithmServiceNode original, Cloner cloner)
+      : base(original, cloner) {
+      template = cloner.Clone(original.template);
+      runs = cloner.Clone(original.runs);
+      RegisterPortsEvents();
+    }
+    public AlgorithmServiceNode()
+      : base("AlgorithmServiceNode") {
+      runs = new RunCollection();
+      RegisterPortsEvents();
+    }
+    public AlgorithmServiceNode(string name)
+      : base(name) {
+      runs = new RunCollection();
+      RegisterPortsEvents();
+    }
+    public AlgorithmServiceNode(string name, string description)
+      : base(name, description) {
+      runs = new RunCollection();
+      RegisterPortsEvents();
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      RegisterPortsEvents();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AlgorithmServiceNode(this, cloner);
+    }
+
+    private void UpdateParameter(IInputPort port) {
+      if (template != null) {
+        IParameter param = null;
+        if (template.Parameters.TryGetValue(port.Name, out param)) {
+          IValueParameter p = param as IValueParameter;
+          if ((p != null) && (port.Value != null)) {
+            p.Value = (IItem)port.Value;
+          }
+        }
+      }
+    }
+
+    protected virtual void Execute(ServiceParameterCollection parameters) {
+      if (Template == null) throw new InvalidOperationException("Template is null");
+
+      IAlgorithm algorithm;
+      lock (locker) {
+        algorithm = (IAlgorithm)Template.Clone();
+        waitHandles.Add(algorithm, new AutoResetEvent(false));
+      }
+
+      // set parameters
+      foreach (var p in parameters.Where(x => x.Type == ServiceParameterType.Input)) {
+        IParameter param = null;
+        if (algorithm.Parameters.TryGetValue(p.Name, out param)) {
+          var v = param as IValueParameter;
+          if (v != null) v.Value = p.Value;
+        }
+        if (algorithm.Problem.Parameters.TryGetValue(p.Name, out param)) {
+          var v = param as IValueParameter;
+          if (v != null) v.Value = p.Value;
+        }
+      }
+
+      algorithm.StoreAlgorithmInEachRun = false;
+      algorithm.Runs.Clear();
+      algorithm.Prepare();
+      algorithm.Stopped += Algorithm_Stopped;
+      algorithm.Start();
+      waitHandles[algorithm].WaitOne();
+
+      // retrieve results
+      foreach (var p in parameters.Where(x => x.Type == ServiceParameterType.Output)) {
+        IResult result = null;
+        if (algorithm.Results.TryGetValue(p.Name, out result)) {
+          p.Value = result.Value;
+        }
+      }
+
+      lock (locker) {
+        waitHandles[algorithm].Dispose();
+        waitHandles.Remove(algorithm);
+        Runs.Add(algorithm.Runs.ToArray()[0]);
+      }
+    }
+
+    private void Algorithm_Stopped(object sender, EventArgs e) {
+      lock (locker) {
+        waitHandles[(IAlgorithm)sender].Set();
+      }
+    }
+
+    public event EventHandler TemplateChanged;
+    protected virtual void OnTemplateChanged() {
+      var handler = TemplateChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    #region Ports Events
+    protected override void RegisterPortsEvents() {
+      base.RegisterPortsEvents();
+      foreach (var p in Ports)
+        RegisterPortEvents(p);
+    }
+    protected override void Ports_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IPort> e) {
+      base.Ports_ItemsAdded(sender, e);
+      foreach (var p in e.Items)
+        RegisterPortEvents(p);
+    }
+    protected override void Ports_ItemsRemoved(object sender, Collections.CollectionItemsChangedEventArgs<IPort> e) {
+      base.Ports_ItemsRemoved(sender, e);
+      foreach (var p in e.Items)
+        DeregisterPortEvents(p);
+    }
+    protected override void Ports_ItemsReplaced(object sender, Collections.CollectionItemsChangedEventArgs<IPort> e) {
+      base.Ports_ItemsReplaced(sender, e);
+      foreach (var p in e.OldItems)
+        DeregisterPortEvents(p);
+      foreach (var p in e.Items)
+        RegisterPortEvents(p);
+    }
+    protected override void Ports_CollectionReset(object sender, Collections.CollectionItemsChangedEventArgs<IPort> e) {
+      base.Ports_CollectionReset(sender, e);
+      foreach (var p in e.OldItems)
+        DeregisterPortEvents(p);
+      foreach (var p in e.Items)
+        RegisterPortEvents(p);
+    }
+    #endregion
+
+    #region Port Events
+    private void RegisterPortEvents(IPort port) {
+      IInputPort i = port as IInputPort;
+      if (i != null) {
+        i.NameChanged += InputPort_NameChanged;
+        i.ValueChanged += InputPort_ValueChanged;
+        UpdateParameter(i);
+      }
+      IServicePort s = port as IServicePort;
+      if (s != null) {
+        s.Called += ServicePort_Called;
+      }
+    }
+
+    private void DeregisterPortEvents(IPort port) {
+      IInputPort i = port as IInputPort;
+      if (i != null) {
+        i.NameChanged -= InputPort_NameChanged;
+        i.ValueChanged -= InputPort_ValueChanged;
+      }
+      IServicePort s = port as IServicePort;
+      if (s != null) {
+        s.Called -= ServicePort_Called;
+      }
+    }
+    private void InputPort_NameChanged(object sender, EventArgs e) {
+      UpdateParameter((IInputPort)sender);
+    }
+    private void InputPort_ValueChanged(object sender, EventArgs e) {
+      UpdateParameter((IInputPort)sender);
+    }
+    private void ServicePort_Called(object sender, EventArgs<ServiceParameterCollection> e) {
+      Execute(e.Value);
+    }
+    #endregion
+  }
+}
Index: /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj
===================================================================
--- /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj	(revision 11462)
+++ /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj	(revision 11463)
@@ -84,4 +84,6 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="AlgorithmServiceNode.cs" />
+    <Compile Include="IAlgorithmServiceNode.cs" />
     <Compile Include="IEntity.cs" />
     <Compile Include="IClientPort.cs" />
Index: /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IAlgorithmNode.cs
===================================================================
--- /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IAlgorithmNode.cs	(revision 11462)
+++ /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IAlgorithmNode.cs	(revision 11463)
@@ -25,6 +25,6 @@
   public interface IAlgorithmNode : INode {
     new PortCollection Ports { get; }
+    IAlgorithm Algorithm { get; set; }
 
-    IAlgorithm Algorithm { get; set; }
     event EventHandler AlgorithmChanged;
   }
Index: /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IAlgorithmServiceNode.cs
===================================================================
--- /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IAlgorithmServiceNode.cs	(revision 11463)
+++ /branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/IAlgorithmServiceNode.cs	(revision 11463)
@@ -0,0 +1,32 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.Optimization.Networks {
+  public interface IAlgorithmServiceNode : INode {
+    new PortCollection Ports { get; }
+    IAlgorithm Template { get; set; }
+    RunCollection Runs { get; }
+
+    event EventHandler TemplateChanged;
+  }
+}
