Index: /branches/thasling/DistributedGA/DistributedGA.Core.Host/Program.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core.Host/Program.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core.Host/Program.cs	(revision 13956)
@@ -15,5 +15,5 @@
 
         IMessageHandler h = new PeerNetworkMessageHandler();
-        h.Init(ipPrefix, serverUrl);
+        h.Init(ipPrefix, serverUrl, "TestProblem", 10000, 100);
 
         PeerInfo pi = h.GetPeerInfo();
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs	(revision 13956)
@@ -29,15 +29,15 @@
 
 
-    public void Init(string lanIpPrefix, string contactServerUrl) {
+    public void Init(string lanIpPrefix, string contactServerUrl, string problemInstance, int messageCacheCapacity, int communicationRate) {
       try {
         ownInstance = new PeerInfo() {
           IpAddress = GetInternalIpAddress(lanIpPrefix),
           Port = 0,
-          ProblemInstance = "TestProblem"
+          ProblemInstance = problemInstance
         }; // TODO: get own peerinfo
 
         writeQueue = new SizedConcurrentQueue<byte[]>();
         readQueue = new SizedConcurrentQueue<byte[]>();
-        writeQueue.Limit = 1000;
+        writeQueue.Limit = messageCacheCapacity;
         readQueue.Limit = writeQueue.Limit;
 
@@ -47,8 +47,8 @@
 
         peerListManager = new WcfPeerListManager();
-        peerListManager.Init(ownInstance, contactServerUrl);
+        peerListManager.Init(ownInstance, contactServerUrl, communicationRate);
 
         sender = new WcfMessageSender();
-        sender.Init(ownInstance);
+        sender.Init(ownInstance, messageCacheCapacity);
 
       }
@@ -141,4 +141,5 @@
           }
         }
+      
       }
     }
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/TestPeerListManager.cs	(revision 13956)
@@ -34,4 +34,12 @@
             
         }
+
+        #region IPeerListManager Members
+
+        public void Init(PeerInfo source, string contactServerUrl, int communicationRate) {
+          throw new System.NotImplementedException();
+        }
+
+        #endregion
     }
 }
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageSender.cs	(revision 13956)
@@ -20,8 +20,8 @@
     private Object timerLock = new Object();
 
-    public void Init(PeerInfo source) {
+    public void Init(PeerInfo source, int messageCacheCapacity) {
       myself = source;
       bufferedMessages = new SizedConcurrentQueue<KeyValuePair<PeerInfo, byte[][]>>();
-      bufferedMessages.Limit = 100000;
+      bufferedMessages.Limit = messageCacheCapacity;
       timer = new Timer(1000 * 60); //each 5 minutes
       timer.Elapsed += GenerateSendingTasks;
@@ -72,4 +72,5 @@
       }
     }
+
   }
 }
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfMessageService.cs	(revision 13956)
@@ -11,5 +11,5 @@
     public event EventHandler<MessageRecieveEventArgs> OnDataRecieved;
 
-    private static ManualResetEvent _ResetEvent = new ManualResetEvent(false);
+    private ManualResetEvent _ResetEvent = new ManualResetEvent(false);
 
     private IMessageContract messageContract = null;
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs	(revision 13956)
@@ -24,6 +24,9 @@
     private IContactService heartbeatClient;
 
