Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/01/16 10:47:53 (8 years ago)
Author:
thasling
Message:

#2615:
made minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs

    r13960 r13965  
    4141  [Item("P2PMigrationAnalyzer", "Migrates individuals using a P2P network.")]
    4242  [StorableClass]
    43   public class P2PMigrationAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator {
     43  public class P2PMigrationAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator, IExecutable {
    4444    // state: messagehandler
    4545    private IMessageHandler h;
     
    118118      validValues.Add(new EnumValue<MigrationStrategy>(MigrationStrategy.TakeRandomReplaceRandom));
    119119
    120       Parameters.Add(new ConstrainedValueParameter<EnumValue<MigrationStrategy>>("MigrationStrategy", validValues));
     120      Parameters.Add(new ConstrainedValueParameter<EnumValue<MigrationStrategy>>("MigrationStrategy", validValues, (new EnumValue<MigrationStrategy>(MigrationStrategy.TakeBestReplaceBad))));
    121121    }
    122122
     
    172172            using (var stream = new MemoryStream()) {
    173173              var emigrantScope = emigrantsList[ei];
     174              emigrantScope.ClearParentScopes();
    174175              var msgScope = new Scope();
    175176              var cloner = new Cloner();
     
    177178                msgScope.Variables.Add((IVariable)variable.Clone(cloner));
    178179              }
    179               // emigrantScope.ClearParentScopes();
     180              msgScope.ClearParentScopes();
     181              //TODO: CLEAR EMMIGRANT SCOPES
    180182              HeuristicLab.Persistence.Default.Xml.XmlGenerator.Serialize(msgScope, stream);
    181183              message[ei] = stream.GetBuffer();
     
    228230
    229231    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
    230274  }
    231275}
Note: See TracChangeset for help on using the changeset viewer.