Changeset 11563 for branches/OptimizationNetworks
- Timestamp:
- 11/22/14 04:50:37 (10 years ago)
- Location:
- branches/OptimizationNetworks
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj
r11530 r11563 187 187 <DependentUpon>PortView.cs</DependentUpon> 188 188 </Compile> 189 <Compile Include="Core.Networks.Views\ProgrammableNetworkItemView.cs"> 190 <SubType>UserControl</SubType> 191 </Compile> 192 <Compile Include="Core.Networks.Views\ProgrammableNetworkItemView.Designer.cs"> 193 <DependentUpon>ProgrammableNetworkItemView.cs</DependentUpon> 194 </Compile> 189 195 <Compile Include="Core.Networks.Views\UserDefinedNetworkView.cs"> 190 196 <SubType>UserControl</SubType> … … 226 232 </ItemGroup> 227 233 <ItemGroup> 234 <ProjectReference Include="..\..\HeuristicLab.CodeEditor\3.3\HeuristicLab.CodeEditor-3.3.csproj"> 235 <Project>{489cfe09-fdf7-4c89-bab5-bd09cadd61ad}</Project> 236 <Name>HeuristicLab.CodeEditor-3.3</Name> 237 <Private>False</Private> 238 </ProjectReference> 228 239 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 229 240 <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project> 230 241 <Name>HeuristicLab.Collections-3.3</Name> 242 <Private>False</Private> 231 243 </ProjectReference> 232 244 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 233 245 <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project> 234 246 <Name>HeuristicLab.Common.Resources-3.3</Name> 247 <Private>False</Private> 235 248 </ProjectReference> 236 249 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 237 250 <Project>{a9ad58b9-3ef9-4cc1-97e5-8d909039ff5c}</Project> 238 251 <Name>HeuristicLab.Common-3.3</Name> 252 <Private>False</Private> 239 253 </ProjectReference> 240 254 <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj"> 241 255 <Project>{e226881d-315f-423d-b419-a766fe0d8685}</Project> 242 256 <Name>HeuristicLab.Core.Views-3.3</Name> 257 <Private>False</Private> 243 258 </ProjectReference> 244 259 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 245 260 <Project>{c36bd924-a541-4a00-afa8-41701378ddc5}</Project> 246 261 <Name>HeuristicLab.Core-3.3</Name> 262 <Private>False</Private> 247 263 </ProjectReference> 248 264 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 249 265 <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project> 250 266 <Name>HeuristicLab.Data-3.3</Name> 267 <Private>False</Private> 251 268 </ProjectReference> 252 269 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj"> 253 270 <Project>{ab687bbe-1bfe-476b-906d-44237135431d}</Project> 254 271 <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name> 272 <Private>False</Private> 255 273 </ProjectReference> 256 274 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj"> 257 275 <Project>{3bd61258-31da-4b09-89c0-4f71fef5f05a}</Project> 258 276 <Name>HeuristicLab.MainForm-3.3</Name> 277 <Private>False</Private> 259 278 </ProjectReference> 260 279 <ProjectReference Include="..\..\HeuristicLab.Operators.Views\3.3\HeuristicLab.Operators.Views-3.3.csproj"> 261 280 <Project>{c49cb749-8b24-4628-8003-e86475749410}</Project> 262 281 <Name>HeuristicLab.Operators.Views-3.3</Name> 282 <Private>False</Private> 263 283 </ProjectReference> 264 284 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> 265 285 <Project>{23da7ff4-d5b8-41b6-aa96-f0561d24f3ee}</Project> 266 286 <Name>HeuristicLab.Operators-3.3</Name> 287 <Private>False</Private> 267 288 </ProjectReference> 268 289 <ProjectReference Include="..\..\HeuristicLab.Optimization.Networks\3.3\HeuristicLab.Optimization.Networks-3.3.csproj"> 269 290 <Project>{7cf51332-0e37-447c-8017-82a258c59ef2}</Project> 270 291 <Name>HeuristicLab.Optimization.Networks-3.3</Name> 292 <Private>False</Private> 271 293 </ProjectReference> 272 294 <ProjectReference Include="..\..\HeuristicLab.Optimization.Views\3.3\HeuristicLab.Optimization.Views-3.3.csproj"> 273 295 <Project>{662b4b15-8f4d-4ae5-b3eb-d91c215f5af2}</Project> 274 296 <Name>HeuristicLab.Optimization.Views-3.3</Name> 297 <Private>False</Private> 275 298 </ProjectReference> 276 299 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 277 300 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 278 301 <Name>HeuristicLab.Optimization-3.3</Name> 302 <Private>False</Private> 279 303 </ProjectReference> 280 304 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/Plugin.cs.frame
r11519 r11563 28 28 [Plugin("HeuristicLab.Optimization.Networks.Views", "3.3.11.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Optimization.Networks.Views-3.3.dll", PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.CodeEditor", "3.3")] 30 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 32 [PluginDependency("HeuristicLab.Common", "3.3")] -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNetworkItem.cs
r11562 r11563 24 24 using Microsoft.CSharp; 25 25 using System; 26 using System.CodeDom;27 26 using System.CodeDom.Compiler; 28 27 using System.Collections.Generic; … … 36 35 [Item("ProgrammableNetworkItem", "Abstract base class for programmable items of a network.")] 37 36 [StorableClass] 38 public abstract class ProgrammableNetworkItem : NetworkItem {37 public abstract class ProgrammableNetworkItem : NetworkItem, IProgrammableNetworkItem { 39 38 #region Item Properties 40 39 public static new Image StaticItemImage { … … 62 61 63 62 protected virtual string CodeTemplate { 64 get { return ReadCodeTemplate(" ProgrammableNetworkItemTemplate.cs"); }63 get { return ReadCodeTemplate("HeuristicLab.Optimization.Networks.Core.Networks.ProgrammableNetworkItemTemplate.cs"); } 65 64 } 66 65 … … 88 87 private INetworkItem compiledNetworkItem; 89 88 protected INetworkItem CompiledNetworkItem { 90 get { return compiledNetworkItem; } 89 get { 90 if (compiledNetworkItem == null) { 91 Compile(); 92 } 93 return compiledNetworkItem; 94 } 91 95 set { 92 96 if (compiledNetworkItem != value) { … … 152 156 .AppendLine(error.ErrorText); 153 157 } 154 throw new Exception(string.Format("Compilation of \"{0}\" failed:{1}{2}",158 throw new InvalidOperationException(string.Format("Compilation of \"{0}\" failed:{1}{2}", 155 159 Name, Environment.NewLine, sb.ToString())); 156 160 } 157 var assembly = results.CompiledAssembly; 158 compiledNetworkItem = (INetworkItem)Activator.CreateInstance(assembly.GetTypes().Single(x => typeof(CompiledProgrammableNetworkItem).IsAssignableFrom(x)), this); 161 CompiledNetworkItem = (INetworkItem)Activator.CreateInstance( 162 results.CompiledAssembly.GetTypes() 163 .Single(x => typeof(CompiledProgrammableNetworkItem) 164 .IsAssignableFrom(x)), 165 this); 166 } 167 public virtual IEnumerable<Assembly> GetAssemblies() { 168 return AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)); 159 169 } 160 170 #endregion … … 293 303 294 304 #region Helpers 295 protected virtual IEnumerable<Assembly> GetAssemblies() {296 foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) {297 bool valid = false;298 try {299 valid = File.Exists(a.Location);300 }301 catch (NotSupportedException) {302 // NotSupportedException is thrown while accessing303 // the Location property of the anonymously hosted304 // dynamic methods assembly, which is related to305 // LINQ queries306 }307 if (valid) yield return a;308 }309 }310 305 protected string ReadCodeTemplate(string templateName) { 311 306 using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(templateName)) -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNetworkItemTemplate.cs
r11562 r11563 1 #region License Information2 /* HeuristicLab3 * Copyright (C) 2002-2014 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 modify8 * it under the terms of the GNU General Public License as published by9 * the Free Software Foundation, either version 3 of the License, or10 * (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 of14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 * GNU General Public License for more details.16 *17 * You should have received a copy of the GNU General Public License18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.19 */20 #endregion21 22 1 using HeuristicLab.Common; 23 2 using System; … … 27 6 public class MyProgrammableNetworkItem : ProgrammableNetworkItem.CompiledProgrammableNetworkItem { 28 7 protected MyProgrammableNetworkItem(MyProgrammableNetworkItem original, Cloner cloner) : base(original, cloner) { } 29 p rotectedMyProgrammableNetworkItem(ProgrammableNetworkItem context) : base(context) { }8 public MyProgrammableNetworkItem(ProgrammableNetworkItem context) : base(context) { } 30 9 31 10 public override IDeepCloneable Clone(Cloner cloner) { -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNode.cs
r11562 r11563 31 31 public class ProgrammableNode : ProgrammableNetworkItem, INode { 32 32 protected override string CodeTemplate { 33 get { return ReadCodeTemplate(" ProgrammableNodeTemplate.cs"); }33 get { return ReadCodeTemplate("HeuristicLab.Optimization.Networks.Core.Networks.ProgrammableNodeTemplate.cs"); } 34 34 } 35 35 -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Core.Networks/ProgrammableNodeTemplate.cs
r11562 r11563 1 #region License Information2 /* HeuristicLab3 * Copyright (C) 2002-2014 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 modify8 * it under the terms of the GNU General Public License as published by9 * the Free Software Foundation, either version 3 of the License, or10 * (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 of14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 * GNU General Public License for more details.16 *17 * You should have received a copy of the GNU General Public License18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.19 */20 #endregion21 22 1 using HeuristicLab.Common; 23 2 using System; … … 28 7 public class MyProgrammableNode : ProgrammableNode.CompiledProgrammableNode { 29 8 protected MyProgrammableNode(MyProgrammableNode original, Cloner cloner) : base(original, cloner) { } 30 p rotectedMyProgrammableNode(ProgrammableNode context) : base(context) { }9 public MyProgrammableNode(ProgrammableNode context) : base(context) { } 31 10 32 11 public override IDeepCloneable Clone(Cloner cloner) { -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/HeuristicLab.Optimization.Networks-3.3.csproj
r11562 r11563 91 91 <ItemGroup> 92 92 <Compile Include="Core.Networks\IConnectablePort.cs" /> 93 <Compile Include="Core.Networks\IProgrammableNetworkItem.cs" /> 93 94 <Compile Include="Core.Networks\IUserDefinedMessagePort.cs" /> 94 95 <Compile Include="Core.Networks\IMessagePort.cs" /> … … 148 149 <Project>{a51da44f-cb35-4f6f-99f5-2a2e904ab93b}</Project> 149 150 <Name>HeuristicLab.Algorithms.GeneticAlgorithm-3.3</Name> 151 <Private>False</Private> 150 152 </ProjectReference> 151 153 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 152 154 <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project> 153 155 <Name>HeuristicLab.Collections-3.3</Name> 156 <Private>False</Private> 154 157 </ProjectReference> 155 158 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj"> 156 159 <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project> 157 160 <Name>HeuristicLab.Common.Resources-3.3</Name> 161 <Private>False</Private> 158 162 </ProjectReference> 159 163 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 160 164 <Project>{a9ad58b9-3ef9-4cc1-97e5-8d909039ff5c}</Project> 161 165 <Name>HeuristicLab.Common-3.3</Name> 166 <Private>False</Private> 162 167 </ProjectReference> 163 168 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 164 169 <Project>{c36bd924-a541-4a00-afa8-41701378ddc5}</Project> 165 170 <Name>HeuristicLab.Core-3.3</Name> 171 <Private>False</Private> 166 172 </ProjectReference> 167 173 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj"> 168 174 <Project>{bbab9df5-5ef3-4ba8-ade9-b36e82114937}</Project> 169 175 <Name>HeuristicLab.Data-3.3</Name> 176 <Private>False</Private> 170 177 </ProjectReference> 171 178 <ProjectReference Include="..\..\HeuristicLab.Encodings.BinaryVectorEncoding\3.3\HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj"> 172 179 <Project>{66d249c3-a01d-42a8-82a2-919bc8ec3d83}</Project> 173 180 <Name>HeuristicLab.Encodings.BinaryVectorEncoding-3.3</Name> 181 <Private>False</Private> 174 182 </ProjectReference> 175 183 <ProjectReference Include="..\..\HeuristicLab.Encodings.PermutationEncoding\3.3\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj"> 176 184 <Project>{dbecb8b0-b166-4133-baf1-ed67c3fd7fca}</Project> 177 185 <Name>HeuristicLab.Encodings.PermutationEncoding-3.3</Name> 186 <Private>False</Private> 178 187 </ProjectReference> 179 188 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> 180 189 <Project>{23da7ff4-d5b8-41b6-aa96-f0561d24f3ee}</Project> 181 190 <Name>HeuristicLab.Operators-3.3</Name> 191 <Private>False</Private> 182 192 </ProjectReference> 183 193 <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 184 194 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 185 195 <Name>HeuristicLab.Optimization-3.3</Name> 196 <Private>False</Private> 186 197 </ProjectReference> 187 198 <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj"> 188 199 <Project>{56f9106a-079f-4c61-92f6-86a84c2d84b7}</Project> 189 200 <Name>HeuristicLab.Parameters-3.3</Name> 201 <Private>False</Private> 190 202 </ProjectReference> 191 203 <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj"> 192 204 <Project>{102bc7d3-0ef9-439c-8f6d-96ff0fdb8e1b}</Project> 193 205 <Name>HeuristicLab.Persistence-3.3</Name> 206 <Private>False</Private> 194 207 </ProjectReference> 195 208 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj"> … … 201 214 <Project>{3540e29e-4793-49e7-8ee2-fea7f61c3994}</Project> 202 215 <Name>HeuristicLab.Problems.Instances-3.3</Name> 216 <Private>False</Private> 203 217 </ProjectReference> 204 218 <ProjectReference Include="..\..\HeuristicLab.Problems.Knapsack\3.3\HeuristicLab.Problems.Knapsack-3.3.csproj"> 205 219 <Project>{e10f395f-c8a6-48ad-b470-9aa7a1f43809}</Project> 206 220 <Name>HeuristicLab.Problems.Knapsack-3.3</Name> 221 <Private>False</Private> 207 222 </ProjectReference> 208 223 <ProjectReference Include="..\..\HeuristicLab.Problems.TravelingSalesman\3.3\HeuristicLab.Problems.TravelingSalesman-3.3.csproj"> 209 224 <Project>{d767c38d-8014-46b0-9a32-03a3aecce34a}</Project> 210 225 <Name>HeuristicLab.Problems.TravelingSalesman-3.3</Name> 226 <Private>False</Private> 211 227 </ProjectReference> 212 228 </ItemGroup>
Note: See TracChangeset
for help on using the changeset viewer.