Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14061


Ignore:
Timestamp:
07/13/16 19:13:03 (8 years ago)
Author:
thasling
Message:

#2615:
PeerList is now recieved each 10 seconds instead of 20 seconds
PeerList is also recieved at Init-Call for the first time
changed data type of some parameters of P2PMigrationAnalyzer

Location:
branches/thasling/DistributedGA
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs

    r13982 r14061  
    6363        }
    6464      }
    65       catch (Exception ex) {
     65      catch {
    6666        //Nothing to do because maybe called from adderror
    6767      }
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs

    r14060 r14061  
    66using DistributedGA.Core.Interface;
    77using System.Timers;
     8using System.Threading.Tasks;
    89
    910namespace DistributedGA.Core.Implementation {
     
    3031      cachedPeerList = new List<PeerInfo>();
    3132      rand = new Random();
     33      //Init
     34      Task.Factory.StartNew(() => RefreshPeerList(this, null), TaskCreationOptions.LongRunning);
    3235      //Start heartbeat timer
    33       timer = new Timer(1000 * 20); //each 20 seconds
     36      timer = new Timer(1000 * 10); //each 10 seconds
    3437      timer.Elapsed += RefreshPeerList;
    3538      timer.Start();
     
    4548      using (var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint)) {
    4649        using (IClientChannel client = (IClientChannel)myChannelFactory.CreateChannel()) {
    47           ((IContactService)client).MakeLog(myself, msg);     
     50          ((IContactService)client).MakeLog(myself, msg);
    4851        }
    4952      }
     
    8386          using (var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint)) {
    8487            using (IClientChannel client = (IClientChannel)myChannelFactory.CreateChannel()) {
    85               allPeers = ((IContactService)client).GetPeerList(myself);           
     88              allPeers = ((IContactService)client).GetPeerList(myself);
    8689            }
    8790          }
  • branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs

    r14060 r14061  
    5656      get { return (ILookupParameter<IntValue>)Parameters["MigrationIterations"]; }
    5757    }
    58     public ILookupParameter<PercentValue> MigrationRatesParameter {
    59       get { return (ILookupParameter<PercentValue>)Parameters["MigrationRate"]; }
    60     }
    61     public ILookupParameter<PercentValue> CommunicationRatesParameter {
    62       get { return (ILookupParameter<PercentValue>)Parameters["CommunicationRate"]; }
    63     }
    64     public ILookupParameter<IntValue> MessageCacheCapacityParameter {
    65       get { return (ILookupParameter<IntValue>)Parameters["MessageCacheCapacity"]; }
     58    public IValueParameter<PercentValue> MigrationRatesParameter {
     59      get { return (IValueParameter<PercentValue>)Parameters["MigrationRate"]; }
     60    }
     61    public IValueParameter<PercentValue> CommunicationRatesParameter {
     62      get { return (IValueParameter<PercentValue>)Parameters["CommunicationRate"]; }
     63    }
     64    public IValueParameter<IntValue> MessageCacheCapacityParameter {
     65      get { return (IValueParameter<IntValue>)Parameters["MessageCacheCapacity"]; }
    6666    }
    6767    public ILookupParameter<IRandom> RandomParameter {
     
    118118      Parameters.Add(new ValueParameter<StringValue>("ContactServerURL", "", new StringValue("net.tcp://10.42.1.150:9090/DistributedGA.ContactServer/ContactService")));
    119119      Parameters.Add(new ValueParameter<StringValue>("JobGUID", "", new StringValue(Guid.NewGuid().ToString())));
    120     //public ILookupParameter<StringValue> JobGuidParameter {
    121     //  get { return (ILookupParameter<StringValue>)Parameters["JobGUID"]; }
    122     //}
    123 
    124120      Parameters.Add(new ValueParameter<ILog>("Log", "The log", new Log(1000)));
    125121
     
    237233          List<KeyValuePair<PeerInfo, byte[]>> immigrants = new List<KeyValuePair<PeerInfo, byte[]>>();
    238234          //limit number of immigrants to use
    239           if(noOfEmigrants < message.Count)
    240           {
     235          if (noOfEmigrants < message.Count) {
    241236            immigrants = message.Skip(Math.Max(0, message.Count() - noOfEmigrants)).ToList();
    242237          } else {
    243238            immigrants = message;
    244239          }
    245          
     240
    246241          // remove individuals from population to make place for immigrants
    247242          for (int i = 0; i < immigrants.Count; i++) {
Note: See TracChangeset for help on using the changeset viewer.