|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // References a street of the city and defines a position in this street 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 // activitygen module 00012 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) 00013 /****************************************************************************/ 00014 // 00015 // This program is free software; you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation; either version 2 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef AGPOSITION_H 00022 #define AGPOSITION_H 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include "../../utils/geom/Position.h" 00035 #include <list> 00036 #include <map> 00037 00038 00039 // =========================================================================== 00040 // class declarations 00041 // =========================================================================== 00042 class AGStreet; 00043 00044 00045 // =========================================================================== 00046 // class definitions 00047 // =========================================================================== 00059 class AGPosition { 00060 public: 00070 AGPosition(const AGStreet& str, SUMOReal pos) throw(); 00078 AGPosition(const AGStreet& str) throw(); 00079 00084 const AGStreet& getStreet() const throw(); 00085 00093 SUMOReal getPosition() const throw(); 00094 00103 bool operator==(const AGPosition& pos) const throw(); 00104 00110 SUMOReal distanceTo(const AGPosition& otherPos) const throw(); 00111 00120 SUMOReal minDistanceTo(const std::list<AGPosition>& positions) const throw(); 00121 00130 SUMOReal minDistanceTo(const std::map<int, AGPosition>& positions) const throw(); 00131 00135 void print() const throw(); 00136 00137 private: 00138 const AGStreet* street; 00139 SUMOReal position; 00140 Position pos2d; 00141 00146 static SUMOReal randomPositionInStreet(const AGStreet& street) throw(); 00147 00155 Position compute2dPosition() const throw(); 00156 }; 00157 00158 #endif /* AGPOSITION_H */ 00159 00160 /****************************************************************************/