mobility of nodes at different speed

600 views
Skip to first unread message

AJ

unread,
May 20, 2013, 2:14:16 AM5/20/13
to omn...@googlegroups.com
Hi, I am using "stationarymobility" in my project. I am getting the nodes as a static. How do i get the mobility of nodes at different speeds (0 km/h,5 km/h, 10 km/h, 15 km/h, 20 km/h). Can any one suggests plz.

Thanks 
AJ

Alfonso Ariza Quintana

unread,
May 20, 2013, 3:23:35 AM5/20/13
to omn...@googlegroups.com

Change the mobility model to constSpeed

--
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp
 
---
You received this message because you are subscribed to the Google Groups "omnetpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Anupam Jamatia

unread,
May 20, 2013, 5:47:45 AM5/20/13
to omn...@googlegroups.com
On 5/20/13, Alfonso Ariza Quintana <aari...@hotmail.com> wrote:
> Change the mobility model to constSpeed
\--
@Dear Alfonso Sir, I am not getting any output. I just change the
mobilityType=StationaryMobility to constSpeed in the following code.
Any other changes are required?


module MyWirelessHost extends WirelessHost
{
parameters:

IPForward = true;
mobilityType = "StationaryMobility";
// mobilityType = "constSpeed";
mobility.initFromDisplayString = false; // It will take initial
mobility.initialZ = 0.0 m; // position from .initialX,
// .initialY, and .initialZ
wlan[*].mgmtType = "Ieee80211MgmtAdhoc";
wlan[*].opMode = "g"; // Can be "a", "b", "g", "p"
wlan[*].bitrate = 54Mbps; // Default: "a": 54Mbps, "b": 11Mbps
// Default: "g": 54Mbps, and "p": 27 Mbps
wlan[0].mac.rtsThresholdBytes = 2346 B;
wlan[0].radio.channelNumber = 6; // channel identifier.
wlan[0].radio.carrierFrequency = 2.4GHz; // carrier Frequency.
wlan[0].radio.transmitterPower = 2.0 mW; // power used for transmission.
wlan[0].radio.thermalNoise = -110.0 dBm; // base noise level (dBm).
wlan[0].radio.pathLossAlpha = 2.0; // used by the path loss
// calculation (FreeSpace).
wlan[0].radio.snirThreshold = 4.0 dB; // if signal-noise ratio is
// below this threshold, frame
// is considered noise (in dB).
//wlan[0].radio.sensitivity = -83.0563 dBm; // received signals with power
// below sensitivity are
// ignored.
wlan[0].radio.TransmissionAntennaGainIndB = 0dB; // Transmission
Antenna Gain
wlan[0].radio.ReceiveAntennaGainIndB = 0dB; // Receive Antenna Gain
wlan[0].radio.SystemLossFactor = 0dB; // System Loss of Hardware

@display("r=,,#707070;bgb=404,335");
@display("i=device/pocketpc_s");
}


Regards
AJ

Alfonso Ariza Quintana

unread,
May 20, 2013, 5:49:15 AM5/20/13
to omn...@googlegroups.com
mobilityType = "ConstSpeedMobility"

-----Mensaje original-----
Anupam Jamatia
Enviado el: lunes, 20 de mayo de 2013 11:48
Para: omn...@googlegroups.com
Asunto: Re: [Omnetpp-l] mobility of nodes at different speed

Anupam Jamatia

unread,
May 20, 2013, 6:48:53 AM5/20/13
to omn...@googlegroups.com
On Monday 20 May 2013 03:19:15 PM IST, Alfonso Ariza Quintana wrote:
> mobilityType = "ConstSpeedMobility"
\--
Dear Alfanso Sir,

