Changeset 13957


Ignore:
Timestamp:
06/29/16 17:21:53 (3 years ago)
Author:
thasling
Message:

#2615:
implemented mechanism to check wheter recieved packages are from the same problem instance or not
added several config parameters to P2PMigrationAnalyzer
added new enum for migration strategies

Location:
branches/thasling/DistributedGA
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs

    r13956 r13957  
    135135
    136136    private void OnDataRecieved(object sender, MessageRecieveEventArgs e) {
    137       if (e != null) {
     137      if (e != null && e.Sender.ProblemInstance.Equals(ownInstance.ProblemInstance)) {
    138138        lock (activeQueueLocker) {
    139139          foreach (byte[] item in e.data) {
  • branches/thasling/DistributedGA/DistributedGA.Hive/DistributedGA.Hive.csproj

    r13905 r13957  
    9797  </ItemGroup>
    9898  <ItemGroup>
     99    <Compile Include="MigrationStrategy.cs" />
    99100    <Compile Include="P2PTask.cs" />
    100101    <Compile Include="Plugin.cs" />
  • branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs

    r13956 r13957  
    2828using DistributedGA.Core.Implementation;
    2929using DistributedGA.Core.Interface;
     30using DistributedGA.Hive;
    3031using HeuristicLab.Clients.Hive;
    3132using HeuristicLab.Common;
     
    4546    public ILookupParameter<IntValue> MigrationIterationsParameter {
    4647      get { return (ILookupParameter<IntValue>)Parameters["MigrationIterations"]; }
     48    }
     49    public ILookupParameter<IntValue> MigrationRatesParameter {
     50      get { return (ILookupParameter<IntValue>)Parameters["MigrationRate"]; }
     51    }
     52    public ILookupParameter<IntValue> CommunicationRatesParameter {
     53      get { return (ILookupParameter<IntValue>)Parameters["CommunicationRate"]; }
     54    }
     55    public ILookupParameter<IntValue> MessageCacheCapacityParameter {                         
     56      get { return (ILookupParameter<IntValue>)Parameters["MessageCacheCapacity"]; }
    4757    }
    4858    public ILookupParameter<IRandom> RandomParameter {
     
    7686      Parameters.Add(new LookupParameter<IntValue>("MigrationIterations"));
    7787      Parameters.Add(new ValueParameter<IntValue>("MigrationInterval", "", new IntValue(1)));
     88      Parameters.Add(new ValueParameter<IntValue>("MigrationRate", "", new IntValue(5)));
     89      Parameters.Add(new ValueParameter<IntValue>("CommunicationRate", "", new IntValue(10)));
     90      Parameters.Add(new ValueParameter<IntValue>("MessageCacheCapacity", "", new IntValue(100)));
    7891      Parameters.Add(new ValueParameter<StringValue>("LanIpPrefix", "", new StringValue("10.")));
    7992      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator"));
     
    100113      var contactServerUri = ((StringValue)(Parameters["ContactServerURL"].ActualValue)).Value;
    101114      var problemInstance = ((StringValue)Parameters["JobGUID"].ActualValue).Value;
    102       h.Init(lanIpPrefix, contactServerUri, problemInstance, 10000, 100);
     115      var communicationRate = ((IntValue)Parameters["CommunicationRate"].ActualValue).Value;
     116      var messageCacheCapacity = ((IntValue)Parameters["MessageCacheCapacity"].ActualValue).Value;
     117      h.Init(lanIpPrefix, contactServerUri, problemInstance, messageCacheCapacity, communicationRate);
    103118      var peer = h.GetPeerInfo();
    104119    }
     
    113128        IScope scope = ExecutionContext.Scope;
    114129        List<IScope> emigrantsList = new List<IScope>();
     130
     131        //define how many migrants to send
     132        var migrationRate = ((IntValue)Parameters["MigrationRate"].ActualValue).Value;
     133
     134        //TODO: SELECT MIGRATION STRATEGY
    115135
    116136        // select best as emigrant
Note: See TracChangeset for help on using the changeset viewer.