Changeset 14061
- Timestamp:
- 07/13/16 19:13:03 (8 years ago)
- Location:
- branches/thasling/DistributedGA
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/thasling/DistributedGA/DistributedGA.ContactServer/ContactServiceImpl.cs
r13982 r14061 63 63 } 64 64 } 65 catch (Exception ex){65 catch { 66 66 //Nothing to do because maybe called from adderror 67 67 } -
branches/thasling/DistributedGA/DistributedGA.Core/Implementation/WcfPeerListManager.cs
r14060 r14061 6 6 using DistributedGA.Core.Interface; 7 7 using System.Timers; 8 using System.Threading.Tasks; 8 9 9 10 namespace DistributedGA.Core.Implementation { … … 30 31 cachedPeerList = new List<PeerInfo>(); 31 32 rand = new Random(); 33 //Init 34 Task.Factory.StartNew(() => RefreshPeerList(this, null), TaskCreationOptions.LongRunning); 32 35 //Start heartbeat timer 33 timer = new Timer(1000 * 20); //each 20 seconds36 timer = new Timer(1000 * 10); //each 10 seconds 34 37 timer.Elapsed += RefreshPeerList; 35 38 timer.Start(); … … 45 48 using (var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint)) { 46 49 using (IClientChannel client = (IClientChannel)myChannelFactory.CreateChannel()) { 47 ((IContactService)client).MakeLog(myself, msg); 50 ((IContactService)client).MakeLog(myself, msg); 48 51 } 49 52 } … … 83 86 using (var myChannelFactory = new ChannelFactory<IContactService>(binding, endpoint)) { 84 87 using (IClientChannel client = (IClientChannel)myChannelFactory.CreateChannel()) { 85 allPeers = ((IContactService)client).GetPeerList(myself); 88 allPeers = ((IContactService)client).GetPeerList(myself); 86 89 } 87 90 } -
branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs
r14060 r14061 56 56 get { return (ILookupParameter<IntValue>)Parameters["MigrationIterations"]; } 57 57 } 58 public I LookupParameter<PercentValue> MigrationRatesParameter {59 get { return (I LookupParameter<PercentValue>)Parameters["MigrationRate"]; }60 } 61 public I LookupParameter<PercentValue> CommunicationRatesParameter {62 get { return (I LookupParameter<PercentValue>)Parameters["CommunicationRate"]; }63 } 64 public I LookupParameter<IntValue> MessageCacheCapacityParameter {65 get { return (I LookupParameter<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"]; } 66 66 } 67 67 public ILookupParameter<IRandom> RandomParameter { … … 118 118 Parameters.Add(new ValueParameter<StringValue>("ContactServerURL", "", new StringValue("net.tcp://10.42.1.150:9090/DistributedGA.ContactServer/ContactService"))); 119 119 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 124 120 Parameters.Add(new ValueParameter<ILog>("Log", "The log", new Log(1000))); 125 121 … … 237 233 List<KeyValuePair<PeerInfo, byte[]>> immigrants = new List<KeyValuePair<PeerInfo, byte[]>>(); 238 234 //limit number of immigrants to use 239 if(noOfEmigrants < message.Count) 240 { 235 if (noOfEmigrants < message.Count) { 241 236 immigrants = message.Skip(Math.Max(0, message.Count() - noOfEmigrants)).ToList(); 242 237 } else { 243 238 immigrants = message; 244 239 } 245 240 246 241 // remove individuals from population to make place for immigrants 247 242 for (int i = 0; i < immigrants.Count; i++) {
Note: See TracChangeset
for help on using the changeset viewer.