src/mobility/random-direction-2d-mobility-model.cc
changeset 2965 4b28e9740e3b
parent 2834 1aab57845b07
child 2989 b7eb3929096c
equal deleted inserted replaced
2964:4e8cb1577144 2965:4b28e9740e3b
    38   static TypeId tid = TypeId ("ns3::RandomDirection2dMobilityModel")
    38   static TypeId tid = TypeId ("ns3::RandomDirection2dMobilityModel")
    39     .SetParent<MobilityModel> ()
    39     .SetParent<MobilityModel> ()
    40     .SetGroupName ("Mobility")
    40     .SetGroupName ("Mobility")
    41     .AddConstructor<RandomDirection2dMobilityModel> ()
    41     .AddConstructor<RandomDirection2dMobilityModel> ()
    42     .AddAttribute ("Bounds", "The 2d bounding area",
    42     .AddAttribute ("Bounds", "The 2d bounding area",
    43                    Rectangle (-100, 100, -100, 100),
    43                    RectangleValue (Rectangle (-100, 100, -100, 100)),
    44                    MakeRectangleAccessor (&RandomDirection2dMobilityModel::m_bounds),
    44                    MakeRectangleAccessor (&RandomDirection2dMobilityModel::m_bounds),
    45                    MakeRectangleChecker ())
    45                    MakeRectangleChecker ())
    46     .AddAttribute ("Speed", "A random variable to control the speed (m/s).",
    46     .AddAttribute ("Speed", "A random variable to control the speed (m/s).",
    47                    UniformVariable (1.0, 2.0),
    47                    RandomVariableValue (UniformVariable (1.0, 2.0)),
    48                    MakeRandomVariableAccessor (&RandomDirection2dMobilityModel::m_speed),
    48                    MakeRandomVariableAccessor (&RandomDirection2dMobilityModel::m_speed),
    49                    MakeRandomVariableChecker ())
    49                    MakeRandomVariableChecker ())
    50     .AddAttribute ("Pause", "A random variable to control the pause (s).",
    50     .AddAttribute ("Pause", "A random variable to control the pause (s).",
    51                    ConstantVariable (2.0),
    51                    RandomVariableValue (ConstantVariable (2.0)),
    52                    MakeRandomVariableAccessor (&RandomDirection2dMobilityModel::m_pause),
    52                    MakeRandomVariableAccessor (&RandomDirection2dMobilityModel::m_pause),
    53                    MakeRandomVariableChecker ())
    53                    MakeRandomVariableChecker ())
    54     ;
    54     ;
    55   return tid;
    55   return tid;
    56 }
    56 }