Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8301


Ignore:
Timestamp:
07/18/12 16:15:20 (12 years ago)
Author:
spimming
Message:

#1894:

  • graph routing algorithm plugin initial commit
  • load data in problem
Location:
branches/RoutePlanning
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning.Test/Program.cs

    r8293 r8301  
    99      //string filepath = @"..\..\OsmTestFiles\testRelation1.osm";
    1010      XmlDataSource xmlDs = new XmlDataSource(filepath);
    11       xmlDs.ReadData();
     11      //xmlDs.ReadData();
    1212    }
    1313  }
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutePlanningProblem.cs

    r8285 r8301  
    2020#endregion
    2121
     22using System.IO;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    2627using HeuristicLab.Parameters;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     29using HeuristicLab.Problems.RoutePlanning.Osm;
     30using HeuristicLab.Problems.RoutePlanning.Osm.Data;
    2831
    2932namespace HeuristicLab.Problems.RoutePlanning {
     
    3336  public class RoutePlanningProblem : Problem {
    3437    private const string CoordinatesParameterName = "Coordinates";
    35     private const string FromParameterName = "From";
    36     private const string ToParameterName = "To";
     38    private const string SourceParameterName = "Source";
     39    private const string TargetParameterName = "Target";
    3740    public string Filename { get; set; }
     41
     42    IDataSource dataSource;
     43    Graph.Graph graph;
    3844
    3945    #region Parameter Properties
     
    4248      get { return (OptionalValueParameter<DoubleMatrix>)Parameters[CoordinatesParameterName]; }
    4349    }
    44     public ValueParameter<IntValue> FromParameter {
    45       get { return (ValueParameter<IntValue>)Parameters[FromParameterName]; }
     50    public ValueParameter<IntValue> SourceParameter {
     51      get { return (ValueParameter<IntValue>)Parameters[SourceParameterName]; }
    4652    }
    47     public ValueParameter<IntValue> ToParameter {
    48       get { return (ValueParameter<IntValue>)Parameters[ToParameterName]; }
     53    public ValueParameter<IntValue> TargetParameter {
     54      get { return (ValueParameter<IntValue>)Parameters[TargetParameterName]; }
    4955    }
    5056
     
    5864    }
    5965
    60     public IntValue From {
    61       get { return FromParameter.Value; }
    62       set { FromParameter.Value = value; }
     66    public IntValue Source {
     67      get { return SourceParameter.Value; }
     68      set { SourceParameter.Value = value; }
    6369    }
    6470
    65     public IntValue To {
    66       get { return ToParameter.Value; }
    67       set { ToParameter.Value = value; }
     71    public IntValue Target {
     72      get { return TargetParameter.Value; }
     73      set { TargetParameter.Value = value; }
    6874    }
    6975
     
    8692    public RoutePlanningProblem() {
    8793      Parameters.Add(new OptionalValueParameter<DoubleMatrix>(CoordinatesParameterName, "The x- and y-Coordinates of the cities."));
    88       Parameters.Add(new ValueParameter<IntValue>(FromParameterName, "From."));
    89       Parameters.Add(new ValueParameter<IntValue>(ToParameterName, "To."));
     94      Parameters.Add(new ValueParameter<IntValue>(SourceParameterName, "Source Node."));
     95      Parameters.Add(new ValueParameter<IntValue>(TargetParameterName, "Target Node."));
    9096
    9197      RegisterEventHandlers();
     
    96102    private void RegisterEventHandlers() { }
    97103
     104    public void LoadData(string file) {
     105      FileInfo f = new FileInfo(file);
     106      dataSource = new XmlDataSource(file);
     107      graph = new Graph.Graph(dataSource);
     108
     109      Name = f.Name;
     110
     111      OnReset();
     112    }
     113
    98114  }
    99115}
  • branches/RoutePlanning/RoutePlanning.sln

    r8293 r8301  
    77EndProject
    88Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.RoutePlanning.Test", "HeuristicLab.Problems.RoutePlanning.Test\HeuristicLab.Problems.RoutePlanning.Test.csproj", "{004241D1-2127-4489-9DFB-9F7707983371}"
     9EndProject
     10Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.GraphRouting", "HeuristicLab.Algorithms.GraphRouting\HeuristicLab.Algorithms.GraphRouting.csproj", "{4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}"
    911EndProject
    1012Global
     
    4850    {004241D1-2127-4489-9DFB-9F7707983371}.Release|x86.ActiveCfg = Release|x86
    4951    {004241D1-2127-4489-9DFB-9F7707983371}.Release|x86.Build.0 = Release|x86
     52    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     53    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
     54    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
     55    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
     56    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Debug|x86.ActiveCfg = Debug|Any CPU
     57    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
     58    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Release|Any CPU.Build.0 = Release|Any CPU
     59    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
     60    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
     61    {4FE72407-6CAA-4F41-9F2D-D45FDA19ED3C}.Release|x86.ActiveCfg = Release|Any CPU
    5062  EndGlobalSection
    5163  GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset for help on using the changeset viewer.