I got the following output
//----------------------------------------------------------------------------------------------------------------------------------
Running simulation...
sta[0] has coordinates (603.59, 394.29) and is at 148.01 meters from
origin
sta[1] has coordinates (482.38, 394.72) and is at 106.75 meters from
origin
sta[2] has coordinates (679.58, 538.92) and is at 183.75 meters from
origin
sta[3] has coordinates (505.81, 503.31) and is at 6.68 meters from
origin
sta[4] has coordinates (480.86, 519.67) and is at 27.44 meters from
origin
sta[5] has coordinates (620.58, 487.57) and is at 121.22 meters from
origin
sta[6] has coordinates (645.44, 410.92) and is at 170.55 meters from
origin
sta[7] has coordinates (562.34, 583.55) and is at 104.25 meters from
origin
sta[8] has coordinates (461.07, 411.07) and is at 97.08 meters from
origin
sta[9] has coordinates (469.07, 508.76) and is at 32.14 meters from
origin
sta[10] has coordinates (563.97, 308.31) and is at 202.08 meters from
origin
sta[11] has coordinates (535.26, 708.67) and is at 211.63 meters from
origin
sta[12] has coordinates (232.85, 500.09) and is at 267.15 meters from
origin
sta[13] has coordinates (306.40, 295.48) and is at 281.62 meters from
origin
sta[14] has coordinates (758.32, 589.26) and is at 273.31 meters from
origin
sta[15] has coordinates (655.27, 326.60) and is at 232.76 meters from
origin
sta[16] has coordinates (560.13, 791.67) and is at 297.81 meters from
origin
sta[17] has coordinates (637.49, 761.03) and is at 295.03 meters from
origin
sta[18] has coordinates (133.00, 392.22) and is at 382.50 meters from
origin
sta[19] has coordinates (231.68, 282.93) and is at 345.13 meters from
origin
sta[20] has coordinates (857.93, 322.53) and is at 399.51 meters from
origin
sta[21] has coordinates (367.57, 873.47) and is at 396.26 meters from
origin
sta[22] has coordinates (808.82, 352.11) and is at 342.41 meters from
origin
initializing MobilityBase stage 0
initializing MovingMobilityBase stage 0
initializing LineSegmentsMobilityBase stage 0
initializing ConstSpeedMobility stage 0
Initializing stage 0
Operating mode: 802.11g retryLimit=7 cwMinMulticast=31 slotTime=9us
DIFS=28us basicBitrate=2M bitrate=54M IDLE=0 RECEIVE=8
MAC Transmission algorithm : Constant Rate
bitrate=54M IDLE=0 RECEIVE=8
Requesting first two frames from queue module
Initializing AbstractRadio, stage=0
Initialized channel with noise: 1e-11 sensitivity: 8.79524e-09
initializing MobilityBase stage 1

<!> Error in module (ConstSpeedMobility)
MobileAdHocNetwork.sta[0].mobility (id=6) at event #1, t=0: Mobility
position is not a finite number after initialize (x=-nan,y=-nan,z=-nan).
--------------------------------------------------------------------------------------------



What I change is

