Changeset 11529
- Timestamp:
- 11/10/14 02:34:58 (10 years ago)
- Location:
- branches/OptimizationNetworks
- Files:
-
- 4 added
- 13 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/GenericPortView.cs
r11528 r11529 66 66 protected override void OnContentChanged() { 67 67 base.OnContentChanged(); 68 portParameterCollectionView.Content = Content == null ? null : Content.Parameters; 68 69 connectedPortView.Content = Content == null ? null : Content.ConnectedPort; 69 70 portParameterCollectionView.Content = Content == null ? null : Content.Parameters; -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/UserDefinedNodeView.Designer.cs
r11527 r11529 21 21 22 22 namespace HeuristicLab.Core.Networks.Views { 23 partial class GenericNodeView {23 partial class UserDefinedNodeView { 24 24 /// <summary> 25 25 /// Required designer variable. -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Core.Networks.Views/UserDefinedNodeView.cs
r11527 r11529 24 24 25 25 namespace HeuristicLab.Core.Networks.Views { 26 [View(" GenericNode View")]27 [Content(typeof( GenericNode), true)]28 [Content(typeof(I GenericNode), false)]29 public partial class GenericNodeView : NodeView {30 public new I GenericNode Content {31 get { return (I GenericNode)base.Content; }26 [View("UserDefinedNode View")] 27 [Content(typeof(UserDefinedNode), true)] 28 [Content(typeof(IUserDefinedNode), false)] 29 public partial class UserDefinedNodeView : NodeView { 30 public new IUserDefinedNode Content { 31 get { return (IUserDefinedNode)base.Content; } 32 32 set { base.Content = value; } 33 33 } 34 34 35 public GenericNodeView() {35 public UserDefinedNodeView() { 36 36 InitializeComponent(); 37 37 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj
r11528 r11529 91 91 </ItemGroup> 92 92 <ItemGroup> 93 <Compile Include="Core.Networks.Views\GenericNodeView.cs">94 <SubType>UserControl</SubType>95 </Compile>96 <Compile Include="Core.Networks.Views\GenericNodeView.Designer.cs">97 <DependentUpon>GenericNodeView.cs</DependentUpon>98 </Compile>99 93 <Compile Include="Core.Networks.Views\GenericPortView.cs"> 100 94 <SubType>UserControl</SubType> … … 192 186 <Compile Include="Core.Networks.Views\PortView.Designer.cs"> 193 187 <DependentUpon>PortView.cs</DependentUpon> 188 </Compile> 189 <Compile Include="Core.Networks.Views\UserDefinedNetworkView.cs"> 190 <SubType>UserControl</SubType> 191 </Compile> 192 <Compile Include="Core.Networks.Views\UserDefinedNetworkView.Designer.cs"> 193 <DependentUpon>UserDefinedNetworkView.cs</DependentUpon> 194 </Compile> 195 <Compile Include="Core.Networks.Views\UserDefinedNodeView.cs"> 196 <SubType>UserControl</SubType> 197 </Compile> 198 <Compile Include="Core.Networks.Views\UserDefinedNodeView.Designer.cs"> 199 <DependentUpon>UserDefinedNodeView.cs</DependentUpon> 194 200 </Compile> 195 201 <Compile Include="Operators.Views\HookOperatorView.cs"> -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/GenericPort.cs
r11528 r11529 37 37 else return HeuristicLab.Common.Resources.VSImageLibrary.Error; 38 38 } 39 } 40 41 new public PortParameterCollection Parameters { 42 get { return base.Parameters; } 39 43 } 40 44 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IGenericPort.cs
r11526 r11529 27 27 namespace HeuristicLab.Core.Networks { 28 28 public interface IGenericPort : IParameterizedPort { 29 new PortParameterCollection Parameters { get; } 30 29 31 IConnectedPort ConnectedPort { get; set; } 30 32 bool PortConnectionValid { get; } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/INetwork.cs
r11526 r11529 22 22 namespace HeuristicLab.Core.Networks { 23 23 public interface INetwork : INode { 24 NodeCollectionNodes { get; }24 IKeyedItemCollection<string, INode> Nodes { get; } 25 25 } 26 26 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IParameterizedPort.cs
r11526 r11529 24 24 namespace HeuristicLab.Core.Networks { 25 25 public interface IParameterizedPort : IPort { 26 PortParameterCollectionParameters { get; }26 IKeyedItemCollection<string, IPortParameter> Parameters { get; } 27 27 28 28 event EventHandler InterfaceChanged; -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/IUserDefinedNode.cs
r11527 r11529 21 21 22 22 namespace HeuristicLab.Core.Networks { 23 public interface I GenericNode : INode {23 public interface IUserDefinedNode : INode { 24 24 new PortCollection Ports { get; } 25 25 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/Network.cs
r11528 r11529 27 27 28 28 namespace HeuristicLab.Core.Networks { 29 [Item("Network", "An optimization network.")] 30 [Creatable("Optimization Networks")] 29 [Item("Network", "Abstract base class for networks.")] 31 30 [StorableClass] 32 public class Network : Node, INetwork, IStorableContent {31 public abstract class Network : Node, INetwork, IStorableContent { 33 32 public string Filename { get; set; } 34 33 … … 43 42 [Storable] 44 43 private NodeCollection nodes; 45 p ublicNodeCollection Nodes {44 protected NodeCollection Nodes { 46 45 get { return nodes; } 46 } 47 private ReadOnlyKeyedItemCollection<string, INode> readOnlyNodes; 48 IKeyedItemCollection<string, INode> INetwork.Nodes { 49 get { 50 if (readOnlyNodes == null) readOnlyNodes = nodes.AsReadOnly(); 51 return readOnlyNodes; 52 } 47 53 } 48 54 … … 54 60 foreach (var n in Nodes) 55 61 n.Parent = this; 62 readOnlyNodes = null; 56 63 RegisterNodesEvents(); 57 64 } 58 p ublicNetwork()65 protected Network() 59 66 : base("Network") { 60 67 nodes = new NodeCollection(); 68 readOnlyNodes = null; 61 69 RegisterNodesEvents(); 62 70 } 63 p ublicNetwork(string name)71 protected Network(string name) 64 72 : base(name) { 65 73 nodes = new NodeCollection(); 74 readOnlyNodes = null; 66 75 RegisterNodesEvents(); 67 76 } 68 p ublicNetwork(string name, string description)77 protected Network(string name, string description) 69 78 : base(name, description) { 70 79 nodes = new NodeCollection(); 80 readOnlyNodes = null; 71 81 RegisterNodesEvents(); 72 82 } … … 77 87 n.Parent = this; 78 88 RegisterNodesEvents(); 79 }80 81 public override IDeepCloneable Clone(Cloner cloner) {82 return new Network(this, cloner);83 89 } 84 90 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/Node.cs
r11528 r11529 27 27 28 28 namespace HeuristicLab.Core.Networks { 29 [Item("Node", "A node of an optimizationnetwork.")]29 [Item("Node", "Abstract base class for nodes of a network.")] 30 30 [StorableClass] 31 public class Node : NetworkItem, INode {31 public abstract class Node : NetworkItem, INode { 32 32 public static new Image StaticItemImage { 33 33 get { return HeuristicLab.Common.Resources.VSImageLibrary.RadialChart; } … … 68 68 RegisterPortsEvents(); 69 69 } 70 p ublicNode()70 protected Node() 71 71 : base("Node") { 72 72 ports = new PortCollection(); … … 74 74 RegisterPortsEvents(); 75 75 } 76 p ublicNode(string name)76 protected Node(string name) 77 77 : base(name) { 78 78 ports = new PortCollection(); … … 80 80 RegisterPortsEvents(); 81 81 } 82 p ublicNode(string name, string description)82 protected Node(string name, string description) 83 83 : base(name, description) { 84 84 ports = new PortCollection(); … … 92 92 p.Parent = this; 93 93 RegisterPortsEvents(); 94 }95 96 public override IDeepCloneable Clone(Cloner cloner) {97 return new Node(this, cloner);98 94 } 99 95 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ParameterizedPort.cs
r11528 r11529 35 35 36 36 [Storable] 37 pr otectedPortParameterCollection parameters;38 p ublicPortParameterCollection Parameters {37 private PortParameterCollection parameters; 38 protected PortParameterCollection Parameters { 39 39 get { return parameters; } 40 } 41 private ReadOnlyKeyedItemCollection<string, IPortParameter> readOnlyParameters; 42 IKeyedItemCollection<string, IPortParameter> IParameterizedPort.Parameters { 43 get { 44 if (readOnlyParameters == null) readOnlyParameters = parameters.AsReadOnly(); 45 return readOnlyParameters; 46 } 40 47 } 41 48 … … 47 54 foreach (var p in Parameters) 48 55 p.Parent = this; 56 readOnlyParameters = null; 49 57 RegisterParametersEvents(); 50 58 } … … 52 60 : base("ParameterizedPort") { 53 61 parameters = new PortParameterCollection(); 62 readOnlyParameters = null; 54 63 RegisterParametersEvents(); 55 64 } … … 57 66 : base(name) { 58 67 parameters = new PortParameterCollection(); 68 readOnlyParameters = null; 59 69 RegisterParametersEvents(); 60 70 } … … 62 72 : base(name, description) { 63 73 parameters = new PortParameterCollection(); 74 readOnlyParameters = null; 64 75 RegisterParametersEvents(); 65 76 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/PortParameterType.cs
r11526 r11529 25 25 [Flags] 26 26 public enum PortParameterType { 27 None = 0,28 27 Input = 1, 29 28 Output = 2 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/UserDefinedNode.cs
r11527 r11529 24 24 25 25 namespace HeuristicLab.Core.Networks { 26 [Item(" GenericNode", "A generic node of an optimization network.")]26 [Item("User-Defined Node", "A node of a network which can be defined by the user.")] 27 27 [StorableClass] 28 public class GenericNode : Node, IGenericNode {28 public sealed class UserDefinedNode : Node, IUserDefinedNode { 29 29 new public PortCollection Ports { 30 30 get { return base.Ports; } … … 32 32 33 33 [StorableConstructor] 34 pr otected GenericNode(bool deserializing) : base(deserializing) { }35 pr otected GenericNode(GenericNode original, Cloner cloner) : base(original, cloner) { }36 public GenericNode() : base("GenericNode") { }37 public GenericNode(string name) : base(name) { }38 public GenericNode(string name, string description) : base(name, description) { }34 private UserDefinedNode(bool deserializing) : base(deserializing) { } 35 private UserDefinedNode(UserDefinedNode original, Cloner cloner) : base(original, cloner) { } 36 public UserDefinedNode() : base("UserDefinedNode") { } 37 public UserDefinedNode(string name) : base(name) { } 38 public UserDefinedNode(string name, string description) : base(name, description) { } 39 39 40 40 public override IDeepCloneable Clone(Cloner cloner) { 41 return new GenericNode(this, cloner);41 return new UserDefinedNode(this, cloner); 42 42 } 43 43 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj
r11528 r11529 90 90 </ItemGroup> 91 91 <ItemGroup> 92 <Compile Include="Core.Networks\GenericNode.cs" /> 92 <Compile Include="Core.Networks\IUserDefinedNetwork.cs" /> 93 <Compile Include="Core.Networks\IUserDefinedNode.cs" /> 94 <Compile Include="Core.Networks\UserDefinedNetwork.cs" /> 93 95 <Compile Include="Core.Networks\GenericPort.cs" /> 94 96 <Compile Include="Core.Networks\IConnectedPort.cs" /> 95 <Compile Include="Core.Networks\IGenericNode.cs" />96 97 <Compile Include="Core.Networks\IGenericPort.cs" /> 97 98 <Compile Include="Core.Networks\IMessage.cs" /> … … 117 118 <Compile Include="Core.Networks\PortParameterCollection.cs" /> 118 119 <Compile Include="Core.Networks\PortParameterType.cs" /> 120 <Compile Include="Core.Networks\UserDefinedNode.cs" /> 119 121 <Compile Include="Operators\HookOperator.cs" /> 120 122 <Compile Include="Operators\IHookOperator.cs" /> -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Optimization.Networks.KSPTSP/KSPTSPNetwork.cs
r11526 r11529 60 60 protected virtual void Initialize() { 61 61 #region ParametersNode 62 var paramsNode = new GenericNode("ParametersNode");62 var paramsNode = new UserDefinedNode("ParametersNode"); 63 63 Nodes.Add(paramsNode); 64 64 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Optimization.Networks/AlgorithmNode.cs
r11526 r11529 125 125 126 126 algorithm.StoreAlgorithmInEachRun = false; 127 algorithm.Runs.Clear(); 128 algorithm.Prepare(); 127 algorithm.Prepare(true); 129 128 algorithm.ExceptionOccurred += Algorithm_ExceptionOccurred; 130 129 algorithm.Stopped += Algorithm_Stopped;
Note: See TracChangeset
for help on using the changeset viewer.