Changeset 13412 for branches/PTSP/HeuristicLab.Problems.Instances/3.3
- Timestamp:
- 11/28/15 23:38:51 (9 years ago)
- Location:
- branches/PTSP/HeuristicLab.Problems.Instances
- Files:
-
- 3 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/PTSP/HeuristicLab.Problems.Instances/3.3
- Property svn:ignore
-
old new 3 3 Plugin.cs 4 4 *.user 5 *.DotSettings
-
- Property svn:ignore
-
branches/PTSP/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj
r12722 r13412 19 19 <DebugType>full</DebugType> 20 20 <Optimize>false</Optimize> 21 <OutputPath>..\..\ bin\</OutputPath>21 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 22 22 <DefineConstants>DEBUG;TRACE</DefineConstants> 23 23 <ErrorReport>prompt</ErrorReport> … … 28 28 <DebugType>pdbonly</DebugType> 29 29 <Optimize>true</Optimize> 30 <OutputPath>..\..\ bin\</OutputPath>30 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 31 31 <DefineConstants>TRACE</DefineConstants> 32 32 <ErrorReport>prompt</ErrorReport> … … 42 42 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> 43 43 <DebugSymbols>true</DebugSymbols> 44 <OutputPath>..\..\ bin\</OutputPath>44 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 45 45 <DefineConstants>DEBUG;TRACE</DefineConstants> 46 46 <DebugType>full</DebugType> … … 59 59 </PropertyGroup> 60 60 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> 61 <OutputPath>..\..\ bin\</OutputPath>61 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 62 62 <DefineConstants>TRACE</DefineConstants> 63 63 <Optimize>true</Optimize> … … 78 78 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> 79 79 <DebugSymbols>true</DebugSymbols> 80 <OutputPath>..\..\ bin\</OutputPath>80 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 81 81 <DefineConstants>DEBUG;TRACE</DefineConstants> 82 82 <DebugType>full</DebugType> … … 95 95 </PropertyGroup> 96 96 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> 97 <OutputPath>..\..\ bin\</OutputPath>97 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 98 98 <DefineConstants>TRACE</DefineConstants> 99 99 <Optimize>true</Optimize> … … 112 112 </PropertyGroup> 113 113 <ItemGroup> 114 <Reference Include="HeuristicLab.Common-3.3"> 115 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 116 <Private>False</Private> 117 </Reference> 118 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 119 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 120 <Private>False</Private> 121 </Reference> 114 122 <Reference Include="Microsoft.CSharp" /> 115 123 <Reference Include="System" /> … … 121 129 <Compile Include="ProblemInstanceManager.cs" /> 122 130 <Compile Include="IProblemInstanceExporter.cs" /> 131 <Compile Include="Types\PTSPData.cs" /> 123 132 <Compile Include="Types\ATSPData.cs" /> 124 133 <Compile Include="Types\JSSPData.cs" /> … … 146 155 <ItemGroup> 147 156 <None Include="HeuristicLab.snk" /> 148 </ItemGroup>149 <ItemGroup>150 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">151 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>152 <Name>HeuristicLab.Common-3.3</Name>153 <Private>False</Private>154 </ProjectReference>155 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">156 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>157 <Name>HeuristicLab.PluginInfrastructure-3.3</Name>158 <Private>False</Private>159 </ProjectReference>160 157 </ItemGroup> 161 158 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/DistanceHelper.cs
r12012 r13412 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 23 27 24 namespace HeuristicLab.Problems.Instances { 28 25 public enum DistanceMeasure { Direct, Euclidean, RoundedEuclidean, UpperEuclidean, Geo, Manhattan, Maximum, Att }; 29 26 30 27 public static class DistanceHelper { 31 28 /// <summary> … … 35 32 public static double[,] GetDistanceMatrix(DistanceMeasure distanceMeasure, double[,] coordinates, double[,] distances, int dimension) { 36 33 if (distances != null) return distances; 37 34 38 35 distances = new double[dimension, dimension]; 39 36 for (int i = 0; i < dimension - 1; i++) … … 44 41 45 42 return distances; 43 } 44 45 public static double GetDistance(DistanceMeasure distanceMeasure, double x1, double y1, double x2, double y2) { 46 switch (distanceMeasure) { 47 case DistanceMeasure.Att: 48 return AttDistance(x1, y1, x2, y2); 49 case DistanceMeasure.Direct: 50 throw new ArgumentException("Direct distance measure requires distance matrix for distance calculation."); 51 case DistanceMeasure.Euclidean: 52 return EuclideanDistance(x1, y1, x2, y2); 53 case DistanceMeasure.Geo: 54 return GeoDistance(x1, y1, x2, y2); 55 case DistanceMeasure.Manhattan: 56 return ManhattanDistance(x1, y1, x2, y2); 57 case DistanceMeasure.Maximum: 58 return MaximumDistance(x1, y1, x2, y2); 59 case DistanceMeasure.RoundedEuclidean: 60 return Math.Round(EuclideanDistance(x1, y1, x2, y2)); 61 case DistanceMeasure.UpperEuclidean: 62 return Math.Ceiling(EuclideanDistance(x1, y1, x2, y2)); 63 default: 64 throw new InvalidOperationException("Distance measure is not known."); 65 } 46 66 } 47 67 -
branches/PTSP/HeuristicLab.Problems.Instances/3.3/Types/PTSPData.cs
r13408 r13412 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using HeuristicLab.Problems.Instances; 6 7 namespace HeuristicLab.Problems.PTSP { 1 2 namespace HeuristicLab.Problems.Instances { 3 /// <summary> 4 /// Describes instances of the Probabilistic Traveling Salesman Problem (PTSP). 5 /// </summary> 8 6 public class PTSPData : TSPData { 7 /// <summary> 8 /// The probabilities for each of the cities to appear in a route. 9 /// </summary> 9 10 public double[] Probabilities { get; set; } 10 11 }
Note: See TracChangeset
for help on using the changeset viewer.