Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8321


Ignore:
Timestamp:
07/24/12 17:41:24 (12 years ago)
Author:
spimming
Message:

#1894: initial version of astar algorithm

Location:
branches/RoutePlanning
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/HeuristicLab.Algorithms.GraphRouting.csproj

    r8308 r8321  
    5757  </ItemGroup>
    5858  <ItemGroup>
     59    <Compile Include="AStarAlgorithm.cs" />
    5960    <Compile Include="DijkstraAlgorithm.cs" />
    6061    <Compile Include="GraphRoutingAlgorithm.cs" />
    6162    <Compile Include="IRouter.cs" />
     63    <Compile Include="Pair.cs" />
    6264    <Compile Include="Plugin.cs" />
     65    <Compile Include="PriorityQueue.cs" />
    6366    <Compile Include="Properties\AssemblyInfo.cs" />
    6467  </ItemGroup>
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs

    r8314 r8321  
    117117      return (float)weight;
    118118    }
     119
     120    public float EstimatedCosts(long sourceId, long targetId) {
     121      Vertex<Node> source = GetVertex(sourceId);
     122      Vertex<Node> target = GetVertex(targetId);
     123      return EstimatedCosts(source, target);
     124    }
     125
     126    public float EstimatedCosts(Vertex<Node> source, Vertex<Node> target) {
     127      double distance = Utils.Distance(source.Node.Point, target.Node.Point);
     128      int speed = 130;
     129      double costs = (distance / speed) * 3.6;
     130      return (float)costs;
     131    }
    119132  }
    120133}
Note: See TracChangeset for help on using the changeset viewer.