Changeset 14613
- Timestamp:
- 01/26/17 15:44:04 (8 years ago)
- Location:
- branches/OptimizationNetworks
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.LocationRouting/3.3/LrpNetwork1.cs
r14610 r14613 64 64 RegisterEvents(); 65 65 } 66 67 private void RegisterEvents() {68 MetaSolver.Algorithm.ExecutionStateChanged += OnExecutionStateChanged;69 MetaSolver.Algorithm.ExecutionTimeChanged += OnExecutionTimeChanged;70 MetaSolver.Algorithm.Prepared += OnPrepared;71 MetaSolver.Algorithm.Started += OnStarted;72 MetaSolver.Algorithm.Paused += OnPaused;73 MetaSolver.Algorithm.Stopped += OnStopped;74 MetaSolver.Algorithm.ExceptionOccurred += OnExceptionOccurred;75 }76 77 66 public LrpNetwork1() : base("LrpNetwork1") { 78 67 var orchestratorNode = new LrpOrchestratorNode1("Orchestrator"); … … 124 113 } 125 114 115 private void RegisterEvents() { 116 MetaSolver.AlgorithmChanged += MetaSolver_AlgorithmChanged; 117 RegisterAlgorithmEvents(); 118 } 119 120 private void RegisterAlgorithmEvents() { 121 var algorithm = MetaSolver.Algorithm; 122 if (algorithm == null) return; 123 124 algorithm.ExecutionStateChanged += OnExecutionStateChanged; 125 algorithm.ExecutionTimeChanged += OnExecutionTimeChanged; 126 algorithm.Prepared += OnPrepared; 127 algorithm.Started += OnStarted; 128 algorithm.Paused += OnPaused; 129 algorithm.Stopped += OnStopped; 130 algorithm.ExceptionOccurred += OnExceptionOccurred; 131 } 132 133 private void MetaSolver_AlgorithmChanged(object sender, EventArgs e) { 134 RegisterAlgorithmEvents(); 135 } 136 126 137 #region IOptimizer Members 127 138 public RunCollection Runs { get { return MetaSolver.Algorithm.Runs; } } -
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.TravelingThief/3.3/TtpNetwork.cs
r14610 r14613 55 55 RegisterEvents(); 56 56 } 57 protected TtpNetwork() : base("TtpNetwork") { }57 protected TtpNetwork() : this("TtpNetwork") { } 58 58 protected TtpNetwork(string name) : base(name) { 59 59 Nodes.Add(new TtpOrchestratorNode1("Orchestrator")); … … 72 72 protected virtual void RegisterEvents() { 73 73 MetaSolver.AlgorithmChanged += MetaSolver_AlgorithmChanged; 74 RegisterAlgorithmEvents(); 74 75 } 75 76 76 protected virtual void MetaSolver_AlgorithmChanged(object sender, EventArgs e) {77 protected virtual void RegisterAlgorithmEvents() { 77 78 var algorithm = MetaSolver.Algorithm; 78 79 if (algorithm == null) return; … … 85 86 algorithm.Stopped += OnStopped; 86 87 algorithm.ExceptionOccurred += OnExceptionOccurred; 88 } 89 90 protected virtual void MetaSolver_AlgorithmChanged(object sender, EventArgs e) { 91 RegisterAlgorithmEvents(); 87 92 } 88 93
Note: See TracChangeset
for help on using the changeset viewer.