- Timestamp:
- 11/03/14 01:15:46 (10 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj
r11519 r11520 109 109 <Compile Include="### obsolete\ServiceParameterCollection.cs" /> 110 110 <Compile Include="IHookOperator.cs" /> 111 <Compile Include="Nodes\KSPTSPNetwork.cs" /> 111 112 <Compile Include="Nodes\KSPTSPConnector.cs" /> 112 113 <Compile Include="Nodes\GenericNode.cs" /> … … 163 164 </ItemGroup> 164 165 <ItemGroup> 166 <ProjectReference Include="..\..\HeuristicLab.Algorithms.GeneticAlgorithm\3.3\HeuristicLab.Algorithms.GeneticAlgorithm-3.3.csproj"> 167 <Project>{a51da44f-cb35-4f6f-99f5-2a2e904ab93b}</Project> 168 <Name>HeuristicLab.Algorithms.GeneticAlgorithm-3.3</Name> 169 </ProjectReference> 165 170 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 166 171 <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project> … … 198 203 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 199 204 <Name>HeuristicLab.Optimization-3.3</Name> 205 </ProjectReference> 206 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 207 <Project>{56f9106a-079f-4c61-92f6-86a84c2d84b7}</Project> 208 <Name>HeuristicLab.Parameters-3.3</Name> 200 209 </ProjectReference> 201 210 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> … … 207 216 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 208 217 <Private>False</Private> 218 </ProjectReference> 219 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 220 <Project>{3540e29e-4793-49e7-8ee2-fea7f61c3994}</Project> 221 <Name>HeuristicLab.Problems.Instances-3.3</Name> 222 </ProjectReference> 223 <ProjectReference Include="..\..\HeuristicLab.Problems.Knapsack\3.3\HeuristicLab.Problems.Knapsack-3.3.csproj"> 224 <Project>{e10f395f-c8a6-48ad-b470-9aa7a1f43809}</Project> 225 <Name>HeuristicLab.Problems.Knapsack-3.3</Name> 226 </ProjectReference> 227 <ProjectReference Include="..\..\HeuristicLab.Problems.TravelingSalesman\3.3\HeuristicLab.Problems.TravelingSalesman-3.3.csproj"> 228 <Project>{d767c38d-8014-46b0-9a32-03a3aecce34a}</Project> 229 <Name>HeuristicLab.Problems.TravelingSalesman-3.3</Name> 209 230 </ProjectReference> 210 231 </ItemGroup> -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Nodes/KSPTSPConnector.cs
r11519 r11520 25 25 using HeuristicLab.Encodings.BinaryVectorEncoding; 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 using HeuristicLab.Problems.TravelingSalesman; 27 28 using System.Linq; 28 29 … … 33 34 [StorableConstructor] 34 35 protected KSPTSPConnector(bool deserializing) : base(deserializing) { } 35 protected KSPTSPConnector(KSPTSPConnector original, Cloner cloner) : base(original, cloner) { } 36 protected KSPTSPConnector(KSPTSPConnector original, Cloner cloner) 37 : base(original, cloner) { 38 RegisterEvents(); 39 } 36 40 public KSPTSPConnector() 37 41 : base("KSPTSPConnector") { 38 42 Initialize(); 43 RegisterEvents(); 39 44 } 40 45 public KSPTSPConnector(string name) 41 46 : base(name) { 42 47 Initialize(); 48 RegisterEvents(); 43 49 } 44 50 public KSPTSPConnector(string name, string description) 45 51 : base(name, description) { 46 52 Initialize(); 53 RegisterEvents(); 54 } 55 56 [StorableHook(HookType.AfterDeserialization)] 57 private void AfterDeserialization() { 58 RegisterEvents(); 47 59 } 48 60 … … 62 74 ksp.Parameters.Add(new PortParameter<DoubleValue>("Quality") { Type = PortParameterType.Input | PortParameterType.Output }); 63 75 ksp.Parameters.Add(new PortParameter<DoubleValue>("TransportCosts") { Type = PortParameterType.Output }); 64 ksp. MessageReceived += Knapsack_MessageReceived;76 ksp.Parameters.Add(new PortParameter<PathTSPTour>("Route") { Type = PortParameterType.Output }); 65 77 66 78 var tsp = new GenericPort("TSP Connector"); 67 79 Ports.Add(tsp); 68 80 tsp.Parameters.Add(new PortParameter<DoubleMatrix>("Coordinates") { Type = PortParameterType.Output }); 69 ksp.Parameters.Add(new PortParameter<DoubleValue>("BestQuality") { Type = PortParameterType.Input }); 81 tsp.Parameters.Add(new PortParameter<PathTSPTour>("Best TSP Solution") { Type = PortParameterType.Input }); 82 tsp.Parameters.Add(new PortParameter<DoubleValue>("BestQuality") { Type = PortParameterType.Input }); 83 } 84 85 protected virtual void RegisterEvents() { 86 var ksp = (IGenericPort)Ports["KSP Connector"]; 87 ksp.MessageReceived += Knapsack_MessageReceived; 70 88 } 71 89 … … 97 115 tspMsg["Coordinates"] = coords; 98 116 tspConnectorPort.SendMessage(tspMsg, e.Value2); 117 var tspSolution = (PathTSPTour)tspMsg["Best TSP Solution"]; 99 118 var tspQuality = ((DoubleValue)tspMsg["BestQuality"]).Value; 100 119 … … 102 121 ((DoubleValue)kspMsg["Quality"]).Value = kspQuality - factor * tspQuality; 103 122 kspMsg["TransportCosts"] = new DoubleValue(factor * tspQuality); 123 kspMsg["Route"] = tspSolution; 104 124 } 105 125 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Plugin.cs.frame
r11519 r11520 28 28 [Plugin("HeuristicLab.Optimization.Networks", "3.3.11.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Optimization.Networks-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Algorithms.GeneticAlgorithm", "3.3")] 30 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 32 [PluginDependency("HeuristicLab.Common", "3.3")] … … 37 38 [PluginDependency("HeuristicLab.Operators", "3.3")] 38 39 [PluginDependency("HeuristicLab.Optimization", "3.3")] 40 [PluginDependency("HeuristicLab.Parameters", "3.3")] 39 41 [PluginDependency("HeuristicLab.Persistence", "3.3")] 42 [PluginDependency("HeuristicLab.Problems.Knapsack", "3.3")] 43 [PluginDependency("HeuristicLab.Problems.TravelingSalesman", "3.3")] 40 44 public class HeuristicLabOptimizationNetworksPlugin : PluginBase { 41 45 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Ports/GenericPort.cs
r11519 r11520 180 180 message.Values.AddRange( 181 181 ConnectedPort.Parameters. 182 Where(p => p.Type.HasFlag(PortParameterType.Output) ).182 Where(p => p.Type.HasFlag(PortParameterType.Output) && !message.Values.ContainsKey(p.Name)). 183 183 Select(p => p.CreateMessageValue()) 184 184 );
Note: See TracChangeset
for help on using the changeset viewer.