Changeset 7445
- Timestamp:
- 02/03/12 16:19:24 (13 years ago)
- Location:
- branches/GeneralizedQAP
- Files:
-
- 13 added
- 10 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views-3.3.csproj
r7418 r7445 88 88 </ItemGroup> 89 89 <ItemGroup> 90 <Compile Include="GQAPProblemView.cs"> 91 <SubType>UserControl</SubType> 92 </Compile> 93 <Compile Include="GQAPProblemView.Designer.cs"> 94 <DependentUpon>GQAPProblemView.cs</DependentUpon> 95 </Compile> 90 96 <Compile Include="GQAPAssignmentArchiveView.cs"> 91 97 <SubType>UserControl</SubType> … … 113 119 <Name>HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3</Name> 114 120 </ProjectReference> 121 <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj"> 122 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project> 123 <Name>HeuristicLab.Problems.Instances-3.3</Name> 124 </ProjectReference> 115 125 </ItemGroup> 116 126 <ItemGroup> 127 <EmbeddedResource Include="GQAPProblemView.resx"> 128 <DependentUpon>GQAPProblemView.cs</DependentUpon> 129 </EmbeddedResource> 117 130 <EmbeddedResource Include="GQAPAssignmentArchiveView.resx"> 118 131 <DependentUpon>GQAPAssignmentArchiveView.cs</DependentUpon> -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GeneralizedQuadraticAssignmentProblem.cs
r7443 r7445 201 201 } 202 202 203 public void LoadFrom(IQAPInstance format) {204 Weights = new DoubleMatrix( format.Weights);205 Distances = new DoubleMatrix( format.Distances);206 InstallationCosts = new DoubleMatrix(Weights.Rows, Distances.Columns); 203 public void LoadFrom(IQAPInstance instance) { 204 Weights = new DoubleMatrix(instance.Weights); 205 Distances = new DoubleMatrix(instance.Distances); 206 InstallationCosts = new DoubleMatrix(Weights.Rows, Distances.Columns); // all zero 207 207 Capacities = new DoubleArray(Enumerable.Range(0, Distances.Rows).Select(x => 1.0).ToArray()); 208 208 Demands = new DoubleArray(Enumerable.Range(0, Weights.Rows).Select(x => 1.0).ToArray()); 209 209 210 if (format.BestKnownAssignment != null) { 211 var assignment = new IntegerVector(format.BestKnownAssignment); 212 double flowDistanceQuality, installationQuality, overbookedCapacity; 213 GQAPEvaluator.Evaluate(assignment, Weights, Distances, InstallationCosts, Demands, Capacities, 214 out flowDistanceQuality, out installationQuality, out overbookedCapacity); 215 double quality = GQAPEvaluator.GetCombinedQuality(flowDistanceQuality, installationQuality, overbookedCapacity, TransportationCosts.Value, OverbookedCapacityPenalty.Value); 216 BestKnownSolution = new GQAPSolution(assignment, new DoubleValue(quality), new DoubleValue(flowDistanceQuality), new DoubleValue(installationQuality), new DoubleValue(overbookedCapacity)); 217 BestKnownQuality = new DoubleValue(quality); 218 } 210 TransportationCosts.Value = 1; 211 212 if (instance.BestKnownAssignment != null) { 213 EvaluateAndLoadAssignment(instance.BestKnownAssignment); 214 } 215 } 216 217 public void LoadFrom(ICTAPInstance instance) { 218 Capacities = new DoubleArray(instance.MemoryCapacities); 219 Demands = new DoubleArray(instance.MemoryRequirements); 220 Weights = new DoubleMatrix(instance.CommunicationCosts); 221 InstallationCosts = new DoubleMatrix(instance.ExecutionCosts); 222 Distances = new DoubleMatrix(Capacities.Length, Capacities.Length); // all one, except diagonal 223 for (int i = 0; i < Capacities.Length - 1; i++) 224 for (int j = i + 1; j < Capacities.Length; j++) { 225 Distances[i, j] = 1; 226 Distances[j, i] = 1; 227 } 228 229 TransportationCosts.Value = 1; 230 231 if (instance.BestKnownAssignment != null) { 232 EvaluateAndLoadAssignment(instance.BestKnownAssignment); 233 } 234 } 235 236 private void EvaluateAndLoadAssignment(int[] vector) { 237 var assignment = new IntegerVector(vector); 238 double flowDistanceQuality, installationQuality, overbookedCapacity; 239 GQAPEvaluator.Evaluate(assignment, Weights, Distances, InstallationCosts, Demands, Capacities, 240 out flowDistanceQuality, out installationQuality, out overbookedCapacity); 241 double quality = GQAPEvaluator.GetCombinedQuality(flowDistanceQuality, installationQuality, overbookedCapacity, TransportationCosts.Value, OverbookedCapacityPenalty.Value); 242 BestKnownSolution = new GQAPSolution(assignment, new DoubleValue(quality), new DoubleValue(flowDistanceQuality), new DoubleValue(installationQuality), new DoubleValue(overbookedCapacity)); 243 BestKnownQuality = new DoubleValue(quality); 219 244 } 220 245 -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.ElloumiCTAP/3.3/HeuristicLab.Problems.Instances.ElloumiCTAP-3.3.csproj
r7444 r7445 46 46 </ItemGroup> 47 47 <ItemGroup> 48 <Compile Include=" SolutionParser.cs" />48 <Compile Include="ElloumiCTAPSolutionParser.cs" /> 49 49 <EmbeddedResource Include="Data\tass1003Aa.dat" /> 50 50 <EmbeddedResource Include="Data\tass1003Ab.dat" /> … … 130 130 <EmbeddedResource Include="Data\tassc2005De.dat" /> 131 131 <None Include="Plugin.cs.frame" /> 132 <Compile Include=" Instance.cs" />133 <Compile Include=" InstanceDescriptor.cs" />134 <Compile Include=" InstanceProvider.cs" />135 <Compile Include=" Parser.cs" />132 <Compile Include="ElloumiCTAPInstance.cs" /> 133 <Compile Include="ElloumiCTAPInstanceDescriptor.cs" /> 134 <Compile Include="ElloumiCTAPInstanceProvider.cs" /> 135 <Compile Include="ElloumiCTAPParser.cs" /> 136 136 <Compile Include="Plugin.cs" /> 137 137 <Compile Include="Properties\AssemblyInfo.cs" /> -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.QAPLIB/3.3/HeuristicLab.Problems.Instances.QAPLIB-3.3.csproj
r7443 r7445 47 47 </ItemGroup> 48 48 <ItemGroup> 49 <Compile Include=" Parser.cs" />50 <Compile Include=" Instance.cs" />51 <Compile Include=" InstanceDescriptor.cs" />52 <Compile Include=" SolutionParser.cs" />53 <Compile Include=" InstanceProvider.cs" />49 <Compile Include="QAPLIBParser.cs" /> 50 <Compile Include="QAPLIBInstance.cs" /> 51 <Compile Include="QAPLIBInstanceDescriptor.cs" /> 52 <Compile Include="QAPLIBSolutionParser.cs" /> 53 <Compile Include="QAPLIBInstanceProvider.cs" /> 54 54 <EmbeddedResource Include="Data\bur26a.dat" /> 55 55 <EmbeddedResource Include="Data\bur26b.dat" /> -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.QAPLIB/3.3/Plugin.cs
r7444 r7445 23 23 24 24 namespace HeuristicLab.Problems.Instances { 25 [Plugin("HeuristicLab.Problems.Instances.QAPLIB", "3.3.6.744 3")]25 [Plugin("HeuristicLab.Problems.Instances.QAPLIB", "3.3.6.7444")] 26 26 [PluginFile("HeuristicLab.Problems.Instances.QAPLIB-3.3.dll", PluginFileType.Assembly)] 27 27 public class HeuristicLabProblemsInstancesQAPLIBPlugin : PluginBase { -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj
r7444 r7445 40 40 <Reference Include="HeuristicLab.Common-3.3"> 41 41 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 42 <Private>False</Private>43 </Reference>44 <Reference Include="HeuristicLab.Core-3.3">45 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>46 42 <Private>False</Private> 47 43 </Reference> -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs
r7443 r7445 24 24 25 25 namespace HeuristicLab.Problems.Instances { 26 public interface IProblemInstanceProvider <TInstance>{26 public interface IProblemInstanceProvider { 27 27 string Name { get; } 28 28 string Description { get; } … … 30 30 31 31 IEnumerable<IInstanceDescriptor> GetInstanceDescriptors(); 32 } 33 34 public interface IProblemInstanceProvider<TInstance> : IProblemInstanceProvider { 32 35 TInstance GetInstance(IInstanceDescriptor descriptor); 33 36 } -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/Instances/ICTAPInstance.cs
r7443 r7445 55 55 /// Optional! The quality value of the <see cref="BestKnownAssignment"/> 56 56 /// </summary> 57 double BestKnownQuality { get; }57 double? BestKnownQuality { get; } 58 58 } 59 59 } -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/Instances/IQAPInstance.cs
r7443 r7445 47 47 /// Optional! The quality value of the <see cref="BestKnownAssignment"/> 48 48 /// </summary> 49 double BestKnownQuality { get; }49 double? BestKnownQuality { get; } 50 50 } 51 51 } -
branches/GeneralizedQAP/HeuristicLab.Problems.Instances/3.3/Plugin.cs
r7444 r7445 23 23 24 24 namespace HeuristicLab.Problems.Instances { 25 [Plugin("HeuristicLab.Problems.Instances", "3.3.6.744 3")]25 [Plugin("HeuristicLab.Problems.Instances", "3.3.6.7444")] 26 26 [PluginFile("HeuristicLab.Problems.Instances-3.3.dll", PluginFileType.Assembly)] 27 27 public class HeuristicLabProblemsInstancesPlugin : PluginBase {
Note: See TracChangeset
for help on using the changeset viewer.