SimpleFreeway::SimpleFreeway().

37 views
Skip to first unread message

Osama Gazali

unread,
Sep 30, 2014, 9:46:34 AM9/30/14
to ns-3-...@googlegroups.com
In the topic of ns3-Itetris scratch file, I have SimpleFreeway class describe the motorway gemorty and information for nodeID.
My question is how to add acceleration and inter-distance  two nodeID into the   SimpleFreeway::SimpleFreeway().


NS_LOG_COMPONENT_DEFINE ("SimpleFreeway");

namespace ns3 {

  NS_OBJECT_ENSURE_REGISTERED (SimpleFreeway);

  TypeId
  SimpleFreeway::GetTypeId (void)
  {
    static TypeId tid = TypeId ("ns3::SimpleFreeway")
                      .SetParent<Object> ()
                      .AddConstructor<SimpleFreeway> ()
                      ;
    return tid;
  }

  SimpleFreeway::SimpleFreeway()
  : m_numLanes(3),
    m_laneWidth(3.5),
    m_roadShoulderWidth(2.0),
    m_length(1000.0),
    m_edgeWidth(100.0),
    m_minVelo(22.0),
    m_maxVelo(39.0),
    m_timeAheadDist(2.0), //used to set the Erlang distribution
    m_flowCounter(1),
    m_contraflowCounter(1),
    m_numcluster(0),
    m_numsparse(0),
    m_timeWhenFilled(0)
  {
      std::cout<<"SimpleFreeway::SimpleFreeway"<<std::endl;
    for (uint32_t lane = 0; lane < m_numLanes; lane++)
      {
        double v = m_minVelo + lane * ((m_maxVelo - m_minVelo) / (m_numLanes-1));
        m_veloVec.push_back(v);
    
      }
  }

Konstantinos

unread,
Sep 30, 2014, 10:00:10 AM9/30/14
to ns-3-...@googlegroups.com
Hi,

As far as I understand it, SimpleFreeway class is used to describe the road topology, ie. a type of road.
Will the acceleration and inter-distance of two nodes you mention be characteristics of the nodes traveling on that type of road? 
If that's the case, I think you can follow the min/max velocity. Also for inter-distance there is the timeAheadDistance which is used to control it. 


Just a personal comment here: You should not control/force the acceleration of a car in a highway. You just enforce the speed limits. So a Ferrari could go from 60-100km/h in less than 3sec, but a Volvo would take ages.. However, both of them should stay within the speed limits of the road. Hence the acceleration is a characteristic of the vehicle, not of the road!
Further, for inter-distance again, the 'law' enforces a minimum safety distance, if you are closer, you break if not accelerate. These are mainly characteristics of the vehicle and particularly of the driver-model. For iTETRIS you should not be bothered since it uses SUMO for the mobility which has developed all these mobility models.

Osama Gazali

unread,
Sep 30, 2014, 10:15:37 AM9/30/14
to ns-3-...@googlegroups.com
what i understand timeAheadDistance is the safety distance i defined. if i understand you well, i can get the acceleration and inter-distance by following the speed over time (acceleration) and following the position over time.

sorry for this question but how to follow them grammatically and is it fine to called them to application Class as trigger for transmission


thanks a lot KONSTANTINOS

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/pkVrS4ZN-38/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Konstantinos

unread,
Sep 30, 2014, 10:28:03 AM9/30/14
to ns-3-...@googlegroups.com
I can't understand your question. 

What do you mean "follow them grammatically"? 
What you are going to use as trigger mechanism is your design.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Osama Gazali

unread,
Sep 30, 2014, 10:39:58 AM9/30/14
to ns-3-...@googlegroups.com
sorry i mean programmatically. 

I am working on deceltralized congestion control  DCC algorithm to keep channel load functioning and the idea is as it follows
cars tramsit cam 10 hz and when speed or acceleration or inter-distance exceed certain threshold (triggers that’s why i want to get it from SimpleFreeway). if one of them meets, then i dont allow Cam message.

so the classes i work with are
simplefreeway for motorway topology
mobility model-> constantVelocitymobilitymodel
Application-> MassgeMang   for transmission schedule
itetrisManagement class -> for DCC

out of this my problem to get acceleration, interDistance between two cars + How to call them in the MassagMana

Thanks


To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Konstantinos

unread,
Sep 30, 2014, 10:48:55 AM9/30/14
to ns-3-...@googlegroups.com
Neither speed or acceleration or inter-distance can be obtained from Freeway class.
The speed/distance there just thresholds corresponding to limitations of particular road. 

For speed/acceleration you can get it simply by tracing the mobility model trace source.
For inter-distance you need to analyse the received CAMs and construct a neighboring list with each distance. Then monitor them, simply by constructing a new trace source for the distance.

There are examples in NS-3 documentation of how you can use trace sources and how you can develop new.

BTW, if you are using constant velocity mobility model, then how do you expect to see changes in those parameters? They will be 'constant'!!

Osama Gazali

unread,
Sep 30, 2014, 11:06:00 AM9/30/14
to ns-3-...@googlegroups.com
thanks a lot.

good point concerning constantVelocityMobilityModel. For your nice remark, I am think of adding random variation of speed.
I hope it works 

 for (uint32_t lane = 0; lane < m_numLanes; lane++)
      {
        // double v = m_minVelo + lane * ((m_maxVelo - m_minVelo) / (m_numLanes-1)) + ((double)(rand() % 5));
        //m_veloVec.push_back(v);

      }

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

Konstantinos

unread,
Sep 30, 2014, 11:44:13 AM9/30/14
to ns-3-...@googlegroups.com
Again, that's a wrong place to edit.
As I already have mentioned, the FreeWay class defines the characteristics of the road!
Why would be the speed limit different for me compared to you travelling on the same road/lane? 
This part was to assign different limits on different lanes which is acceptable.


Further, if you use iTETRIS with SUMO, you should not be worried about mobility, since SUMO takes care of it and it is not constant. 

Osama Gazali

unread,
Sep 30, 2014, 12:15:44 PM9/30/14
to ns-3-...@googlegroups.com
THANKS A LOT FOR YOUR VALUED INFORMATION.


To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages