- Timestamp:
- 07/01/16 10:47:53 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs
r13960 r13965 41 41 [Item("P2PMigrationAnalyzer", "Migrates individuals using a P2P network.")] 42 42 [StorableClass] 43 public class P2PMigrationAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator {43 public class P2PMigrationAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator, IExecutable { 44 44 // state: messagehandler 45 45 private IMessageHandler h; … … 118 118 validValues.Add(new EnumValue<MigrationStrategy>(MigrationStrategy.TakeRandomReplaceRandom)); 119 119 120 Parameters.Add(new ConstrainedValueParameter<EnumValue<MigrationStrategy>>("MigrationStrategy", validValues ));120 Parameters.Add(new ConstrainedValueParameter<EnumValue<MigrationStrategy>>("MigrationStrategy", validValues, (new EnumValue<MigrationStrategy>(MigrationStrategy.TakeBestReplaceBad)))); 121 121 } 122 122 … … 172 172 using (var stream = new MemoryStream()) { 173 173 var emigrantScope = emigrantsList[ei]; 174 emigrantScope.ClearParentScopes(); 174 175 var msgScope = new Scope(); 175 176 var cloner = new Cloner(); … … 177 178 msgScope.Variables.Add((IVariable)variable.Clone(cloner)); 178 179 } 179 // emigrantScope.ClearParentScopes(); 180 msgScope.ClearParentScopes(); 181 //TODO: CLEAR EMMIGRANT SCOPES 180 182 HeuristicLab.Persistence.Default.Xml.XmlGenerator.Serialize(msgScope, stream); 181 183 message[ei] = stream.GetBuffer(); … … 228 230 229 231 public bool EnabledByDefault { get { return false; } } 232 233 #region IExecutable Members 234 235 public event EventHandler<EventArgs<Exception>> ExceptionOccurred; 236 237 public ExecutionState ExecutionState { 238 get { return ExecutionState.Prepared; } 239 } 240 241 public event EventHandler ExecutionStateChanged; 242 243 public TimeSpan ExecutionTime { 244 get { return new TimeSpan(); } 245 } 246 247 public event EventHandler ExecutionTimeChanged; 248 249 public void Pause() { 250 int i = 0; 251 } 252 253 public event EventHandler Paused; 254 255 public void Prepare() { 256 int i = 0; 257 } 258 259 public event EventHandler Prepared; 260 261 public void Start() { 262 int i = 0; 263 } 264 265 public event EventHandler Started; 266 267 public void Stop() { 268 int i = 0; 269 } 270 271 public event EventHandler Stopped; 272 273 #endregion 230 274 } 231 275 }
Note: See TracChangeset
for help on using the changeset viewer.