Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/22/12 19:14:33 (12 years ago)
Author:
spimming
Message:

#1894:

  • extended datasource interface to get routing graph for a specific vehicle type
  • use ICostCalculator to calculate edge weights
  • moved common enums in own file
  • removed method to estimate cost from graph; use ICostCalculator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Edge.cs

    r8516 r8520  
    1313    }
    1414
    15     private short category;
    16     public short Category {
    17       get { return category; }
    18       set { category = value; }
    19     }
     15    //private short category;
     16    //public short Category {
     17    //  get { return category; }
     18    //  set { category = value; }
     19    //}
    2020
    2121    private float weight;
     
    3030    }
    3131
    32     public Edge(Vertex source, Vertex target, short category) {
     32    public Edge(Vertex source, Vertex target, float weight) {
    3333      this.source = source;
    3434      this.target = target;
    35       this.category = category;
     35      this.weight = weight;
    3636    }
    3737
     
    5151      return source.GetHashCode() ^ target.GetHashCode();
    5252    }
    53 
    54     public int GetMaxSpeed() {
    55       int speed = 0;
    56 
    57       //TODO:
    58       switch (category) {
    59         case 23:
    60         case 17:
    61         case 18:
    62         case 22:
    63         case 21:
    64         case 24:
    65         case 16:
    66         case 20:
    67         case 15:
    68         case 12:
    69         case 0:
    70           speed = 1;
    71           break;
    72 
    73         case 11:
    74         case 14:
    75           speed = 15;
    76           break;
    77 
    78         case 19:
    79           speed = 30;
    80           break;
    81 
    82         case 9:
    83         case 10:
    84         case 7:
    85         case 8:
    86           speed = 80;
    87           break;
    88 
    89         case 13:
    90           speed = 50;
    91           break;
    92 
    93         case 3:
    94         case 4:
    95         case 5:
    96         case 6:
    97           speed = 100;
    98           break;
    99 
    100         case 1:
    101         case 2:
    102           speed = 130;
    103           break;
    104 
    105         default:
    106           speed = 1;
    107           break;
    108       }
    109       return speed;
    110     }
    11153  }
    11254}
Note: See TracChangeset for help on using the changeset viewer.