Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* -*- 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 */