Changeset 2401:7f20ec638bc2 in lemon0.x
 Timestamp:
 03/07/07 14:32:12 (13 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@3232
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/csp.h
r2391 r2401 60 60 typedef SimplePath<Graph> Path; 61 61 62 Graph &_g; 62 private: 63 64 const Graph &_g; 63 65 Tolerance<double> tol; 64 66 65 CM &_cost;66 DM &_delay;67 const CM &_cost; 68 const DM &_delay; 67 69 68 70 class CoMap 69 71 { 70 CM &_cost;71 DM &_delay;72 const CM &_cost; 73 const DM &_delay; 72 74 double _lambda; 73 75 public: 74 76 typedef typename CM::Key Key; 75 77 typedef double Value; 76 CoMap( CM &c,DM &d) :_cost(c), _delay(d), _lambda(0) {}78 CoMap(const CM &c, const DM &d) :_cost(c), _delay(d), _lambda(0) {} 77 79 double lambda() const { return _lambda; } 78 80 void lambda(double l) { _lambda=l; } … … 81 83 return _cost[e]+_lambda*_delay[e]; 82 84 } 83 } _co_map; 85 }; 86 87 CoMap _co_map; 84 88 85 89 86 90 Dijkstra<Graph, CoMap> _dij; 91 92 public: 93 87 94 ///\e 88 95 89 96 ///\e 90 97 /// 91 ConstrainedShortestPath( Graph &g, CM &ct,DM &dl)98 ConstrainedShortestPath(const Graph &g, const CM &ct, const DM &dl) 92 99 : _g(g), _cost(ct), _delay(dl), 93 _co_map(ct, dl), _dij(_g,_co_map) {}100 _co_map(ct, dl), _dij(_g,_co_map) {} 94 101 95 102 96 103 ///Compute the cost of a path 97 double cost(const Path &p) 104 double cost(const Path &p) const 98 105 { 99 106 double s=0; … … 104 111 105 112 ///Compute the delay of a path 106 double delay(const Path &p) 113 double delay(const Path &p) const 107 114 { 108 115 double s=0;
Note: See TracChangeset
for help on using the changeset viewer.