/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2017 Fraunhofer ESK * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Karsten Roscher <karsten.roscher@esk.fraunhofer.de> */ #ifndef TRACI_NODE_UTILS_H #define TRACI_NODE_UTILS_H #include <ns3/ptr.h> #include <ns3/node.h> #include "traci-types.h" namespace ns3 { namespace traci { /*! * @brief Get the current SUMO position of the node. * @param node Node to access, must have an active traci node adapter * @return Position of the associated SUMO object */ Position2D GetPosition (Ptr<Node> node); /*! * @brief Get road distance between two nodes * @param from Node to get the distance from * @param to Node to get the distance to * @return Distance in meters on the road */ double GetRoadDistance (Ptr<Node> from, Ptr<Node> to); /*! * @brief Get the minimum road distance between two nodes * * This will calculate the road distance in both directions and * return the minimum * * @param a First node * @param b Second node * @return Minimum road distance in meters */ double GetMinRoadDistance (Ptr<Node> a, Ptr<Node> b); } // namespace traci } // namespace ns3 #endif /* TRACI_NODE_UTILS_H */