Changeset 10743 for stable/HeuristicLab.Problems.VehicleRouting
- Timestamp:
- 04/11/14 15:05:55 (11 years ago)
- Location:
- stable
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 10407,10465-10466,10474
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 10474
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/BiasedMultiVRPSolutionCrossover.cs
r10507 r10743 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.Random; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 140 141 if (checkedOperators.Count() > 0) { 141 142 // select a random operator from the checked operators 142 double sum = (from indexedItem in checkedOperators select probabilities[indexedItem.Index]).Sum(); 143 if (sum == 0) throw new InvalidOperationException(Name + ": All selected operators have zero probability."); 144 double r = random.NextDouble() * sum; 145 sum = 0; 146 foreach (var indexedItem in checkedOperators) { 147 sum += probabilities[indexedItem.Index]; 148 if (sum > r) { 149 successor = indexedItem.Value; 150 break; 151 } 152 } 143 successor = checkedOperators.SampleProportional(random, 1, probabilities, false, false).First().Value; 153 144 } 154 145 -
stable/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/BiasedMultiVRPSolutionManipulator.cs
r10507 r10743 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.Random; 32 33 33 34 namespace HeuristicLab.Problems.VehicleRouting.Encodings.General { … … 140 141 if (checkedOperators.Count() > 0) { 141 142 // select a random operator from the checked operators 142 double sum = (from indexedItem in checkedOperators select probabilities[indexedItem.Index]).Sum(); 143 if (sum == 0) throw new InvalidOperationException(Name + ": All selected operators have zero probability."); 144 double r = random.NextDouble() * sum; 145 sum = 0; 146 foreach (var indexedItem in checkedOperators) { 147 sum += probabilities[indexedItem.Index]; 148 if (sum > r) { 149 successor = indexedItem.Value; 150 break; 151 } 152 } 143 successor = 144 checkedOperators.SampleProportional(random, 1, probabilities, false, false).First().Value; 153 145 } 154 146 -
stable/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
r8894 r10743 465 465 <Private>False</Private> 466 466 </ProjectReference> 467 <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj"> 468 <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project> 469 <Name>HeuristicLab.Random-3.3</Name> 470 </ProjectReference> 467 471 </ItemGroup> 468 472 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
stable/HeuristicLab.Problems.VehicleRouting/3.4/Plugin.cs.frame
r10032 r10743 41 41 [PluginDependency("HeuristicLab.Persistence", "3.3")] 42 42 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 43 [PluginDependency("HeuristicLab.Random", "3.3")] 43 44 public class HeuristicLabProblemsVehicleRoutingPlugin : PluginBase { 44 45 }
Note: See TracChangeset
for help on using the changeset viewer.