bug? ConstantVelocityMobilityModel paused after creation

431 views
Skip to first unread message

Marco Porsch

unread,
Jun 10, 2011, 7:34:06 AM6/10/11
to ns-3-...@googlegroups.com
Hello Group,

After creating a ConstantVelocityMobilityModel with the appropiate Helper it is set to paused as standard.


Example code:

MobilityHelper mobility;
mobility.SetMobilityModel ("ns3::ConstantVelocityMobilityModel",
"Position", Vector3DValue (Vector3D (5, 0, 0)),
"Velocity", Vector3DValue (Vector3D (-100, 0, 0)));
mobility.Install (wifiNodes.Get(0));


If the simulation is started like this the node 0 will be stationary.
It is always neccessary to re-set the velocity with:

Ptr <ConstantVelocityMobilityModel> myConstantVelocityMobilityModel = wifiNodes.Get(dst)->GetObject<ConstantVelocityMobilityModel>();
myConstantVelocityMobilityModel->SetVelocity(Vector3D (-100, 0, 0));


I think this is a bug.


Possibility 1:

ConstantVelocityHelper::ConstantVelocityHelper (const Vector &position,
const Vector &vel)
: m_position (position),
m_velocity (vel),
m_paused (true)
{
}

here change m_paused to false


Possibility 2:
add a further Attribute 'Pause' similar to ns3::RandomWaypointMobilityModel.


What do you think?

Regards

Enrico Zamagni

unread,
May 24, 2013, 6:53:42 PM5/24/13
to ns-3-...@googlegroups.com
I can confirm this bug on ns-3.17

The following code:

m_mobility.SetMobilityModel ("ns3::ConstantVelocityMobilityModel",
      "Position", Vector3DValue(Vector3D (0, 0, 0)),
      "Velocity", Vector3DValue(Vector3D(-16.0, 0.0, 0.0)));
m_mobility.Install (n); // here, n is a Node ptr

yields a still node, no mobility whatsoever. Need to correct with
Ptr <ConstantVelocityMobilityModel> cv =v->GetObject<ConstantVelocityMobilityModel>();
cv->SetVelocity(Vector3D(-16.0, 0.0, 0.0));
to get the node to move as expected.

Piotr Wąsek

unread,
May 30, 2013, 4:44:27 PM5/30/13
to ns-3-...@googlegroups.com
What is  variable "v" in the line: Ptr <ConstantVelocityMobilityModel> cv =v->GetObject<ConstantVelocityMobilityModel>(); ?

Enrico Zamagni

unread,
May 30, 2013, 5:36:25 PM5/30/13
to ns-3-...@googlegroups.com
Sorry for not pointing that out: v is a pointer to a Node object (Ptr<Node>).
Actually, it's called v because i'm dealing with vehicles in my simulation (an area of research with wich ns3 is not always so friendly, in my opinion)


2013/5/30 Piotr Wąsek <piotr...@gmail.com>
--
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/6CCVneIH3f4/unsubscribe?hl=en.
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

李窦哲

unread,
Jun 19, 2013, 9:19:21 PM6/19/13
to ns-3-...@googlegroups.com
I also suffer from this problem, and I go through  the code of ConstantVelocityMobilityModel, I didn't find any attribute like Position or Velocity in this model. That means the only way to change the velocity is through SetVelocity method. 

And another, the Position problem, the MobilityHelper only use the position in the PositionAllocator, so may be the initial position should be set via PositionAllocator or SetPosition.

The initial velocity and position problem of ConstantVelocityMobilityModel is very upset.

Achmad Rizal Danisya

unread,
Jul 4, 2013, 4:14:18 AM7/4/13
to ns-3-...@googlegroups.com
thank you for the clue, Guys !

Mitch Watrous

unread,
Jul 4, 2013, 6:56:15 PM7/4/13
to ns-3-...@googlegroups.com
Can someone please post an example script that demonstrates the bug and shows that the velocity is zero at time zero?

Thanks,
Mitch

Achmad Rizal Danisya

unread,
Jul 5, 2013, 12:47:46 AM7/5/13
to ns-3-...@googlegroups.com
here you go, Mr Mitch
please check in the NetAnim to know the bug in node allocation
I made a simple LTE scenario
Internet Host--PGW--eNodeB.............UE Node approaching with 25 mps from 1 Km of eNodeB



--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.

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.
validasi.cc
wscript

Mitch Watrous

unread,
Jul 5, 2013, 2:28:14 PM7/5/13
to ns-3-...@googlegroups.com
Thank you for the example code.

The bug has been confirmed and is in the bug tracker:

    https://www.nsnam.org/bugzilla/show_bug.cgi?id=1717

We will work on a solution and will update the bug tracker with any new information.

Mitch
Reply all
Reply to author
Forward
0 new messages