Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13964)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13965)
@@ -29,5 +29,5 @@
 
 
-    public void Init(string lanIpPrefix, string contactServerUrl, string problemInstance, int messageCacheCapacity, int communicationRate) {
+    public void Init(string lanIpPrefix, string contactServerUrl, string problemInstance, int messageCacheCapacity, double communicationRate) {
       try {
         ownInstance = new PeerInfo() {
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs	(revision 13964)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs	(revision 13965)
@@ -42,4 +42,12 @@
 
         #endregion
+
+        #region IPeerListManager Members
+
+        public void Init(PeerInfo source, string contactServerUrl, double communicationRate) {
+          throw new System.NotImplementedException();
+        }
+
+        #endregion
     }
 }
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs	(revision 13964)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs	(revision 13965)
@@ -29,5 +29,5 @@
       bufferedMessagesWrite = new SizedConcurrentQueue<KeyValuePair<PeerInfo, byte[][]>>();
       bufferedMessagesWrite.Limit = bufferedMessagesRead.Limit;
-      timer = new Timer(1000 * 60); //each 5 minutes
+      timer = new Timer(1000 * 10); //each 10 seconds
       timer.Elapsed += GenerateSendingTasks;
       timer.Start();
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs	(revision 13964)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs	(revision 13965)
@@ -24,10 +24,14 @@
     private IContactService heartbeatClient;
 
-    private int communicationRate; //how many peers are contacted by this peer in percent
+    private Random rand;
 
-    public void Init(PeerInfo source, string contactServerUrl, int communicationRate) {
+    private double communicationRate; //how many peers are contacted by this peer in percent
+
+    public void Init(PeerInfo source, string contactServerUrl, double communicationRate) {
       serverString = contactServerUrl;
       this.communicationRate = communicationRate;
       myself = source;
+      rand = new Random();
+     
       //Init ChannelFactory and Clients
       var binding = new NetTcpBinding();
@@ -47,7 +51,6 @@
       try {
         var allPeers = client.GetPeerList(myself); //maybe timout exception...
-        var peersForMessaging = ChoosePeersForMessaging(allPeers);
-        //return peersForMessaging;
-        return allPeers; //TODO: Enable 10% list communication
+        var peersForMessaging = ChoosePeersForMessaging(ref allPeers);
+        return peersForMessaging;
       }
       catch { } //if maybe sending failed (because of connection lost, etc.): just ignore
@@ -70,26 +73,21 @@
 
 
-    private List<PeerInfo> ChoosePeersForMessaging(List<PeerInfo> allPeers) {
-      //communicate with 10% of the network
-      int noOfPeers = allPeers.Count / (100 / communicationRate);
-      List<int> indexList = GetRandomItemIndexes(noOfPeers, 0, allPeers.Count - 1);
-      List<PeerInfo> res = new List<PeerInfo>();
-      foreach (int index in indexList) {
-        res.Add(allPeers.ElementAt(index));
+    private List<PeerInfo> ChoosePeersForMessaging(ref List<PeerInfo> allPeers) {
+      Shuffle<PeerInfo>(allPeers);
+      int toTake = Convert.ToInt32(allPeers.Count * communicationRate) + 1;
+      if (allPeers.Count > 0 && toTake == 0) {
+        toTake = 1;
       }
-      return allPeers;
+      return allPeers.Take(toTake).ToList(); ;
     }
-
-    private List<int> GetRandomItemIndexes(int noOfItems, int minValue, int maxValue) {
-      List<int> res = new List<int>();
-      Random rnd = new Random();
-      int tmp = -1;
-      while (res.Count < noOfItems) {
-        tmp = rnd.Next(minValue, maxValue + 1);
-        if (!res.Contains(tmp)) {
-          res.Add(tmp);
-        }
+    private  void Shuffle<T>(IList<T> list) {
+      int n = list.Count;
+      while (n > 1) {
+        n--;
+        int k = rand.Next(n + 1);
+        T value = list[k];
+        list[k] = list[n];
+        list[n] = value;
       }
-      return res;
     }
 
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs	(revision 13964)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs	(revision 13965)
@@ -6,5 +6,5 @@
   public interface IMessageHandler {
 
-    void Init(string lanIpPrefix, string contactServerUrl, string problemInstance, int messageCacheCapacty, int communicationRate); //Registers at contract-server
+    void Init(string lanIpPrefix, string contactServerUrl, string problemInstance, int messageCacheCapacty, double communicationRate);
 
     void PublishDataToNetwork(byte[][] data);
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs	(revision 13964)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs	(revision 13965)
@@ -6,5 +6,5 @@
   public interface IPeerListManager {
 
-    void Init(PeerInfo source, string contactServerUrl, int communicationRate); //Registers own instance at the contact-server
+    void Init(PeerInfo source, string contactServerUrl, double communicationRate); //Registers own instance at the contact-server
 
     List<PeerInfo> GetPeerList(); //Recieves all peers in the network from contact-server
Index: /branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs	(revision 13964)
+++ /branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs	(revision 13965)
@@ -41,5 +41,5 @@
   [Item("P2PMigrationAnalyzer", "Migrates individuals using a P2P network.")]
   [StorableClass]
-  public class P2PMigrationAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator {
+  public class P2PMigrationAnalyzer : SingleSuccessorOperator, IAnalyzer, ISingleObjectiveOperator, IExecutable {
     // state: messagehandler
     private IMessageHandler h;
@@ -118,5 +118,5 @@
       validValues.Add(new EnumValue<MigrationStrategy>(MigrationStrategy.TakeRandomReplaceRandom));
 
-      Parameters.Add(new ConstrainedValueParameter<EnumValue<MigrationStrategy>>("MigrationStrategy", validValues));
+      Parameters.Add(new ConstrainedValueParameter<EnumValue<MigrationStrategy>>("MigrationStrategy", validValues, (new EnumValue<MigrationStrategy>(MigrationStrategy.TakeBestReplaceBad))));
     }
 
@@ -172,4 +172,5 @@
             using (var stream = new MemoryStream()) {
               var emigrantScope = emigrantsList[ei];
+              emigrantScope.ClearParentScopes();
               var msgScope = new Scope();
               var cloner = new Cloner();
@@ -177,5 +178,6 @@
                 msgScope.Variables.Add((IVariable)variable.Clone(cloner));
               }
-              // emigrantScope.ClearParentScopes();
+              msgScope.ClearParentScopes();
+              //TODO: CLEAR EMMIGRANT SCOPES
               HeuristicLab.Persistence.Default.Xml.XmlGenerator.Serialize(msgScope, stream);
               message[ei] = stream.GetBuffer();
@@ -228,4 +230,46 @@
 
     public bool EnabledByDefault { get { return false; } }
+
+    #region IExecutable Members
+
+    public event EventHandler<EventArgs<Exception>> ExceptionOccurred;
+
+    public ExecutionState ExecutionState {
+      get { return ExecutionState.Prepared; }
+    }
+
+    public event EventHandler ExecutionStateChanged;
+
+    public TimeSpan ExecutionTime {
+      get { return new TimeSpan(); }
+    }
+
+    public event EventHandler ExecutionTimeChanged;
+
+    public void Pause() {
+      int i = 0;
+    }
+
+    public event EventHandler Paused;
+
+    public void Prepare() {
+      int i = 0;
+    }
+
+    public event EventHandler Prepared;
+
+    public void Start() {
+      int i = 0;
+    }
+
+    public event EventHandler Started;
+
+    public void Stop() {
+      int i = 0;
+    }
+
+    public event EventHandler Stopped;
+
+    #endregion
   }
 }
