Simple Module TractorMobility

Package: org.mixim.modules.mobility
File: modules/mobility/TractorMobility.ned

C++ definition

Moves a tractor through a field with a certain amount of rows. Since the tractor also moves around the field, the tractor travels the number of rows PLUS one rows. Consider the following piece of ascii-art for rows=2.

>>>>>>>>>>>>>>>v ^ v ^ v <<<<<<<<<<<<<<<< v ^ v ^ >>>>>>>>>>>>>>>^

NOTE: Does not yet support 3-dimensional movement.

Author: Peterpaul Klein Haneveld

TractorMobility

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Extends:

BaseMobility (simple module)

Module which is responsible for mobility related information like position and movement BaseMobility itself defines a static mobility pattern (means only a position, no movement). Mobility modules which extend from this module will define more complex movement patterns.

Parameters:

Name Type Default value Description
notAffectedByHostState bool true
coreDebug bool

debug switch for the core framework

x double

x coordinate of the nodes' position (-1 = random)

y double

y coordinate of the nodes' position (-1 = random)

z double

z coordinate of the nodes' position (-1 = random)

debug bool

debug switch

x1 double

rectangle is denoted by the (x1,y1) and (x2,y2) coords [m]

y1 double

rectangle is denoted by the (x1,y1) and (x2,y2) coords [m]

x2 double

rectangle is denoted by the (x1,y1) and (x2,y2) coords [m]

y2 double

rectangle is denoted by the (x1,y1) and (x2,y2) coords [m]

rows double

the number of rows the field is divided in

speed double

speed of the host (in m/s)

updateInterval double

time interval to update the hosts position (in seconds)

Properties:

Name Value Description
display i=block/cogwheel
class TractorMobility

Source code:

//
// Moves a tractor through a field with a certain amount of rows.
// Since the tractor also moves around the field, the tractor travels
// the number of rows PLUS one rows. Consider the following piece of
// ascii-art for rows=2.
//
// >>>>>>>>>>>>>>>v
// ^              v
// ^              v
// <<<<<<<<<<<<<<<<
// v              ^
// v              ^
// >>>>>>>>>>>>>>>^
//
// NOTE: Does not yet support 3-dimensional movement.
// @author Peterpaul Klein Haneveld
//
simple TractorMobility extends BaseMobility
{
    parameters:
        @class(TractorMobility);
        bool debug; // debug switch
        double x1 @unit(m); // rectangle is denoted by the (x1,y1) and (x2,y2) coords [m]
        double y1 @unit(m); // rectangle is denoted by the (x1,y1) and (x2,y2) coords [m]
        double x2 @unit(m); // rectangle is denoted by the (x1,y1) and (x2,y2) coords [m]
        double y2 @unit(m); // rectangle is denoted by the (x1,y1) and (x2,y2) coords [m]
        double rows; // the number of rows the field is divided in
        double speed @unit(mps); // speed of the host (in m/s)
        double updateInterval @unit(s); // time interval to update the hosts position (in seconds)
}