Changeset 11554 for branches/OptimizationNetworks
- Timestamp:
- 11/17/14 03:22:32 (10 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Operators/HookOperator.cs
r11530 r11554 51 51 protected HookOperator(HookOperator original, Cloner cloner) 52 52 : base(original, cloner) { 53 // ATTENTION: port is intentionally NOT cloned 54 port = original.port; 53 port = cloner.Clone(original.port); 55 54 } 56 55 public HookOperator() : base() { } … … 73 72 if (Parameters.TryGetValue(output.Name, out param)) { 74 73 msg[output.Name] = param.ActualValue; 74 } else if (output.DefaultValue == null) { 75 throw new InvalidOperationException(string.Format("Cannot determine value for output parameter \"{0}\".", output.Name)); 75 76 } 76 77 } … … 82 83 if (Parameters.TryGetValue(input.Name, out param)) { 83 84 param.ActualValue = msg[input.Name]; 85 } else { 86 throw new InvalidOperationException(string.Format("Cannot find operator parameter for input parameter \"{0}\".", input.Name)); 84 87 } 85 88 } -
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks/3.3/Optimization.Networks/AlgorithmNode.cs
r11529 r11554 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Core.Networks; 25 using HeuristicLab.Operators; 25 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 27 using System; … … 107 108 IAlgorithm algorithm; 108 109 lock (locker) { 109 algorithm = (IAlgorithm)Algorithm.Clone(); 110 // prevent cloning of ports in hook operators 111 var cloner = new Cloner(); 112 foreach (var hook in Algorithm.GetObjectGraphObjects(new HashSet<object>() { Algorithm.Results, Algorithm.Runs }).OfType<IHookOperator>()) { 113 cloner.RegisterClonedObject(hook.Port, hook.Port); 114 } 115 algorithm = (IAlgorithm)Algorithm.Clone(cloner); 110 116 waitHandles.Add(algorithm, new AutoResetEvent(false)); 111 117 }
Note: See TracChangeset
for help on using the changeset viewer.