Changeset 13970 for branches/thasling/DistributedGA/DistributedGA.Hive
- Timestamp:
- 07/01/16 17:53:05 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/thasling/DistributedGA/DistributedGA.Hive/P2PMigrationAnalyzer.cs
r13969 r13970 165 165 //define how many migrants to send 166 166 var migrationRate = ((PercentValue)Parameters["MigrationRate"].ActualValue).Value; 167 int noOfEmigrants = Convert.ToInt32(scope.SubScopes.Count * migrationRate); 168 if (noOfEmigrants == 0 && scope.SubScopes.Count > 0) { 169 noOfEmigrants = 0; 170 } 167 171 var popQualities = QualityParameter.ActualValue; 168 172 var selectedMigStrat = MigrationStrategyParameter.Value.Value; … … 172 176 IScope emigrants = null; 173 177 174 //determine how many emigrants to send 175 int max = Convert.ToInt32(scope.SubScopes.Count * migrationRate); 176 if (max == 0 && scope.SubScopes.Count > 0) { 177 max = 0; 178 } 179 180 for (int i = 0; i < max; i++) { 178 for (int i = 0; i < noOfEmigrants; i++) { 181 179 //select emigrant depending on strategy 182 180 switch (selectedMigStrat) {
Note: See TracChangeset
for help on using the changeset viewer.