i wrote this function in class RoutingExperiment
void RoutingExperiment::ChangePosition(Ptr<Node> node, double step, double speed)
{
Ptr<MobilityModel> mob = node->GetObject<MobilityModel>();
Vector v = mob->GetPosition ();
if(direction==0 && v.x<500) //to go left
v.x+=step*speed;
else if(direction==1 && v.x>0) //to go right
v.x-=step*speed;
else
return;
mob->SetPosition(v);
}
in main
Simulator::Schedule(Seconds(0.2), &RoutingExperiment::ChangePosition(adhocNodes.Get(0),2.0,speed),this,Simulator::Now ().GetSeconds ());
and getting this error
error: lvalue required as unary ‘&’ operand