DRCL J-Sim API

drcl.inet.mac
Class MobilityModel

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.Component
          extended bydrcl.net.Module
              extended bydrcl.inet.mac.MobilityModel
All Implemented Interfaces:
ActiveComponent, java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable
Direct Known Subclasses:
SensorMobilityModel

public class MobilityModel
extends Module
implements ActiveComponent

This class simulates the movement of the mobile nodes. The position of the node is periodically updated and reported to the NodePositionTracker component. The coordinates can be either (longitude, lagitude, height) or (X, Y, Z). There are two different modes. If a trajectory array is installed, the mobility model assume the mobile node move from one point in the trajectory to the next point at a constant speed. Otherwise starting from the original position, the node randomly chooses a position in the simulated area as the destination, and moves in a straight line to that destiona point at a constant speed which is uniformly distributed between 0 and Max_Speed. Whenever the node arrives at the destination, it chooses the next position and repeats the procedure again.

Author:
Ye Ge
See Also:
WirelessPhy, NodePositionTracker, Serialized Form

Nested Class Summary
 
Nested classes inherited from class drcl.comp.Component
Component.Locks
 
Field Summary
 double destX
          The x coordinate of the destination position
 double destY
          The y coordinate of the destination position
 double destZ
          The z coordinate of the destination position
 double dX
          The grid size along X-axle
 double dY
          The grid size along Y-axle
 double dZ
          The grid size along Z-axle
 double Max_Speed
          The maximal speed for generating a random speed heading to the next random direction
 double maxX
          The largest x coordinate value of the simulated area
 double maxY
          The largest y coordinate value of the simulated area
 double maxZ
          The largest z coordinate value of the simulated area
 double minX
          The smallest x coordinate value of the simulated area
 double minY
          The smallest y coordinate value of the simulated area
 double minZ
          The smallest z coordinate value of the simulated area
 long nid
          This field is defined to keep the node Id instead of requesting such kind of information from other components which may incur extra simulation overhead.
 double speed
          The moving speed
 double sx
          The moving speed along the x-axle
 double sy
          The moving speed along the y-axle
 double sz
          The moving speed along the z-axle
 double X
          The x coordinator of the node's current position
 double X0
          The x coordinate of the node's previous position
 double Y
          The y coordinator of the node's current position
 double Y0
          The y coordinate of the node's previous position
 double Z
          The z coordinator of the node's current position
 double Z0
          the z coordinate of the node's previous position
 
Fields inherited from class drcl.net.Module
downPort, PortGroup_DOWN, PortGroup_UP, upPort
 
Fields inherited from class drcl.comp.Component
FLAG_COMPONENT_NOTIFICATION, FLAG_DEBUG_ENABLED, FLAG_DIRECT_OUTPUT_ENABLED, FLAG_ENABLED, FLAG_ERROR_ENABLED, FLAG_EVENT_ENABLED, FLAG_GARBAGE_DISPLAY_ENABLED, FLAG_GARBAGE_ENABLED, FLAG_PORT_NOTIFICATION, FLAG_STARTED, FLAG_STOPPED, FLAG_TRACE_ENABLED, FLAG_UNDEFINED_START, id, infoPort, locks, name, parent, PortGroup_DEFAULT_GROUP, PortGroup_EVENT, PortGroup_SERVICE, Root, Trace_DATA, Trace_SEND
 
Constructor Summary
MobilityModel()
          Constructor.
MobilityModel(long nid_)
          Constructor.
 
Method Summary
 long getNid()
          Gets the nid.
 void installTrajectory(double[][] trajectory_)
          Installs a trajectory array.
 void reportPosition(boolean forcedReport)
          Sends position report to the NodePositionTracker component.
 void setNid(long nid_)
          Sets the nid.
 void setPosition(double Max_Speed_, double X_, double Y_, double Z_)
          Sets the initial position of the node.
 void setRandomDestination()
          Sets a random generated destination to move to
 void setRandomPosition()
          Sets this mobile node to a random generated position.
 void setSeed(long seed)
          Sets the seed of the random number generator.
 void setTopologyParameters(double maxX_, double maxY_, double minX_, double minY_, double dX_, double dY_, double dZ_)
          Set topology parameters
 void setTopologyParameters(double maxX_, double maxY_, double maxZ_, double minX_, double minY_, double minZ_, double dX_, double dY_, double dZ_)
          Set topology parameters
 void setTrajectoryDestination()
          Sets the next destination according to the installed trajectory.
 void updatePosition()
          Calculates the current position upon timeout or query
 
Methods inherited from class drcl.net.Module
cancelTimeout, duplicate, setTimeout, setTimeoutAt
 
