Changeset 13957
- Timestamp:
- 06/29/16 17:21:53 (8 years ago)
- Location:
- branches/thasling/DistributedGA
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/thasling/DistributedGA/DistributedGA.Core/Implementation/PeerNetworkMessageHandler.cs
r13956 r13957 135 135 136 136 private void OnDataRecieved(object sender, MessageRecieveEventArgs e) { 137 if (e != null ) {137 if (e != null && e.Sender.ProblemInstance.Equals(ownInstance.ProblemInstance)) { 138 138 lock (activeQueueLocker) { 139 139 foreach (byte[] item in e.data) { -
branches/thasling/DistributedGA/DistributedGA.Hive/DistributedGA.Hive.csproj
r13905 r13957 97 97 </ItemGroup> 98 98 <ItemGroup> 99 <Compile Include="MigrationStrategy.cs" /> 99 100 <Compile Include="P2PTask.cs" /> 100 101 <Compile Include="Plugin.cs" /> -
branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs
r13956 r13957 28 28 using DistributedGA.Core.Implementation; 29 29 using DistributedGA.Core.Interface; 30 using DistributedGA.Hive; 30 31 using HeuristicLab.Clients.Hive; 31 32 using HeuristicLab.Common; … … 45 46 public ILookupParameter<IntValue> MigrationIterationsParameter { 46 47 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"]; } 47 57 } 48 58 public ILookupParameter<IRandom> RandomParameter { … … 76 86 Parameters.Add(new LookupParameter<IntValue>("MigrationIterations")); 77 87 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))); 78 91 Parameters.Add(new ValueParameter<StringValue>("LanIpPrefix", "", new StringValue("10."))); 79 92 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator")); … … 100 113 var contactServerUri = ((StringValue)(Parameters["ContactServerURL"].ActualValue)).Value; 101 114 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); 103 118 var peer = h.GetPeerInfo(); 104 119 } … … 113 128 IScope scope = ExecutionContext.Scope; 114 129 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 115 135 116 136 // select best as emigrant
Note: See TracChangeset
for help on using the changeset viewer.