-    public void Init(PeerInfo source, string contactServerUrl) {
+    private int communicationRate; //how many peers are contacted by this peer in percent
+
+    public void Init(PeerInfo source, string contactServerUrl, int communicationRate) {
       serverString = contactServerUrl;
+      this.communicationRate = communicationRate;
       myself = source;
       //Init ChannelFactory and Clients
@@ -69,5 +72,5 @@
     private List<PeerInfo> ChoosePeersForMessaging(List<PeerInfo> allPeers) {
       //communicate with 10% of the network
-      int noOfPeers = allPeers.Count / 10;
+      int noOfPeers = allPeers.Count / (100 /communicationRate);
       List<int> indexList = GetRandomItemIndexes(noOfPeers, 0, allPeers.Count - 1);
       List<PeerInfo> res = new List<PeerInfo>();
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageHandler.cs	(revision 13956)
@@ -6,5 +6,5 @@
   public interface IMessageHandler {
 
-    void Init(string lanIpPrefix, string contactServerUrl); //Registers at contract-server
+    void Init(string lanIpPrefix, string contactServerUrl, string problemInstance, int messageCacheCapacty, int communicationRate); //Registers at contract-server
 
     void PublishDataToNetwork(byte[][] data);
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageSender.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageSender.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IMessageSender.cs	(revision 13956)
@@ -5,5 +5,5 @@
   public interface IMessageSender {
 
-    void Init(PeerInfo source);
+    void Init(PeerInfo source, int messageCacheCapacity);
 
     void SendData(PeerInfo destination, byte[][] data);
Index: /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Core/Interface/IPeerListManager.cs	(revision 13956)
@@ -6,5 +6,5 @@
   public interface IPeerListManager {
 
-    void Init(PeerInfo source, string contactServerUrl); //Registers own instance at the contact-server
+    void Init(PeerInfo source, string contactServerUrl, int 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 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs	(revision 13956)
@@ -99,7 +99,7 @@
       var lanIpPrefix = ((StringValue)(Parameters["LanIpPrefix"].ActualValue)).Value;
       var contactServerUri = ((StringValue)(Parameters["ContactServerURL"].ActualValue)).Value;
-      h.Init(lanIpPrefix, contactServerUri);
+      var problemInstance = ((StringValue)Parameters["JobGUID"].ActualValue).Value;
+      h.Init(lanIpPrefix, contactServerUri, problemInstance, 10000, 100);
       var peer = h.GetPeerInfo();
-      peer.ProblemInstance = ((StringValue)Parameters["JobGUID"].ActualValue).Value;
     }
 
Index: /branches/thasling/DistributedGA/DistributedGA.Hive/P2PTask.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Hive/P2PTask.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Hive/P2PTask.cs	(revision 13956)
@@ -99,5 +99,5 @@
                     var lanIpPrefix = ((StringValue)(Parameters["LanIpPrefix"].ActualValue)).Value;
                     var contactServerUri = ((StringValue)(Parameters["ContactServerURL"].ActualValue)).Value;
-                    h.Init(lanIpPrefix, contactServerUri);
+                    h.Init(lanIpPrefix, contactServerUri, "TEST", 10000, 100);
                     PeerInfo pi = h.GetPeerInfo();
                     log.LogMessage(string.Format("Peer is hostet at IP: {0} and port: {1}", pi.IpAddress, pi.Port));
Index: /branches/thasling/DistributedGA/DistributedGA.Test/Form1.cs
===================================================================
--- /branches/thasling/DistributedGA/DistributedGA.Test/Form1.cs	(revision 13955)
+++ /branches/thasling/DistributedGA/DistributedGA.Test/Form1.cs	(revision 13956)
@@ -20,5 +20,5 @@
     private void button2_Click(object sender, EventArgs e) {
       IMessageSender c = new WcfMessageSender();
-      c.Init(null);
+      //c.Init(null);
       c.SendData(null, null);
     }
@@ -26,13 +26,13 @@
     private void button3_Click(object sender, EventArgs e) {
       IMessageHandler h1 = new PeerNetworkMessageHandler();
-      h1.Init("", "");
+      //h1.Init("", "", "");
       IMessageHandler h2 = new PeerNetworkMessageHandler();
-      h2.Init("", "");
+      //h2.Init("", "");
       IMessageHandler h3 = new PeerNetworkMessageHandler();
-      h3.Init("", "");
+      //h3.Init("", "");
       IMessageHandler h4 = new PeerNetworkMessageHandler();
-      h4.Init("", "");
+      //h4.Init("", "");
       IMessageHandler h5 = new PeerNetworkMessageHandler();
-      h5.Init("", "");
+      //h5.Init("", "");
       //byte[] message = CreateTestMessage();
       //h1.PublishDataToNetwork(pop1);
@@ -53,5 +53,5 @@
     private void button4_Click(object sender, EventArgs e) {
       var l = new WcfPeerListManager();
-      l.Init(CreatePeerInfo(),"");
+      //l.Init(CreatePeerInfo(),"");
       l.GetPeerList();
     }