//----------------------------------------------------------------------------------------
module MyWirelessHost extends WirelessHost
{
parameters:

IPForward = true;
//mobilityType = "StationaryMobility";
mobilityType = "ConstSpeedMobility";
mobility.initFromDisplayString = true; // It will take initial
mobility.initialZ = 0.0 m; // position from .initialX,
// .initialY, and .initialZ
mobility.speed=15 mps;
module Origin extends MyWirelessHost
{
parameters:

numUdpApps = 1;
udpApp[0].typename = "UDPOriginApp";
udpApp[0].port = 3000;
networkLayer.ip.forceBroadcast = true;

@display("i=device/pocketpc_s,red");
@display("b=30,30,oval,red,black,2");
}
//---------------------------------------------------------------------------

Sir , How do i get the mobility of nodes at different speeds (0 km/h,5
km/h, 10 km/h, 15 km/h, 20 km/h). any way to do Sir?

--
Anupam

Anupam Jamatia

unread,
May 20, 2013, 6:50:01 AM5/20/13
to omn...@googlegroups.com
module MyWirelessHost extends WirelessHost
{
parameters:

IPForward = true;
//mobilityType = "StationaryMobility";
mobilityType = "ConstSpeedMobility";
mobility.initFromDisplayString = true; // It will take initial
mobility.initialZ = 0.0 m; // position from .initialX,
// .initialY, and .initialZ
mobility.speed=15 mps;

Alfonso Ariza Quintana

unread,
May 20, 2013, 10:14:18 AM5/20/13
to omn...@googlegroups.com
Have you check what is the speed? If the speed is 0 the next coordinate will
be nan

Val/0 = infinity

-----Mensaje original-----
De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de
Anupam Jamatia
Enviado el: lunes, 20 de mayo de 2013 12:50
Para: omn...@googlegroups.com
Asunto: Re: [Omnetpp-l] mobility of nodes at different speed

Anupam Jamatia

unread,
May 20, 2013, 11:30:58 AM5/20/13
to omn...@googlegroups.com
On Monday 20 May 2013 07:44 PM, Alfonso Ariza Quintana wrote:
> Have you check what is the speed? If the speed is 0 the next coordinate will
> be nan
>
> Val/0 = infinity
\--
Dear Alfanso Sir, I have used

mobility.speed=15 mps;


In my controller.cc file I have done with the following code

void Controller::activity()
{
double speedLight = 3.0E8;
double transRange = getParentModule()->par("transRange");
int totalNodes = numNodes1+numNodes2+numNodes3;

cModuleType *dstType;
dstType=cModuleType::get("inet.examples.ajproject.Node");
for(int index=0; index<numNodes1; index++)
{
cModule *sta1;
sta1=dstType->create("sta", getParentModule(), totalNodes, index);
sta1->finalizeParameters();
sta1->buildInside();
// It will place nodes in random positions
double myRadius1 = radius1*dblrand();
double myAngle1 = 2.0*M_PI*dblrand();
double x1 = 500.0+myRadius1*cos(myAngle1);
double y1 = 500.0+myRadius1*sin(myAngle1);
cModule *mobilitysta=sta1->getSubmodule("mobility");
mobilitysta->par("initialX").setDoubleValue(x1);
mobilitysta->par("initialY").setDoubleValue(y1);
double dist = sqrt((500.0-x1)*(500.0-x1) + (500.0-y1)*(500.0-y1));
ev.printf("sta[%d] has coordinates (%.2f, %.2f) and is at %.2f meters"
" from origin \n", index, x1, y1, dist);

cModule *radio1 = sta1->getSubmodule("wlan", 0)->getSubmodule("radio");
double frequency1 = radio1->par("carrierFrequency");
double transmitterPower1 = radio1->par("transmitterPower");
double sensitivity1 = transmitterPower1*speedLight*speedLight;
sensitivity1 /= 16.0*pow(M_PI*frequency1*transRange, 2.0);
sensitivity1 = 10.0*log10(sensitivity1);
radio1->par("sensitivity") = sensitivity1;
}

Sir plz help me out

--
Anupam

Alfonso Ariza Quintana

unread,
May 20, 2013, 11:40:25 AM5/20/13
to omn...@googlegroups.com

Do you want to set the nodes in a circle?

In inetmanet it is possible this in the configuration ini file

CenterX, centerY, radius

**.initialX = circlePositionX(500m, 500m, 60m)
**.initialY = circlePositionY(500m, 500m, 60m)

-----Mensaje original-----
De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de
Anupam Jamatia
Enviado el: lunes, 20 de mayo de 2013 17:31
Para: omn...@googlegroups.com
Asunto: Re: [Omnetpp-l] mobility of nodes at different speed

Anupam Jamatia

unread,
May 20, 2013, 11:43:51 AM5/20/13
to omn...@googlegroups.com, Alfonso Ariza Quintana
On Monday 20 May 2013 09:10 PM, Alfonso Ariza Quintana wrote:
> Do you want to set the nodes in a circle?
>
> In inetmanet it is possible this in the configuration ini file
>
> CenterX, centerY, radius
>
> **.initialX = circlePositionX(500m, 500m, 60m)
> **.initialY = circlePositionY(500m, 500m, 60m)
>
\--

Yes Sir , but my scenario is there is total 3 circles with different radius

this is my .ini file anything I have to change there
----------------------------------------------------------------------------------------
[General]
seed-0-mt=12

network = MobileAdHocNetwork
#debug-on-errors = true
tkenv-plugin-path = ../../../etc/plugins
**.debug = true
**.coreDebug = false
user-interface= Cmdenv # Can also be Tkenv
sim-time-limit=105.0 s # Duration of simulation (simulation time)

**.transRange = 150.0 m

*.radius1 = 200.0
*.numNodes1 = 10

*.radius2 =300.0
*.numNodes2 = 8

*.radius3 = 400.0
*.numNodes3 = 5



*.REBROADCAST_TIME = 0.5 s
*.INTERVAL_BETWEEN_REQUEST = 0.15 s
*.NUM_REBROADCASTS = 2 # A value of 2 corresponds to
# 3 CountRequest

*.origin.udpApp[0].timeOfCountRequest = 20.0
*.origin.udpApp[0].hopLimit = 3


cmdenv-module-messages=true # Show output messages
cmdenv-express-mode=false
cmdenv-event-banners=false
cmdenv-interactive=true
----------------------------------------------------------------------------------------------

Regards

--
Anupam

Alfonso Ariza Quintana

unread,
May 20, 2013, 11:50:41 AM5/20/13
to omn...@googlegroups.com

And what is the problem?
You can have different nodes with different initial conditions, mobility
models, speeds

**.mobilityType = "ConstSpeedMobility"
**.host[0..9].mobility.initialX = circlePositionX(400m,400m,200m)
**.host[0..9].mobility.initialY = circlePositionY(400m,400m,200m)
**.host[0..9].mobility.speed = 1mps


**.host[10..17].mobility.initialX = circlePositionX(100m,400m,100m)
**.host[10..17].mobility.initialY = circlePositionY(100m,400m,100m)
**.host[10..17].mobility.speed = 2mps

-----Mensaje original-----
De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de
Anupam Jamatia
Enviado el: lunes, 20 de mayo de 2013 17:44
Para: omn...@googlegroups.com
CC: Alfonso Ariza Quintana
Asunto: Re: [Omnetpp-l] mobility of nodes at different speed

Anupam Jamatia

unread,
May 20, 2013, 12:17:37 PM5/20/13
to omn...@googlegroups.com, Alfonso Ariza Quintana
On Monday 20 May 2013 09:20 PM, Alfonso Ariza Quintana wrote:
And what is the problem?
You can have different nodes with different initial conditions, mobility
models, speeds

**.mobilityType  = "ConstSpeedMobility"
**.host[0..9].mobility.initialX = circlePositionX(400m,400m,200m)
**.host[0..9].mobility.initialY = circlePositionY(400m,400m,200m)
**.host[0..9].mobility.speed = 1mps


**.host[10..17].mobility.initialX = circlePositionX(100m,400m,100m)
**.host[10..17].mobility.initialY = circlePositionY(100m,400m,100m)
**.host[10..17].mobility.speed = 2mps
Alfanso Sir , In my code What i did

in the main.ned file


module MyWirelessHost extends WirelessHost
{
parameters:
   
   IPForward = true;
   //mobilityType = "StationaryMobility";
   mobilityType = "ConstSpeedMobility";
   mobility.initFromDisplayString = true; // It will take initial
   mobility.initialZ = 0.0 m;              // position from .initialX,
                                           // .initialY, and .initialZ
 
   wlan[*].mgmtType = "Ieee80211MgmtAdhoc";
   wlan[*].opMode = "g";       // Can be "a", "b", "g", "p"
   wlan[*].bitrate = 54Mbps;   // Default: "a": 54Mbps, "b": 11Mbps
                               // Default: "g": 54Mbps, and "p": 27 Mbps
   wlan[0].mac.rtsThresholdBytes = 2346 B;
   wlan[0].radio.channelNumber = 6;          // channel identifier.
   wlan[0].radio.carrierFrequency = 2.4GHz;  // carrier Frequency.
   wlan[0].radio.transmitterPower = 2.0 mW;  // power used for transmission.
   wlan[0].radio.thermalNoise = -110.0 dBm;  // base noise level (dBm).
   wlan[0].radio.pathLossAlpha = 2.0;        // used by the path loss
                                             // calculation (FreeSpace).
   wlan[0].radio.snirThreshold = 4.0 dB;     // if signal-noise ratio is
                                             // below this threshold, frame
                                             // is considered noise (in dB).
   //wlan[0].radio.sensitivity = -83.0563 dBm;  // received signals with power
                                             // below sensitivity are
                                             // ignored.
   wlan[0].radio.TransmissionAntennaGainIndB =  0dB;  // Transmission Antenna Gain
   wlan[0].radio.ReceiveAntennaGainIndB =  0dB;  // Receive Antenna Gain
   wlan[0].radio.SystemLossFactor   =  0dB;      // System Loss of Hardware   

   @display("r=,,#707070;bgb=404,335");
   @display("i=device/pocketpc_s");
}


And in the controller.cc file I did



#include <omnetpp.h>
#include "IPv4InterfaceData.h"
#include "InterfaceEntry.h"
#include "ModuleAccess.h"
#include "IInterfaceTable.h"
#include "Controller.h"


Define_Module(Controller);

Controller::Controller() : cSimpleModule(16384)
{
}

void Controller::initialize()
{
   numNodes1=getParentModule()->par("numNodes1");
   numNodes2=getParentModule()->par("numNodes2");
   numNodes3=getParentModule()->par("numNodes3");
   radius1=getParentModule()->par("radius1");
   radius2=getParentModule()->par("radius2");
   radius3=getParentModule()->par("radius3");
   speed1 = getParentModule()->par("speed1");
   speed2 = getParentModule()->par("speed2");
   speed3 = getParentModule()->par("speed3");

}


void Controller::activity()
{
   double speedLight = 3.0E8;
   double transRange = getParentModule()->par("transRange");
   int totalNodes = numNodes1+numNodes2+numNodes3;

   cModuleType  *dstType;
   dstType=cModuleType::get("inet.examples.ajproject.Node");
   for(int index=0; index<numNodes1; index++)
   {
      cModule *sta1;
      sta1=dstType->create("sta", getParentModule(), totalNodes, index);
      sta1->finalizeParameters();
      sta1->buildInside();
      // It will place nodes in random positions
      double myspeed1 = speed1;

      double myRadius1 = radius1*dblrand();
      double myAngle1 = 2.0*M_PI*dblrand();
      double x1 = 500.0+myRadius1*cos(myAngle1);
      double y1 = 500.0+myRadius1*sin(myAngle1);
      cModule *mobilitysta=sta1->getSubmodule("mobility");
      mobilitysta->par("initialX").setDoubleValue(x1);
      mobilitysta->par("initialY").setDoubleValue(y1);
      double dist = sqrt((500.0-x1)*(500.0-x1) + (500.0-y1)*(500.0-y1));
      ev.printf("sta[%d] has coordinates (%.2f, %.2f) and is at %.2f meters"
                " from origin \n", index, x1, y1, dist);

      cModule *radio1 = sta1->getSubmodule("wlan", 0)->getSubmodule("radio");
      double frequency1 = radio1->par("carrierFrequency");
      double transmitterPower1 = radio1->par("transmitterPower");
      double sensitivity1 = transmitterPower1*speedLight*speedLight;
      sensitivity1 /= 16.0*pow(M_PI*frequency1*transRange, 2.0);
      sensitivity1 = 10.0*log10(sensitivity1);
      radio1->par("sensitivity") = sensitivity1;
   }

   for(int index=numNodes1; index<(numNodes1+numNodes2); index++)
   {
      cModule *sta2;
      sta2=dstType->create("sta", getParentModule(), totalNodes, index);
      sta2->finalizeParameters();
      sta2->buildInside();


      // It will place nodes in random positions
      double myspeed2 = speed2;
      double myRadius2 = (radius2-radius1)*dblrand()+radius1;
      double myAngle2 = 2.0*M_PI*dblrand();
      double x2= 500.0+myRadius2*cos(myAngle2);
      double y2= 500.0+myRadius2*sin(myAngle2);

      cModule *mobilitysta=sta2->getSubmodule("mobility");
      mobilitysta->par("initialX").setDoubleValue(x2);
      mobilitysta->par("initialY").setDoubleValue(y2);
      double dist = sqrt((500.0-x2)*(500.0-x2) + (500.0-y2)*(500.0-y2));

      ev.printf("sta[%d] has coordinates (%.2f, %.2f) and is at %.2f meters"
                " from origin \n", index, x2, y2, dist);

      cModule *radio2 = sta2->getSubmodule("wlan", 0)->getSubmodule("radio");
      double frequency2 = radio2->par("carrierFrequency");
      double transmitterPower2 = radio2->par("transmitterPower");
      double sensitivity2 = transmitterPower2*speedLight*speedLight;
      sensitivity2 /= 16.0*pow(M_PI*frequency2*transRange, 2.0);
      sensitivity2 = 10.0*log10(sensitivity2);
      radio2->par("sensitivity") = sensitivity2;
   }

   for(int index=(numNodes1+numNodes2); index<totalNodes; index++)
   {
      cModule *sta3;
      sta3=dstType->create("sta", getParentModule(), totalNodes, index);
      sta3->finalizeParameters();
      sta3->buildInside();

      // It will place nodes in random positions
      double myspeed3 = speed3;
      double myRadius3 = (radius3-radius2)*dblrand()+radius2;
      double myAngle3 = 2.0*M_PI*dblrand();
      double x3= 500.0+myRadius3*cos(myAngle3);
      double y3= 500.0+myRadius3*sin(myAngle3);

      cModule *mobilitysta=sta3->getSubmodule("mobility");
      mobilitysta->par("initialX").setDoubleValue(x3);
      mobilitysta->par("initialY").setDoubleValue(y3);

      double dist = sqrt((500.0-x3)*(500.0-x3) + (500.0-y3)*(500.0-y3));


      ev.printf("sta[%d] has coordinates (%.2f, %.2f) and is at %.2f meters"
                      " from origin \n", index, x3, y3, dist);

      cModule *radio3 = sta3->getSubmodule("wlan", 0)->getSubmodule("radio");
      double frequency3 = radio3->par("carrierFrequency");
      double transmitterPower3 = radio3->par("transmitterPower");
      double sensitivity3 = transmitterPower3*speedLight*speedLight;
      sensitivity3 /= 16.0*pow(M_PI*frequency3*transRange, 2.0);
      sensitivity3 = 10.0*log10(sensitivity3);
      radio3->par("sensitivity") = sensitivity3;
   }

   cModuleType  *srcType;
   srcType=cModuleType::get("inet.examples.ajproject.Origin");
   cModule *origin=srcType->create("origin", getParentModule());
   origin->finalizeParameters();
   origin->buildInside();

   cModule *mobilityOrigin;
   mobilityOrigin=origin->getSubmodule("mobility");
   mobilityOrigin->par("initialX")=500.0;
   mobilityOrigin->par("initialY")=500.0;

   cModule *radio0 = origin->getSubmodule("wlan", 0)->getSubmodule("radio");
   double frequency0 = radio0->par("carrierFrequency");
   double transmitterPower0 = radio0->par("transmitterPower");
   double sensitivity0 = transmitterPower0*speedLight*speedLight;
   sensitivity0 /= 16.0*pow(M_PI*frequency0*transRange, 2.0);
   sensitivity0 = 10.0*log10(sensitivity0);
   radio0->par("sensitivity") = sensitivity0;

   for(int index=0; index<totalNodes; index++)
   {
      cModule *sta=getParentModule()->getSubmodule("sta", index);
      sta->callInitialize(0);
      sta->callInitialize(1);

      // Assignment of an IP address to wlan0 of nodes

      cModule *ifmnode=sta->getModuleByRelativePath("interfaceTable");
      IInterfaceTable *iftnode=check_and_cast<IInterfaceTable *>(ifmnode);
      InterfaceEntry *e=iftnode->getInterfaceByName("wlan0");
      IPv4InterfaceData *idnode=e->ipv4Data();
      idnode->setIPAddress(IPv4Address(10, 0, 0, 1+index));
      idnode->setNetmask(IPv4Address(255, 255, 0, 0));

      sta->callInitialize(2);
   }

   origin->callInitialize(0);
   origin->callInitialize(1);

   // Assignment of IP Address to wlan0 of origin
   cModule *ifmOrigin=origin->getModuleByRelativePath("interfaceTable");
   IInterfaceTable *iftOrigin=check_and_cast<IInterfaceTable *>(ifmOrigin);
   InterfaceEntry *eOrigin=iftOrigin->getInterfaceByName("wlan0");
   IPv4InterfaceData *idOrigin=eOrigin->ipv4Data();
   idOrigin->setIPAddress(IPv4Address(10, 0, 255, 254));
   idOrigin->setNetmask(IPv4Address(255, 255, 0, 0));

   origin->callInitialize(2);


   for(int index=0; index<totalNodes; index++)
   {
      cModule *sta=getParentModule()->getSubmodule("sta", index);
      sta->callInitialize(3);
      sta->callInitialize(4);
   }

   origin->callInitialize(3);
   origin->callInitialize(4);
   origin->getDisplayString().setTagArg("r2",2,"red");
   // colored the boundary of origin as RED
}


void Controller::finish()
{
}



My .ini file is




[General]
seed-0-mt=12

network = MobileAdHocNetwork
#debug-on-errors = true
tkenv-plugin-path = ../../../etc/plugins
**.debug = true
**.coreDebug = false
user-interface= Cmdenv            # Can also be Tkenv
sim-time-limit=105.0 s            # Duration of simulation (simulation time)

**.transRange =  150.0 m

*.radius1 = 200.0           
*.numNodes1 = 10
*.speed1 = 1 mps



*.radius2 =300.0           
*.numNodes2 = 8
*.speed2 = 2 mps


*.radius3 = 400.0           
*.numNodes3 = 5
*.speed3 = 3 mps



*.REBROADCAST_TIME = 0.5 s
*.INTERVAL_BETWEEN_REQUEST = 0.15 s
*.NUM_REBROADCASTS = 2            # A value of 2 corresponds to
                                  # 3 CountRequest

*.origin.udpApp[0].timeOfCountRequest = 20.0
*.origin.udpApp[0].hopLimit = 3


cmdenv-module-messages=true       # Show output messages
cmdenv-express-mode=false
cmdenv-event-banners=false
cmdenv-interactive=true



Actually i am trying to get the get the mobility of nodes at different speeds (0 km/h,5 km/h, 10 km/h, 15 km/h, 20 km/h etc). ?  Now plz tell me what to change?
Regards
-- 
Anupam

Anupam Jamatia

unread,
May 20, 2013, 12:51:28 PM5/20/13
to omn...@googlegroups.com, Alfonso Ariza Quintana
@Alfanso Sir, I am getting the following error

OMNeT++ Discrete Event Simulation (C) 1992-2011 Andras Varga, OpenSim Ltd.
Version: 4.2.2, build: 120327-7947143, edition: Academic Public License
-- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer
Setting up Cmdenv...
Loading NED files from ../../../src/../examples: 119
Loading NED files from ../../../src: 246

Preparing for running configuration General, run #0...
Scenario: $repetition=0
Assigned runID=General-0-20130520-22:18:51-1289
Setting up network `MobileAdHocNetwork'...

<!> Error in module (cCompoundModule) MobileAdHocNetwork (id=1) during
network setup: Wrong value `1 mps' for parameter
`MobileAdHocNetwork.speed1': Cannot convert unit 'mps' (meter/sec) to none.




--
Anupam

Alfonso Ariza Quintana

unread,
May 20, 2013, 1:16:08 PM5/20/13
to omn...@googlegroups.com
The parameters and configuration that I have included are for the ini file
not for the ned file

-----Mensaje original-----
De: omn...@googlegroups.com [mailto:omn...@googlegroups.com] En nombre de
Anupam Jamatia
Enviado el: lunes, 20 de mayo de 2013 18:51
Reply all
Reply to author
Forward
0 new messages