Methods inherited from class drcl.comp.Component
addComponent, addComponent, addEventPort, addEventPort, addForkPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addPort, addServerPort, addServerPort, cancelFork, connect, containsComponent, containsComponent, containsPort, debug, disconnectAll, disconnectAllPeers, disconnectAllPorts, drop, drop, error, error, expose, exposeEventPorts, exposePort, exposePort, exposePort, exposePort, exposePort, findAvailable, findAvailable, findAvailable, fork, forkAt, getAllComponents, getAllPorts, getAllPorts, getAllWiresInside, getAllWiresInsideOut, getAllWiresOut, getComponent, getComponentFlag, getComponentFlag, getContract, getContractHT, getContractHT, getDebugFlagsInBinary, getDebugLevelNames, getID, getName, getParent, getPort, getPort, getRoot, getTime, iduplicate, info, isAncestorOf, isContainer, isDebugEnabled, isDebugEnabledAt, isDirectlyRelatedTo, isDirectOutputEnabled, isEnabled, isErrorNoticeEnabled, isEventExportEnabled, isGarbageDisplayEnabled, isGarbageEnabled, isPortRemovable, isStarted, isStopped, isTraceEnabled, lock, notify, notifyAll, operate, reboot, removeAll, removeAllComponents, removeAllPorts, removeAllPorts, removeComponent, removeComponent, removePort, removePort, removePort, reset, resume, run, sduplicate, send, sendAt, setComponentFlag, setComponentFlag, setDebugEnabled, setDebugEnabled, setDebugEnabledAt, setDebugEnabledAt, setDebugEnabledAt, setDirectOutputEnabled, setDirectOutputEnabled, setEnabled, setErrorNoticeEnabled, setErrorNoticeEnabled, setEventExportEnabled, setEventExportEnabled, setExecutionBoundary, setGarbageDisplayEnabled, setGarbageDisplayEnabled, setGarbageEnabled, setGarbageEnabled, setID, setID, setName, setPort, setPort, setTraceEnabled, setTraceEnabled, sleepFor, sleepUntil, stop, toString, unexpose, unlock, useLocalForkManager, useLocalForkManager, wait
 
Methods inherited from class drcl.DrclObj
clone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nid

public long nid
This field is defined to keep the node Id instead of requesting such kind of information from other components which may incur extra simulation overhead.


maxX

public double maxX
The largest x coordinate value of the simulated area


maxY

public double maxY
The largest y coordinate value of the simulated area


maxZ

public double maxZ
The largest z coordinate value of the simulated area


minX

public double minX
The smallest x coordinate value of the simulated area


minY

public double minY
The smallest y coordinate value of the simulated area


minZ

public double minZ
The smallest z coordinate value of the simulated area


dX

public double dX
The grid size along X-axle


dY

public double dY
The grid size along Y-axle


dZ

public double dZ
The grid size along Z-axle


X

public double X
The x coordinator of the node's current position


Y

public double Y
The y coordinator of the node's current position


Z

public double Z
The z coordinator of the node's current position


X0

public double X0
The x coordinate of the node's previous position


Y0

public double Y0
The y coordinate of the node's previous position


Z0

public double Z0
the z coordinate of the node's previous position


destX

public double destX
The x coordinate of the destination position


destY

public double destY
The y coordinate of the destination position


destZ

public double destZ
The z coordinate of the destination position


sx

public double sx
The moving speed along the x-axle


sy

public double sy
The moving speed along the y-axle


sz

public double sz
The moving speed along the z-axle


speed

public double speed
The moving speed


Max_Speed

public double Max_Speed
The maximal speed for generating a random speed heading to the next random direction

Constructor Detail

MobilityModel

public MobilityModel(long nid_)
Constructor.

Parameters:
nid_ - the id of the mobile node.

MobilityModel

public MobilityModel()
Constructor.

Method Detail

setNid

public void setNid(long nid_)
Sets the nid.

Parameters:
nid_ - the id of the mobile node.

getNid

public long getNid()
Gets the nid.


installTrajectory

public void installTrajectory(double[][] trajectory_)
Installs a trajectory array.


setTopologyParameters

public void setTopologyParameters(double maxX_,
                                  double maxY_,
                                  double minX_,
                                  double minY_,
                                  double dX_,
                                  double dY_,
                                  double dZ_)
Set topology parameters

Parameters:
maxX_ - largest x coordinate value of the simulated area
minX_ - smallest x coordinate value of the simulated area
maxY_ - largest y coordinate value of the simulated area
minY_ - smallest y coordinate value of the simulated area
dX_ - grid size along X-axle
dY_ - grid size along Y-axle
dZ_ - grid size along Z-axle

setTopologyParameters

public void setTopologyParameters(double maxX_,
                                  double maxY_,
                                  double maxZ_,
                                  double minX_,
                                  double minY_,
                                  double minZ_,
                                  double dX_,
                                  double dY_,
                                  double dZ_)
Set topology parameters

Parameters:
maxX_ - largest x coordinate value of the simulated area
minX_ - smallest x coordinate value of the simulated area
maxY_ - largest y coordinate value of the simulated area
minY_ - smallest y coordinate value of the simulated area
maxZ_ - largest y coordinate value of the simulated area
minZ_ - smallest y coordinate value of the simulated area
dX_ - grid size along X-axle
dY_ - grid size along Y-axle
dZ_ - grid size along Z-axle

setPosition

public void setPosition(double Max_Speed_,
                        double X_,
                        double Y_,
                        double Z_)
Sets the initial position of the node.

Parameters:
Max_Speed_ - - maximum moving speed
X_ - - initial X coordinate
Y_ - - initial Y coordinate
Z_ - - initial Z coordinate

setRandomPosition

public void setRandomPosition()
Sets this mobile node to a random generated position.


setRandomDestination

public void setRandomDestination()
Sets a random generated destination to move to


setTrajectoryDestination

public void setTrajectoryDestination()
Sets the next destination according to the installed trajectory.


updatePosition

public void updatePosition()
Calculates the current position upon timeout or query


reportPosition

public void reportPosition(boolean forcedReport)
Sends position report to the NodePositionTracker component. If falseReport is set to true, the report is generated immediately.


setSeed

public void setSeed(long seed)
Sets the seed of the random number generator.


DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~