Merge with ns-3-dev.
authorAndrey Mazo <mazo@iitp.ru>
Tue Mar 10 17:54:58 2009 +0300 (11 months ago)
changeset 47951e94348872e0
parent 4794 ddefc6dd6d9b
parent 4260 29587ce02a57
child 4796 1e8d8afaba15
child 4797 9902003078aa
Merge with ns-3-dev.
src/mobility/static-mobility-model.cc
src/mobility/static-mobility-model.h
src/mobility/static-speed-helper.cc
src/mobility/static-speed-helper.h
src/mobility/static-speed-mobility-model.cc
src/mobility/static-speed-mobility-model.h
     1.1 --- a/CHANGES.html	Sun Mar 01 02:39:10 2009 +0300
     1.2 +++ b/CHANGES.html	Tue Mar 10 17:54:58 2009 +0300
     1.3 @@ -44,6 +44,21 @@
     1.4  us a note on ns-developers mailing list.  </p>
     1.5  
     1.6  <hr>
     1.7 +<h1>changes from ns-3.3 to ns-3.4</h1>
     1.8 +
     1.9 +<h2>new API:</h2>
    1.10 +<ul>
    1.11 +<li>ConstantAccelerationMobilityModel in src/mobility/constant-acceleration-mobility-model.h</li>
    1.12 +</ul>
    1.13 +
    1.14 +<h2>changes to existing API:</h2>
    1.15 +
    1.16 +<ul>
    1.17 +<li>StaticMobilityModel has been renamed ConstantPositionMobilityModel</li>
    1.18 +<li>StaticSpeedMobilityModel has been renamed ConstantVelocityMobilityModel</li>
    1.19 +</ul>
    1.20 +
    1.21 +<hr>
    1.22  <h1>changes from ns-3.2 to ns-3.3</h1>
    1.23  
    1.24  <h2>new API:</h2>
     2.1 --- a/bindings/python/ns3_module_core.py	Sun Mar 01 02:39:10 2009 +0300
     2.2 +++ b/bindings/python/ns3_module_core.py	Tue Mar 10 17:54:58 2009 +0300
     2.3 @@ -1115,10 +1115,11 @@
     2.4      cls.add_constructor([])
     2.5      ## random-variable.h: ns3::UniformVariable::UniformVariable(double s, double l) [constructor]
     2.6      cls.add_constructor([param('double', 's'), param('double', 'l')])
     2.7 -    ## random-variable.h: double ns3::UniformVariable::GetValue() [member function]
     2.8 +    ## random-variable.h: double ns3::UniformVariable::GetValue() const [member function]
     2.9      cls.add_method('GetValue', 
    2.10                     'double', 
    2.11 -                   [])
    2.12 +                   [], 
    2.13 +                   is_const=True)
    2.14      ## random-variable.h: double ns3::UniformVariable::GetValue(double s, double l) [member function]
    2.15      cls.add_method('GetValue', 
    2.16                     'double', 
    2.17 @@ -2130,7 +2131,7 @@
    2.18      module.add_function('TypeNameGet', 
    2.19                          'std::string', 
    2.20                          [], 
    2.21 -                        template_parameters=['long long'])
    2.22 +                        template_parameters=['long'])
    2.23      ## type-name.h: extern std::string ns3::TypeNameGet() [free function]
    2.24      module.add_function('TypeNameGet', 
    2.25                          'std::string', 
    2.26 @@ -2150,7 +2151,7 @@
    2.27      module.add_function('TypeNameGet', 
    2.28                          'std::string', 
    2.29                          [], 
    2.30 -                        template_parameters=['unsigned long long'])
    2.31 +                        template_parameters=['unsigned long'])
    2.32      ## type-name.h: extern std::string ns3::TypeNameGet() [free function]
    2.33      module.add_function('TypeNameGet', 
    2.34                          'std::string', 
     3.1 --- a/bindings/python/ns3_module_internet_stack.py	Sun Mar 01 02:39:10 2009 +0300
     3.2 +++ b/bindings/python/ns3_module_internet_stack.py	Tue Mar 10 17:54:58 2009 +0300
     3.3 @@ -23,12 +23,6 @@
     3.4      module.add_enum('Flags_t', ['NONE', 'FIN', 'SYN', 'RST', 'PSH', 'ACK', 'URG'], outer_class=root_module['ns3::TcpHeader'])
     3.5      ## udp-header.h: ns3::UdpHeader [class]
     3.6      module.add_class('UdpHeader', parent=root_module['ns3::Header'])
     3.7 -    ## ipv4-interface.h: ns3::Ipv4Interface [class]
     3.8 -    module.add_class('Ipv4Interface', parent=root_module['ns3::Object'])
     3.9 -    ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol [class]
    3.10 -    module.add_class('Ipv4L3Protocol', parent=root_module['ns3::Object'])
    3.11 -    ## ipv4-static-routing.h: ns3::Ipv4StaticRouting [class]
    3.12 -    module.add_class('Ipv4StaticRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
    3.13      ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting [class]
    3.14      module.add_class('Ipv4GlobalRouting', parent=root_module['ns3::Ipv4RoutingProtocol'])
    3.15      
    3.16 @@ -79,9 +73,6 @@
    3.17      register_Ns3Icmpv4TimeExceeded_methods(root_module, root_module['ns3::Icmpv4TimeExceeded'])
    3.18      register_Ns3TcpHeader_methods(root_module, root_module['ns3::TcpHeader'])
    3.19      register_Ns3UdpHeader_methods(root_module, root_module['ns3::UdpHeader'])
    3.20 -    register_Ns3Ipv4Interface_methods(root_module, root_module['ns3::Ipv4Interface'])
    3.21 -    register_Ns3Ipv4L3Protocol_methods(root_module, root_module['ns3::Ipv4L3Protocol'])
    3.22 -    register_Ns3Ipv4StaticRouting_methods(root_module, root_module['ns3::Ipv4StaticRouting'])
    3.23      register_Ns3Ipv4GlobalRouting_methods(root_module, root_module['ns3::Ipv4GlobalRouting'])
    3.24      return
    3.25  
    3.26 @@ -517,392 +508,6 @@
    3.27                     is_const=True)
    3.28      return
    3.29  
    3.30 -def register_Ns3Ipv4Interface_methods(root_module, cls):
    3.31 -    ## ipv4-interface.h: ns3::Ipv4Interface::Ipv4Interface(ns3::Ipv4Interface const & arg0) [copy constructor]
    3.32 -    cls.add_constructor([param('ns3::Ipv4Interface const &', 'arg0')])
    3.33 -    ## ipv4-interface.h: static ns3::TypeId ns3::Ipv4Interface::GetTypeId() [member function]
    3.34 -    cls.add_method('GetTypeId', 
    3.35 -                   'ns3::TypeId', 
    3.36 -                   [], 
    3.37 -                   is_static=True)
    3.38 -    ## ipv4-interface.h: ns3::Ipv4Interface::Ipv4Interface() [constructor]
    3.39 -    cls.add_constructor([])
    3.40 -    ## ipv4-interface.h: ns3::Ptr<ns3::NetDevice> ns3::Ipv4Interface::GetDevice() const [member function]
    3.41 -    cls.add_method('GetDevice', 
    3.42 -                   'ns3::Ptr< ns3::NetDevice >', 
    3.43 -                   [], 
    3.44 -                   is_pure_virtual=True, is_const=True, is_virtual=True)
    3.45 -    ## ipv4-interface.h: void ns3::Ipv4Interface::SetAddress(ns3::Ipv4Address a) [member function]
    3.46 -    cls.add_method('SetAddress', 
    3.47 -                   'void', 
    3.48 -                   [param('ns3::Ipv4Address', 'a')])
    3.49 -    ## ipv4-interface.h: void ns3::Ipv4Interface::SetNetworkMask(ns3::Ipv4Mask mask) [member function]
    3.50 -    cls.add_method('SetNetworkMask', 
    3.51 -                   'void', 
    3.52 -                   [param('ns3::Ipv4Mask', 'mask')])
    3.53 -    ## ipv4-interface.h: ns3::Ipv4Address ns3::Ipv4Interface::GetBroadcast() const [member function]
    3.54 -    cls.add_method('GetBroadcast', 
    3.55 -                   'ns3::Ipv4Address', 
    3.56 -                   [], 
    3.57 -                   is_const=True)
    3.58 -    ## ipv4-interface.h: ns3::Ipv4Mask ns3::Ipv4Interface::GetNetworkMask() const [member function]
    3.59 -    cls.add_method('GetNetworkMask', 
    3.60 -                   'ns3::Ipv4Mask', 
    3.61 -                   [], 
    3.62 -                   is_const=True)
    3.63 -    ## ipv4-interface.h: void ns3::Ipv4Interface::SetMetric(uint16_t metric) [member function]
    3.64 -    cls.add_method('SetMetric', 
    3.65 -                   'void', 
    3.66 -                   [param('uint16_t', 'metric')])
    3.67 -    ## ipv4-interface.h: uint16_t ns3::Ipv4Interface::GetMetric() const [member function]
    3.68 -    cls.add_method('GetMetric', 
    3.69 -                   'uint16_t', 
    3.70 -                   [], 
    3.71 -                   is_const=True)
    3.72 -    ## ipv4-interface.h: ns3::Ipv4Address ns3::Ipv4Interface::GetAddress() const [member function]
    3.73 -    cls.add_method('GetAddress', 
    3.74 -                   'ns3::Ipv4Address', 
    3.75 -                   [], 
    3.76 -                   is_const=True)
    3.77 -    ## ipv4-interface.h: uint16_t ns3::Ipv4Interface::GetMtu() const [member function]
    3.78 -    cls.add_method('GetMtu', 
    3.79 -                   'uint16_t', 
    3.80 -                   [], 
    3.81 -                   is_const=True)
    3.82 -    ## ipv4-interface.h: bool ns3::Ipv4Interface::IsUp() const [member function]
    3.83 -    cls.add_method('IsUp', 
    3.84 -                   'bool', 
    3.85 -                   [], 
    3.86 -                   is_const=True)
    3.87 -    ## ipv4-interface.h: bool ns3::Ipv4Interface::IsDown() const [member function]
    3.88 -    cls.add_method('IsDown', 
    3.89 -                   'bool', 
    3.90 -                   [], 
    3.91 -                   is_const=True)
    3.92 -    ## ipv4-interface.h: void ns3::Ipv4Interface::SetUp() [member function]
    3.93 -    cls.add_method('SetUp', 
    3.94 -                   'void', 
    3.95 -                   [])
    3.96 -    ## ipv4-interface.h: void ns3::Ipv4Interface::SetDown() [member function]
    3.97 -    cls.add_method('SetDown', 
    3.98 -                   'void', 
    3.99 -                   [])
   3.100 -    ## ipv4-interface.h: void ns3::Ipv4Interface::Send(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Address dest) [member function]
   3.101 -    cls.add_method('Send', 
   3.102 -                   'void', 
   3.103 -                   [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address', 'dest')])
   3.104 -    ## ipv4-interface.h: void ns3::Ipv4Interface::DoDispose() [member function]
   3.105 -    cls.add_method('DoDispose', 
   3.106 -                   'void', 
   3.107 -                   [], 
   3.108 -                   visibility='protected', is_virtual=True)
   3.109 -    ## ipv4-interface.h: void ns3::Ipv4Interface::SendTo(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Address dest) [member function]
   3.110 -    cls.add_method('SendTo', 
   3.111 -                   'void', 
   3.112 -                   [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address', 'dest')], 
   3.113 -                   is_pure_virtual=True, visibility='private', is_virtual=True)
   3.114 -    return
   3.115 -
   3.116 -def register_Ns3Ipv4L3Protocol_methods(root_module, cls):
   3.117 -    ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::PROT_NUMBER [variable]
   3.118 -    cls.add_static_attribute('PROT_NUMBER', 'uint16_t const', is_const=True)
   3.119 -    ## ipv4-l3-protocol.h: static ns3::TypeId ns3::Ipv4L3Protocol::GetTypeId() [member function]
   3.120 -    cls.add_method('GetTypeId', 
   3.121 -                   'ns3::TypeId', 
   3.122 -                   [], 
   3.123 -                   is_static=True)
   3.124 -    ## ipv4-l3-protocol.h: ns3::Ipv4L3Protocol::Ipv4L3Protocol() [constructor]
   3.125 -    cls.add_constructor([])
   3.126 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetNode(ns3::Ptr<ns3::Node> node) [member function]
   3.127 -    cls.add_method('SetNode', 
   3.128 -                   'void', 
   3.129 -                   [param('ns3::Ptr< ns3::Node >', 'node')])
   3.130 -    ## ipv4-l3-protocol.h: ns3::Ptr<ns3::Socket> ns3::Ipv4L3Protocol::CreateRawSocket() [member function]
   3.131 -    cls.add_method('CreateRawSocket', 
   3.132 -                   'ns3::Ptr< ns3::Socket >', 
   3.133 -                   [])
   3.134 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::DeleteRawSocket(ns3::Ptr<ns3::Socket> socket) [member function]
   3.135 -    cls.add_method('DeleteRawSocket', 
   3.136 -                   'void', 
   3.137 -                   [param('ns3::Ptr< ns3::Socket >', 'socket')])
   3.138 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Insert(ns3::Ptr<ns3::Ipv4L4Protocol> protocol) [member function]
   3.139 -    cls.add_method('Insert', 
   3.140 -                   'void', 
   3.141 -                   [param('ns3::Ptr< ns3::Ipv4L4Protocol >', 'protocol')])
   3.142 -    ## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4L4Protocol> ns3::Ipv4L3Protocol::GetProtocol(int protocolNumber) const [member function]
   3.143 -    cls.add_method('GetProtocol', 
   3.144 -                   'ns3::Ptr< ns3::Ipv4L4Protocol >', 
   3.145 -                   [param('int', 'protocolNumber')], 
   3.146 -                   is_const=True)
   3.147 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Remove(ns3::Ptr<ns3::Ipv4L4Protocol> protocol) [member function]
   3.148 -    cls.add_method('Remove', 
   3.149 -                   'void', 
   3.150 -                   [param('ns3::Ptr< ns3::Ipv4L4Protocol >', 'protocol')])
   3.151 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDefaultTtl(uint8_t ttl) [member function]
   3.152 -    cls.add_method('SetDefaultTtl', 
   3.153 -                   'void', 
   3.154 -                   [param('uint8_t', 'ttl')])
   3.155 -    ## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4Interface> ns3::Ipv4L3Protocol::FindInterfaceForDevice(ns3::Ptr<const ns3::NetDevice> device) [member function]
   3.156 -    cls.add_method('FindInterfaceForDevice', 
   3.157 -                   'ns3::Ptr< ns3::Ipv4Interface >', 
   3.158 -                   [param('ns3::Ptr< ns3::NetDevice const >', 'device')])
   3.159 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Receive(ns3::Ptr<ns3::NetDevice> device, ns3::Ptr<const ns3::Packet> p, uint16_t protocol, ns3::Address const & from, ns3::Address const & to, ns3::NetDevice::PacketType packetType) [member function]
   3.160 -    cls.add_method('Receive', 
   3.161 -                   'void', 
   3.162 -                   [param('ns3::Ptr< ns3::NetDevice >', 'device'), param('ns3::Ptr< ns3::Packet const >', 'p'), param('uint16_t', 'protocol'), param('ns3::Address const &', 'from'), param('ns3::Address const &', 'to'), param('ns3::NetDevice::PacketType', 'packetType')])
   3.163 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol) [member function]
   3.164 -    cls.add_method('Send', 
   3.165 -                   'void', 
   3.166 -                   [param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol')])
   3.167 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
   3.168 -    cls.add_method('AddHostRouteTo', 
   3.169 -                   'void', 
   3.170 -                   [param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
   3.171 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
   3.172 -    cls.add_method('AddHostRouteTo', 
   3.173 -                   'void', 
   3.174 -                   [param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
   3.175 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
   3.176 -    cls.add_method('AddNetworkRouteTo', 
   3.177 -                   'void', 
   3.178 -                   [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
   3.179 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
   3.180 -    cls.add_method('AddNetworkRouteTo', 
   3.181 -                   'void', 
   3.182 -                   [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
   3.183 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function]
   3.184 -    cls.add_method('SetDefaultRoute', 
   3.185 -                   'void', 
   3.186 -                   [param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
   3.187 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::Lookup(ns3::Ipv4Header const & ipHeader, ns3::Ptr<ns3::Packet> packet, ns3::Callback<void,bool,const ns3::Ipv4Route&,ns3::Ptr<ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> routeReply) [member function]
   3.188 -    cls.add_method('Lookup', 
   3.189 -                   'void', 
   3.190 -                   [param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, ns3::Ipv4Route const &, ns3::Ptr< ns3::Packet >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'routeReply')])
   3.191 -    ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNRoutes() [member function]
   3.192 -    cls.add_method('GetNRoutes', 
   3.193 -                   'uint32_t', 
   3.194 -                   [])
   3.195 -    ## ipv4-l3-protocol.h: ns3::Ipv4Route * ns3::Ipv4L3Protocol::GetRoute(uint32_t i) [member function]
   3.196 -    cls.add_method('GetRoute', 
   3.197 -                   'ns3::Ipv4Route *', 
   3.198 -                   [param('uint32_t', 'i')])
   3.199 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::RemoveRoute(uint32_t i) [member function]
   3.200 -    cls.add_method('RemoveRoute', 
   3.201 -                   'void', 
   3.202 -                   [param('uint32_t', 'i')])
   3.203 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector<unsigned int, std::allocator<unsigned int> > outputInterfaces) [member function]
   3.204 -    cls.add_method('AddMulticastRoute', 
   3.205 -                   'void', 
   3.206 -                   [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')])
   3.207 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDefaultMulticastRoute(uint32_t onputInterface) [member function]
   3.208 -    cls.add_method('SetDefaultMulticastRoute', 
   3.209 -                   'void', 
   3.210 -                   [param('uint32_t', 'onputInterface')])
   3.211 -    ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNMulticastRoutes() const [member function]
   3.212 -    cls.add_method('GetNMulticastRoutes', 
   3.213 -                   'uint32_t', 
   3.214 -                   [], 
   3.215 -                   is_const=True)
   3.216 -    ## ipv4-l3-protocol.h: ns3::Ipv4MulticastRoute * ns3::Ipv4L3Protocol::GetMulticastRoute(uint32_t i) const [member function]
   3.217 -    cls.add_method('GetMulticastRoute', 
   3.218 -                   'ns3::Ipv4MulticastRoute *', 
   3.219 -                   [param('uint32_t', 'i')], 
   3.220 -                   is_const=True)
   3.221 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::RemoveMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface) [member function]
   3.222 -    cls.add_method('RemoveMulticastRoute', 
   3.223 -                   'void', 
   3.224 -                   [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface')])
   3.225 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::RemoveMulticastRoute(uint32_t i) [member function]
   3.226 -    cls.add_method('RemoveMulticastRoute', 
   3.227 -                   'void', 
   3.228 -                   [param('uint32_t', 'i')])
   3.229 -    ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::AddInterface(ns3::Ptr<ns3::NetDevice> device) [member function]
   3.230 -    cls.add_method('AddInterface', 
   3.231 -                   'uint32_t', 
   3.232 -                   [param('ns3::Ptr< ns3::NetDevice >', 'device')])
   3.233 -    ## ipv4-l3-protocol.h: ns3::Ptr<ns3::Ipv4Interface> ns3::Ipv4L3Protocol::GetInterface(uint32_t i) const [member function]
   3.234 -    cls.add_method('GetInterface', 
   3.235 -                   'ns3::Ptr< ns3::Ipv4Interface >', 
   3.236 -                   [param('uint32_t', 'i')], 
   3.237 -                   is_const=True)
   3.238 -    ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::GetNInterfaces() const [member function]
   3.239 -    cls.add_method('GetNInterfaces', 
   3.240 -                   'uint32_t', 
   3.241 -                   [], 
   3.242 -                   is_const=True)
   3.243 -    ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::FindInterfaceForAddr(ns3::Ipv4Address addr) const [member function]
   3.244 -    cls.add_method('FindInterfaceForAddr', 
   3.245 -                   'uint32_t', 
   3.246 -                   [param('ns3::Ipv4Address', 'addr')], 
   3.247 -                   is_const=True)
   3.248 -    ## ipv4-l3-protocol.h: uint32_t ns3::Ipv4L3Protocol::FindInterfaceForAddr(ns3::Ipv4Address addr, ns3::Ipv4Mask mask) const [member function]
   3.249 -    cls.add_method('FindInterfaceForAddr', 
   3.250 -                   'uint32_t', 
   3.251 -                   [param('ns3::Ipv4Address', 'addr'), param('ns3::Ipv4Mask', 'mask')], 
   3.252 -                   is_const=True)
   3.253 -    ## ipv4-l3-protocol.h: int32_t ns3::Ipv4L3Protocol::FindInterfaceIndexForDevice(ns3::Ptr<ns3::NetDevice> device) const [member function]
   3.254 -    cls.add_method('FindInterfaceIndexForDevice', 
   3.255 -                   'int32_t', 
   3.256 -                   [param('ns3::Ptr< ns3::NetDevice >', 'device')], 
   3.257 -                   is_const=True)
   3.258 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::JoinMulticastGroup(ns3::Ipv4Address origin, ns3::Ipv4Address group) [member function]
   3.259 -    cls.add_method('JoinMulticastGroup', 
   3.260 -                   'void', 
   3.261 -                   [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group')])
   3.262 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::LeaveMulticastGroup(ns3::Ipv4Address origin, ns3::Ipv4Address group) [member function]
   3.263 -    cls.add_method('LeaveMulticastGroup', 
   3.264 -                   'void', 
   3.265 -                   [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group')])
   3.266 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetAddress(uint32_t i, ns3::Ipv4Address address) [member function]
   3.267 -    cls.add_method('SetAddress', 
   3.268 -                   'void', 
   3.269 -                   [param('uint32_t', 'i'), param('ns3::Ipv4Address', 'address')])
   3.270 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetNetworkMask(uint32_t i, ns3::Ipv4Mask mask) [member function]
   3.271 -    cls.add_method('SetNetworkMask', 
   3.272 -                   'void', 
   3.273 -                   [param('uint32_t', 'i'), param('ns3::Ipv4Mask', 'mask')])
   3.274 -    ## ipv4-l3-protocol.h: ns3::Ipv4Mask ns3::Ipv4L3Protocol::GetNetworkMask(uint32_t t) const [member function]
   3.275 -    cls.add_method('GetNetworkMask', 
   3.276 -                   'ns3::Ipv4Mask', 
   3.277 -                   [param('uint32_t', 't')], 
   3.278 -                   is_const=True)
   3.279 -    ## ipv4-l3-protocol.h: ns3::Ipv4Address ns3::Ipv4L3Protocol::GetAddress(uint32_t i) const [member function]
   3.280 -    cls.add_method('GetAddress', 
   3.281 -                   'ns3::Ipv4Address', 
   3.282 -                   [param('uint32_t', 'i')], 
   3.283 -                   is_const=True)
   3.284 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetMetric(uint32_t i, uint16_t metric) [member function]
   3.285 -    cls.add_method('SetMetric', 
   3.286 -                   'void', 
   3.287 -                   [param('uint32_t', 'i'), param('uint16_t', 'metric')])
   3.288 -    ## ipv4-l3-protocol.h: uint16_t ns3::Ipv4L3Protocol::GetMetric(uint32_t i) const [member function]
   3.289 -    cls.add_method('GetMetric', 
   3.290 -                   'uint16_t', 
   3.291 -                   [param('uint32_t', 'i')], 
   3.292 -                   is_const=True)
   3.293 -    ## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::GetIfIndexForDestination(ns3::Ipv4Address destination, uint32_t & ifIndex) const [member function]
   3.294 -    cls.add_method('GetIfIndexForDestination', 
   3.295 -                   'bool', 
   3.296 -                   [param('ns3::Ipv4Address', 'destination'), param('uint32_t &', 'ifIndex')], 
   3.297 -                   is_const=True)
   3.298 -    ## ipv4-l3-protocol.h: uint16_t ns3::Ipv4L3Protocol::GetMtu(uint32_t i) const [member function]
   3.299 -    cls.add_method('GetMtu', 
   3.300 -                   'uint16_t', 
   3.301 -                   [param('uint32_t', 'i')], 
   3.302 -                   is_const=True)
   3.303 -    ## ipv4-l3-protocol.h: bool ns3::Ipv4L3Protocol::IsUp(uint32_t i) const [member function]
   3.304 -    cls.add_method('IsUp', 
   3.305 -                   'bool', 
   3.306 -                   [param('uint32_t', 'i')], 
   3.307 -                   is_const=True)
   3.308 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetUp(uint32_t i) [member function]
   3.309 -    cls.add_method('SetUp', 
   3.310 -                   'void', 
   3.311 -                   [param('uint32_t', 'i')])
   3.312 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::SetDown(uint32_t i) [member function]
   3.313 -    cls.add_method('SetDown', 
   3.314 -                   'void', 
   3.315 -                   [param('uint32_t', 'i')])
   3.316 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::AddRoutingProtocol(ns3::Ptr<ns3::Ipv4RoutingProtocol> routingProtocol, int priority) [member function]
   3.317 -    cls.add_method('AddRoutingProtocol', 
   3.318 -                   'void', 
   3.319 -                   [param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol'), param('int', 'priority')])
   3.320 -    ## ipv4-l3-protocol.h: void ns3::Ipv4L3Protocol::DoDispose() [member function]
   3.321 -    cls.add_method('DoDispose', 
   3.322 -                   'void', 
   3.323 -                   [], 
   3.324 -                   visibility='protected', is_virtual=True)
   3.325 -    return
   3.326 -
   3.327 -def register_Ns3Ipv4StaticRouting_methods(root_module, cls):
   3.328 -    ## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting(ns3::Ipv4StaticRouting const & arg0) [copy constructor]
   3.329 -    cls.add_constructor([param('ns3::Ipv4StaticRouting const &', 'arg0')])
   3.330 -    ## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting() [constructor]
   3.331 -    cls.add_constructor([])
   3.332 -    ## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestRoute(uint32_t ifIndex, ns3::Ipv4Header const & ipHeader, ns3::Ptr<ns3::Packet> packet, ns3::Callback<void,bool,const ns3::Ipv4Route&,ns3::Ptr<ns3::Packet>,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> routeReply) [member function]
   3.333 -    cls.add_method('RequestRoute', 
   3.334 -                   'bool', 
   3.335 -                   [param('uint32_t', 'ifIndex'), param('ns3::Ipv4Header const &', 'ipHeader'), param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Callback< void, bool, ns3::Ipv4Route const &, ns3::Ptr< ns3::Packet >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'routeReply')], 
   3.336 -                   is_virtual=True)
   3.337 -    ## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestIfIndex(ns3::Ipv4Address destination, uint32_t & ifIndex) [member function]
   3.338 -    cls.add_method('RequestIfIndex', 
   3.339 -                   'bool', 
   3.340 -                   [param('ns3::Ipv4Address', 'destination'), param('uint32_t &', 'ifIndex')], 
   3.341 -                   is_virtual=True)
   3.342 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
   3.343 -    cls.add_method('AddHostRouteTo', 
   3.344 -                   'void', 
   3.345 -                   [param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
   3.346 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface) [member function]
   3.347 -    cls.add_method('AddHostRouteTo', 
   3.348 -                   'void', 
   3.349 -                   [param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface')])
   3.350 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface) [member function]
   3.351 -    cls.add_method('AddNetworkRouteTo', 
   3.352 -                   'void', 
   3.353 -                   [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
   3.354 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface) [member function]
   3.355 -    cls.add_method('AddNetworkRouteTo', 
   3.356 -                   'void', 
   3.357 -                   [param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface')])
   3.358 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface) [member function]
   3.359 -    cls.add_method('SetDefaultRoute', 
   3.360 -                   'void', 
   3.361 -                   [param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface')])
   3.362 -    ## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNRoutes() [member function]
   3.363 -    cls.add_method('GetNRoutes', 
   3.364 -                   'uint32_t', 
   3.365 -                   [])
   3.366 -    ## ipv4-static-routing.h: ns3::Ipv4Route * ns3::Ipv4StaticRouting::GetDefaultRoute() [member function]
   3.367 -    cls.add_method('GetDefaultRoute', 
   3.368 -                   'ns3::Ipv4Route *', 
   3.369 -                   [])
   3.370 -    ## ipv4-static-routing.h: ns3::Ipv4Route * ns3::Ipv4StaticRouting::GetRoute(uint32_t i) [member function]
   3.371 -    cls.add_method('GetRoute', 
   3.372 -                   'ns3::Ipv4Route *', 
   3.373 -                   [param('uint32_t', 'i')])
   3.374 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveRoute(uint32_t i) [member function]
   3.375 -    cls.add_method('RemoveRoute', 
   3.376 -                   'void', 
   3.377 -                   [param('uint32_t', 'i')])
   3.378 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::AddMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector<unsigned int, std::allocator<unsigned int> > outputInterfaces) [member function]
   3.379 -    cls.add_method('AddMulticastRoute', 
   3.380 -                   'void', 
   3.381 -                   [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')])
   3.382 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) [member function]
   3.383 -    cls.add_method('SetDefaultMulticastRoute', 
   3.384 -                   'void', 
   3.385 -                   [param('uint32_t', 'outputInterface')])
   3.386 -    ## ipv4-static-routing.h: uint32_t ns3::Ipv4StaticRouting::GetNMulticastRoutes() const [member function]
   3.387 -    cls.add_method('GetNMulticastRoutes', 
   3.388 -                   'uint32_t', 
   3.389 -                   [], 
   3.390 -                   is_const=True)
   3.391 -    ## ipv4-static-routing.h: ns3::Ipv4MulticastRoute * ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
   3.392 -    cls.add_method('GetMulticastRoute', 
   3.393 -                   'ns3::Ipv4MulticastRoute *', 
   3.394 -                   [param('uint32_t', 'i')], 
   3.395 -                   is_const=True)
   3.396 -    ## ipv4-static-routing.h: ns3::Ipv4MulticastRoute * ns3::Ipv4StaticRouting::GetDefaultMulticastRoute() const [member function]
   3.397 -    cls.add_method('GetDefaultMulticastRoute', 
   3.398 -                   'ns3::Ipv4MulticastRoute *', 
   3.399 -                   [], 
   3.400 -                   is_const=True)
   3.401 -    ## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RemoveMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface) [member function]
   3.402 -    cls.add_method('RemoveMulticastRoute', 
   3.403 -                   'bool', 
   3.404 -                   [param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface')])
   3.405 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::RemoveMulticastRoute(uint32_t index) [member function]
   3.406 -    cls.add_method('RemoveMulticastRoute', 
   3.407 -                   'void', 
   3.408 -                   [param('uint32_t', 'index')])
   3.409 -    ## ipv4-static-routing.h: void ns3::Ipv4StaticRouting::DoDispose() [member function]
   3.410 -    cls.add_method('DoDispose', 
   3.411 -                   'void', 
   3.412 -                   [], 
   3.413 -                   visibility='protected', is_virtual=True)
   3.414 -    return
   3.415 -
   3.416  def register_Ns3Ipv4GlobalRouting_methods(root_module, cls):
   3.417      ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting(ns3::Ipv4GlobalRouting const & arg0) [copy constructor]
   3.418      cls.add_constructor([param('ns3::Ipv4GlobalRouting const &', 'arg0')])
     4.1 --- a/bindings/python/wscript	Sun Mar 01 02:39:10 2009 +0300
     4.2 +++ b/bindings/python/wscript	Tue Mar 10 17:54:58 2009 +0300
     4.3 @@ -15,7 +15,7 @@
     4.4  import Utils
     4.5  
     4.6  ## https://launchpad.net/pybindgen/
     4.7 -REQUIRED_PYBINDGEN_VERSION = (0, 10, 0, 626)
     4.8 +REQUIRED_PYBINDGEN_VERSION = (0, 10, 0, 630)
     4.9  REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
    4.10  
    4.11  
    4.12 @@ -70,6 +70,11 @@
    4.13          conf.report_optional_feature("python", "Python Bindings", False, str(ex))
    4.14          return
    4.15  
    4.16 +    # -fvisibility=hidden optimization
    4.17 +    if conf.env['CXX_NAME'] == 'gcc' and conf.check_compilation_flag('-fvisibility=hidden'):
    4.18 +        conf.env.append_value('CXXFLAGS_PYEXT', '-fvisibility=hidden')
    4.19 +        conf.env.append_value('CCFLAGS_PYEXT', '-fvisibility=hidden')
    4.20 +
    4.21      # Check for the location of pybindgen
    4.22      if Options.options.with_pybindgen is not None:
    4.23          if os.path.isdir(Options.options.with_pybindgen):
     5.1 --- a/doc/manual/random.texi	Sun Mar 01 02:39:10 2009 +0300
     5.2 +++ b/doc/manual/random.texi	Tue Mar 10 17:54:58 2009 +0300
     5.3 @@ -12,10 +12,19 @@
     5.4  
     5.5  ns-3 random numbers are provided via instances of @code{class RandomVariable}.
     5.6  @itemize @bullet
     5.7 -@item @strong{by default, ns-3 simulations use a random seed}; if there is any 
     5.8 -randomness in the simulation, each run of the program will yield different results.  To use a fixed seed, users must call 
     5.9 -@code{RandomVariable::UseGlobalSeed ()} at the beginning of the program;
    5.10 -see section @xref{Seeding and independent replications}
    5.11 +@item @strong{by default, ns-3 simulations use a fixed seed}; if there is any 
    5.12 +randomness in the simulation, each run of the program will yield identical
    5.13 +results uniess the seed and/or run number is changed.  
    5.14 +@itemize @bullet
    5.15 +@item @strong{in ns-3.3 and earlier, ns-3 simulations used a random seed by 
    5.16 +default; this marks a change in policy starting with ns-3.4}
    5.17 +@end itemize
    5.18 +@item to obtain randomness across multiple simulation runs, you must either
    5.19 +set the seed differently or set the run number differently.  To set a seed, call
    5.20 +@code{SeedManager::SetSeed(uint32_t)} at the beginning of the program;
    5.21 +to set a run number with the same seed, call
    5.22 +@code{SeedManager::SetRun (uint32_t)} at the beginning of the program;
    5.23 +@xref{Seeding and independent replications}
    5.24  @item each RandomVariable used in ns-3 has a virtual random number 
    5.25  generator associated with it; all random variables use either a fixed
    5.26  or random seed based on the use of the global seed (previous bullet);
    5.27 @@ -100,27 +109,24 @@
    5.28  a fixed, deterministic seed with the same run number, it should give 
    5.29  the same output each time it is run.
    5.30  
    5.31 -By default, ns-3 simulations use random seeds where the seeding
    5.32 -is drawn from @code{/dev/random} (if it is available) or else from
    5.33 -the time of day.  A user who wants to fix the initial seeding
    5.34 -of the PRNG must call the following static method during simulation
    5.35 -configuration:
    5.36 -@verbatim
    5.37 -RandomVariable::UseGlobalSeed (uint32_t s0, s1, s2, s3, s4, s5);
    5.38 -@end verbatim
    5.39 -where the six parameters are each of type uint32_t.
    5.40 +By default, ns-3 simulations use a fixed seed and run number.
    5.41 +These values are stored in two @code{ns3::GlobalValue} instances:
    5.42 +@code{g_rngSeed} and @code{g_rngRun}.
    5.43  
    5.44  A typical use case is to run a simulation as a sequence of independent
    5.45  trials, so as to compute statistics on a large number of independent
    5.46  runs.  The user can either change the global seed and rerun the 
    5.47 -simulation, or can advance the substream state of the RNG.  
    5.48 +simulation, or can advance the substream state of the RNG, which is
    5.49 +referred to as incrementing the run number.  
    5.50 +
    5.51 +A class @code{ns3::SeedManager ()} provides an API to control
    5.52 +the seeding and run number behavior.
    5.53  This seeding and substream state setting must be called before any 
    5.54  random variables are created; e.g.
    5.55  
    5.56  @verbatim
    5.57 -  RandomVariable::UseGlobalSeed(1,2,3,4,5,6);
    5.58 -  int N = atol(argv[1]); //read in run number from command line
    5.59 -  RandomVariable::SetRunNumber(N);
    5.60 +  SeedManager::SetSeed (3);  // Changes seed from default of 1 to 3
    5.61 +  SeedManager::SetRun (7);  // Changes run number from default of 1 to 7
    5.62    // Now, create random variables
    5.63    UniformVariable x(0,10);
    5.64    ExponentialVariable y(2902);
    5.65 @@ -135,12 +141,29 @@
    5.66  @strong{Therefore, use the substream capability to produce
    5.67  multiple independent runs of the same simulation.}
    5.68  In other words, the more statistically rigorous way to configure
    5.69 -multiple independent replications is not to simply ignore the
    5.70 -seeding (and use /dev/random to seed the generator each time) but
    5.71 -instead to use a fixed seed and to iterate the run number.
    5.72 -This implementation allows for a maximum of
    5.73 +multiple independent replications is to use a fixed seed and to
    5.74 +advance the run number.  This implementation allows for a maximum of
    5.75  2.3x10^15 independent replications using the substreams. 
    5.76  
    5.77 +For ease of use, it is not necessary to control the seed and run number
    5.78 +from within the program; the user can set the 
    5.79 +@code{NS_GLOBAL_VALUE} environment variable as follows:
    5.80 +@verbatim
    5.81 +  NS_GLOBAL_VALUE="RngRun=3" ./waf --run program-name
    5.82 +@end verbatim
    5.83 +
    5.84 +Another way to control this is by passing a command-line argument; since
    5.85 +this is an ns3 GlobalValue instance, it is equivalently done such as follows:
    5.86 +@verbatim
    5.87 +  ./waf --command-template="%s --RngRun=3" --run program-name
    5.88 +@end verbatim
    5.89 +or, if you are running programs directly outside of waf:
    5.90 +@verbatim
    5.91 +  ./build/optimized/scratch/program-name --RngRun=3
    5.92 +@end verbatim
    5.93 +The above command-line variants make it easy to run lots of different
    5.94 +runs from a shell script by just passing a different RngRun index.
    5.95 +
    5.96  @node class RandomVariable
    5.97  @section class RandomVariable
    5.98  
     6.1 --- a/examples/third.cc	Sun Mar 01 02:39:10 2009 +0300
     6.2 +++ b/examples/third.cc	Tue Mar 10 17:54:58 2009 +0300
     6.3 @@ -120,7 +120,7 @@
     6.4      "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50)));
     6.5    mobility.Install (wifiStaNodes);
     6.6  
     6.7 -  mobility.SetMobilityModel ("ns3::StaticMobilityModel");
     6.8 +  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
     6.9    mobility.Install (wifiApNode);
    6.10  
    6.11    InternetStackHelper stack;
     7.1 --- a/examples/wifi-adhoc.cc	Sun Mar 01 02:39:10 2009 +0300
     7.2 +++ b/examples/wifi-adhoc.cc	Tue Mar 10 17:54:58 2009 +0300
     7.3 @@ -128,7 +128,7 @@
     7.4    positionAlloc->Add (Vector (0.0, 0.0, 0.0));
     7.5    positionAlloc->Add (Vector (5.0, 0.0, 0.0));
     7.6    mobility.SetPositionAllocator (positionAlloc);
     7.7 -  mobility.SetMobilityModel ("ns3::StaticMobilityModel");
     7.8 +  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
     7.9  
    7.10    mobility.Install (c);
    7.11  
     8.1 --- a/examples/wifi-wired-bridging.cc	Sun Mar 01 02:39:10 2009 +0300
     8.2 +++ b/examples/wifi-wired-bridging.cc	Tue Mar 10 17:54:58 2009 +0300
     8.3 @@ -119,7 +119,7 @@
     8.4  
     8.5  
     8.6        // setup the AP.
     8.7 -      mobility.SetMobilityModel ("ns3::StaticMobilityModel");
     8.8 +      mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
     8.9        mobility.Install (backboneNodes.Get (i));
    8.10        wifi.SetMac ("ns3::NqapWifiMac",
    8.11  		   "Ssid", SsidValue (ssid),
     9.1 --- a/samples/main-grid-topology.cc	Sun Mar 01 02:39:10 2009 +0300
     9.2 +++ b/samples/main-grid-topology.cc	Tue Mar 10 17:54:58 2009 +0300
     9.3 @@ -32,7 +32,7 @@
     9.4    // each object will be attached a static position.
     9.5    // i.e., once set by the "position allocator", the
     9.6    // position will never change.
     9.7 -  mobility.SetMobilityModel ("ns3::StaticMobilityModel");
     9.8 +  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
     9.9  
    9.10    // finalize the setup by attaching to each object
    9.11    // in the input array a position and initializing
    10.1 --- a/samples/main-propagation-loss.cc	Sun Mar 01 02:39:10 2009 +0300
    10.2 +++ b/samples/main-propagation-loss.cc	Tue Mar 10 17:54:58 2009 +0300
    10.3 @@ -18,7 +18,7 @@
    10.4   * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
    10.5   */
    10.6  #include "ns3/propagation-loss-model.h"
    10.7 -#include "ns3/static-mobility-model.h"
    10.8 +#include "ns3/constant-position-mobility-model.h"
    10.9  #include "ns3/config.h"
   10.10  #include "ns3/string.h"
   10.11  
   10.12 @@ -27,8 +27,8 @@
   10.13  static void
   10.14  PrintOne (double minTxpower, double maxTxpower, double stepTxpower, double min, double max, double step)
   10.15  {
   10.16 -  Ptr<StaticMobilityModel> a = CreateObject<StaticMobilityModel> ();
   10.17 -  Ptr<StaticMobilityModel> b = CreateObject<StaticMobilityModel> ();
   10.18 +  Ptr<ConstantPositionMobilityModel> a = CreateObject<ConstantPositionMobilityModel> ();
   10.19 +  Ptr<ConstantPositionMobilityModel> b = CreateObject<ConstantPositionMobilityModel> ();
   10.20    Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
   10.21  
   10.22    Ptr<PropagationLossModel> model = log;
    11.1 --- a/samples/main-random-topology.cc	Sun Mar 01 02:39:10 2009 +0300
    11.2 +++ b/samples/main-random-topology.cc	Tue Mar 10 17:54:58 2009 +0300
    11.3 @@ -29,7 +29,7 @@
    11.4                                   "X", StringValue ("100.0"),
    11.5                                   "Y", StringValue ("100.0"),
    11.6                                   "Rho", StringValue ("Uniform:0:30"));
    11.7 -  mobility.SetMobilityModel ("ns3::StaticMobilityModel");
    11.8 +  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
    11.9    mobility.Install (c);
   11.10  
   11.11    Config::Connect ("/NodeList/*/$ns3::MobilityModelNotifier/CourseChange",
    12.1 --- a/src/core/attribute-list.cc	Sun Mar 01 02:39:10 2009 +0300
    12.2 +++ b/src/core/attribute-list.cc	Tue Mar 10 17:54:58 2009 +0300
    12.3 @@ -208,50 +208,51 @@
    12.4  
    12.5    std::string::size_type cur;
    12.6    cur = 0;
    12.7 -  do {
    12.8 -    std::string::size_type equal = str.find ("=", cur);
    12.9 -    if (equal == std::string::npos)
   12.10 -      {
   12.11 -        NS_FATAL_ERROR ("Error while parsing serialized attribute: \"" << str << "\"");
   12.12 -        break;
   12.13 -      }
   12.14 -    else
   12.15 -      {
   12.16 -        std::string name = str.substr (cur, equal-cur);
   12.17 -        struct TypeId::AttributeInfo info;
   12.18 -        if (!TypeId::LookupAttributeByFullName (name, &info))
   12.19 -          {
   12.20 -            NS_FATAL_ERROR ("Error while parsing serialized attribute: name does not exist: \"" << name << "\"");
   12.21 -            break;
   12.22 -          }
   12.23 -        else
   12.24 -          {
   12.25 -            std::string::size_type next = str.find ("|", cur);
   12.26 -            std::string value;
   12.27 -            if (next == std::string::npos)
   12.28 -              {
   12.29 -                value = str.substr (equal+1, str.size () - (equal+1));
   12.30 -                cur = str.size ();
   12.31 -              }
   12.32 -            else
   12.33 -              {
   12.34 -                value = str.substr (equal+1, next - (equal+1));
   12.35 -                cur++;
   12.36 -              }
   12.37 -            Ptr<AttributeValue> val = info.checker->Create ();
   12.38 -            bool ok = val->DeserializeFromString (value, info.checker);
   12.39 -            if (!ok)
   12.40 -              {
   12.41 -                NS_FATAL_ERROR ("Error while parsing serialized attribute: value invalid: \"" << value << "\"");
   12.42 -                break;
   12.43 -              }
   12.44 -            else
   12.45 -              {
   12.46 -                DoSetOne (info.checker, *val);
   12.47 -              }
   12.48 -          }
   12.49 -      }
   12.50 -  } while (cur != str.size ());
   12.51 +  while (cur != str.size ())
   12.52 +    {
   12.53 +      std::string::size_type equal = str.find ("=", cur);
   12.54 +      if (equal == std::string::npos)
   12.55 +        {
   12.56 +          NS_FATAL_ERROR ("Error while parsing serialized attribute: \"" << str << "\"");
   12.57 +          break;
   12.58 +        }
   12.59 +      else
   12.60 +        {
   12.61 +          std::string name = str.substr (cur, equal-cur);
   12.62 +          struct TypeId::AttributeInfo info;
   12.63 +          if (!TypeId::LookupAttributeByFullName (name, &info))
   12.64 +            {
   12.65 +              NS_FATAL_ERROR ("Error while parsing serialized attribute: name does not exist: \"" << name << "\"");
   12.66 +              break;
   12.67 +            }
   12.68 +          else
   12.69 +            {
   12.70 +              std::string::size_type next = str.find ("|", cur);
   12.71 +              std::string value;
   12.72 +              if (next == std::string::npos)
   12.73 +                {
   12.74 +                  value = str.substr (equal+1, str.size () - (equal+1));
   12.75 +                  cur = str.size ();
   12.76 +                }
   12.77 +              else
   12.78 +                {
   12.79 +                  value = str.substr (equal+1, next - (equal+1));
   12.80 +                  cur++;
   12.81 +                }
   12.82 +              Ptr<AttributeValue> val = info.checker->Create ();
   12.83 +              bool ok = val->DeserializeFromString (value, info.checker);
   12.84 +              if (!ok)
   12.85 +                {
   12.86 +                  NS_FATAL_ERROR ("Error while parsing serialized attribute: value invalid: \"" << value << "\"");
   12.87 +                  break;
   12.88 +                }
   12.89 +              else
   12.90 +                {
   12.91 +                  DoSetOne (info.checker, *val);
   12.92 +                }
   12.93 +            }
   12.94 +        }
   12.95 +    }
   12.96  
   12.97    return true;
   12.98  }
    13.1 --- a/src/core/random-variable.cc	Sun Mar 01 02:39:10 2009 +0300
    13.2 +++ b/src/core/random-variable.cc	Tue Mar 10 17:54:58 2009 +0300
    13.3 @@ -274,6 +274,11 @@
    13.4    return ((UniformVariableImpl*)Peek())->GetValue(s,l);
    13.5  }
    13.6  
    13.7 +uint32_t UniformVariable::GetInteger (uint32_t s, uint32_t l)
    13.8 +{
    13.9 +  NS_ASSERT(s <= l);
   13.10 +  return static_cast<uint32_t>( GetValue(s, l+1) );
   13.11 +}
   13.12  
   13.13  //-----------------------------------------------------------------------------
   13.14  //-----------------------------------------------------------------------------
   13.15 @@ -763,6 +768,10 @@
   13.16    virtual double GetValue();
   13.17    virtual RandomVariableBase* Copy(void) const;
   13.18  
   13.19 +  double GetMean (void) const;
   13.20 +  double GetVariance (void) const;
   13.21 +  double GetBound (void) const;
   13.22 +
   13.23  private:
   13.24    double m_mean;      // Mean value of RV
   13.25    double m_variance;  // Mean value of RV
   13.26 @@ -835,6 +844,24 @@
   13.27    return new NormalVariableImpl(*this);
   13.28  }
   13.29  
   13.30 +double
   13.31 +NormalVariableImpl::GetMean (void) const
   13.32 +{
   13.33 +  return m_mean;
   13.34 +}
   13.35 +
   13.36 +double
   13.37 +NormalVariableImpl::GetVariance (void) const
   13.38 +{
   13.39 +  return m_variance;
   13.40 +}
   13.41 +
   13.42 +double
   13.43 +NormalVariableImpl::GetBound (void) const
   13.44 +{
   13.45 +  return m_bound;
   13.46 +}
   13.47 +
   13.48  NormalVariable::NormalVariable()
   13.49    : RandomVariable (NormalVariableImpl ())
   13.50  {}
   13.51 @@ -1280,6 +1307,17 @@
   13.52        os << "Uniform:" << uniform->GetMin () << ":" << uniform->GetMax ();
   13.53        return os;
   13.54      }
   13.55 +  NormalVariableImpl *normal = dynamic_cast<NormalVariableImpl *> (base);
   13.56 +  if (normal != 0)
   13.57 +    {
   13.58 +      os << "Normal:" << normal->GetMean () << ":" << normal->GetVariance ();
   13.59 +      double bound = normal->GetBound ();
   13.60 +      if (bound != NormalVariableImpl::INFINITE_VALUE)
   13.61 +        {
   13.62 +          os << ":" << bound;
   13.63 +        }
   13.64 +      return os;
   13.65 +    }
   13.66    // XXX: support other distributions
   13.67    os.setstate (std::ios_base::badbit);
   13.68    return os;
   13.69 @@ -1325,6 +1363,44 @@
   13.70            var = UniformVariable (a, b);
   13.71          }
   13.72      }
   13.73 +  else if (type == "Normal")
   13.74 +    {
   13.75 +      if (value.size () == 0)
   13.76 +        {
   13.77 +          var = NormalVariable ();
   13.78 +        }
   13.79 +      else
   13.80 +        {
   13.81 +          tmp = value.find (":");
   13.82 +          if (tmp == value.npos)
   13.83 +            {
   13.84 +              NS_FATAL_ERROR ("bad Normal value: " << value);
   13.85 +            }
   13.86 +          std::string::size_type tmp2;
   13.87 +          std::string sub = value.substr (tmp + 1, value.npos);
   13.88 +          tmp2 = sub.find (":");
   13.89 +          if (tmp2 == value.npos)
   13.90 +            {
   13.91 +              istringstream issA (value.substr (0, tmp));
   13.92 +              istringstream issB (sub);
   13.93 +              double a, b;
   13.94 +              issA >> a;
   13.95 +              issB >> b;
   13.96 +              var = NormalVariable (a, b);
   13.97 +            }
   13.98 +          else
   13.99 +            {
  13.100 +              istringstream issA (value.substr (0, tmp));
  13.101 +              istringstream issB (sub.substr (0, tmp2));
  13.102 +              istringstream issC (sub.substr (tmp2 + 1, value.npos));
  13.103 +              double a, b, c;
  13.104 +              issA >> a;
  13.105 +              issB >> b;
  13.106 +              issC >> c;
  13.107 +              var = NormalVariable (a, b, c);
  13.108 +            }
  13.109 +        }
  13.110 +    }
  13.111    else
  13.112      {
  13.113        NS_FATAL_ERROR ("RandomVariable deserialization not implemented for " << type);
  13.114 @@ -1396,10 +1472,24 @@
  13.115  
  13.116      // Test attribute serialization
  13.117      {
  13.118 -      RandomVariableValue val;
  13.119 -      val.DeserializeFromString ("Uniform:0.1:0.2", MakeRandomVariableChecker ());
  13.120 -      RandomVariable rng = val.Get ();
  13.121 -      NS_TEST_ASSERT_EQUAL (val.SerializeToString (MakeRandomVariableChecker ()), "Uniform:0.1:0.2");
  13.122 +      {
  13.123 +        RandomVariableValue val;
  13.124 +        val.DeserializeFromString ("Uniform:0.1:0.2", MakeRandomVariableChecker ());
  13.125 +        RandomVariable rng = val.Get ();
  13.126 +        NS_TEST_ASSERT_EQUAL (val.SerializeToString (MakeRandomVariableChecker ()), "Uniform:0.1:0.2");
  13.127 +      }
  13.128 +      {
  13.129 +        RandomVariableValue val;
  13.130 +        val.DeserializeFromString ("Normal:0.1:0.2", MakeRandomVariableChecker ());
  13.131 +        RandomVariable rng = val.Get ();
  13.132 +        NS_TEST_ASSERT_EQUAL (val.SerializeToString (MakeRandomVariableChecker ()), "Normal:0.1:0.2");
  13.133 +      }
  13.134 +      {
  13.135 +        RandomVariableValue val;
  13.136 +        val.DeserializeFromString ("Normal:0.1:0.2:0.15", MakeRandomVariableChecker ());
  13.137 +        RandomVariable rng = val.Get ();
  13.138 +        NS_TEST_ASSERT_EQUAL (val.SerializeToString (MakeRandomVariableChecker ()), "Normal:0.1:0.2:0.15");
  13.139 +      }
  13.140      }
  13.141  
  13.142      return result;
    14.1 --- a/src/core/random-variable.h	Sun Mar 01 02:39:10 2009 +0300
    14.2 +++ b/src/core/random-variable.h	Tue Mar 10 17:54:58 2009 +0300
    14.3 @@ -53,12 +53,18 @@
    14.4     * ExponentialVariable y(120); //as long as the seed stays the same
    14.5     * \endcode
    14.6     * \param seed
    14.7 +   *
    14.8 +   * Note, while the underlying RNG takes six integer values as a seed;
    14.9 +   * it is sufficient to set these all to the same integer, so we provide
   14.10 +   * a simpler interface here that just takes one integer.
   14.11     */ 
   14.12    static void SetSeed (uint32_t seed);
   14.13   
   14.14    /**
   14.15     * \brief Get the seed value
   14.16     * \return the seed value
   14.17 +   *
   14.18 +   * Note:  returns the first of the six seed values used in the underlying RNG
   14.19     */
   14.20     static uint32_t GetSeed ();
   14.21   
   14.22 @@ -194,6 +200,13 @@
   14.23    */
   14.24    double GetValue(double s, double l);
   14.25  
   14.26 +  /**
   14.27 +   * \brief Returns a random unsigned integer from the interval [s,l] including both ends.
   14.28 +   * \param s Low end of the range
   14.29 +   * \param l High end of the range
   14.30 +   * \return A random unsigned integer value.
   14.31 +   */
   14.32 +  uint32_t GetInteger (uint32_t s, uint32_t l);
   14.33  };
   14.34  
   14.35  /**
    15.1 --- a/src/core/type-id.h	Sun Mar 01 02:39:10 2009 +0300
    15.2 +++ b/src/core/type-id.h	Tue Mar 10 17:54:58 2009 +0300
    15.3 @@ -323,6 +323,15 @@
    15.4     */
    15.5    Ptr<const TraceSourceAccessor> LookupTraceSourceByName (std::string name) const;
    15.6  
    15.7 +
    15.8 +  /**
    15.9 +   * \param fullName the full name of the requested attribute
   15.10 +   * \param info a pointer to the TypeId::AttributeInfo data structure
   15.11 +   *        where the result value of this method will be stored.
   15.12 +   * \returns the Accessor associated to the requested attribute
   15.13 +   */
   15.14 +  static bool LookupAttributeByFullName (std::string fullName, struct AttributeInfo *info);
   15.15 +
   15.16    /**
   15.17     * \returns the internal integer which uniquely identifies this
   15.18     *          TypeId.
   15.19 @@ -354,14 +363,6 @@
   15.20    friend bool operator <  (TypeId a, TypeId b);
   15.21  
   15.22  
   15.23 -  /**
   15.24 -   * \param fullName the full name of the requested attribute
   15.25 -   * \param info a pointer to the TypeId::AttributeInfo data structure
   15.26 -   *        where the result value of this method will be stored.
   15.27 -   * \returns the Accessor associated to the requested attribute
   15.28 -   */
   15.29 -  static bool LookupAttributeByFullName (std::string fullName, struct AttributeInfo *info);
   15.30 -
   15.31    explicit TypeId (uint16_t tid);
   15.32    void DoAddConstructor (Callback<ObjectBase *> callback);
   15.33    
    16.1 --- a/src/devices/wifi/propagation-loss-model.cc	Sun Mar 01 02:39:10 2009 +0300
    16.2 +++ b/src/devices/wifi/propagation-loss-model.cc	Tue Mar 10 17:54:58 2009 +0300
    16.3 @@ -22,7 +22,6 @@
    16.4  #include "propagation-loss-model.h"
    16.5  #include "ns3/log.h"
    16.6  #include "ns3/mobility-model.h"
    16.7 -#include "ns3/static-mobility-model.h"
    16.8  #include "ns3/boolean.h"
    16.9  #include "ns3/double.h"
   16.10  #include <math.h>
    17.1 --- a/src/devices/wifi/random-stream.cc	Sun Mar 01 02:39:10 2009 +0300
    17.2 +++ b/src/devices/wifi/random-stream.cc	Tue Mar 10 17:54:58 2009 +0300
    17.3 @@ -34,7 +34,7 @@
    17.4  uint32_t 
    17.5  RealRandomStream::GetNext (uint32_t min, uint32_t max)
    17.6  {
    17.7 -  return static_cast<uint32_t> (round (m_stream.GetValue (min, max)));
    17.8 +  return m_stream.GetInteger (min, max);
    17.9  }
   17.10  
   17.11  
    18.1 --- a/src/devices/wifi/wifi-phy-test.cc	Sun Mar 01 02:39:10 2009 +0300
    18.2 +++ b/src/devices/wifi/wifi-phy-test.cc	Tue Mar 10 17:54:58 2009 +0300
    18.3 @@ -7,7 +7,7 @@
    18.4  #include "yans-error-rate-model.h"
    18.5  #include "ns3/ptr.h"
    18.6  #include "ns3/mobility-model.h"
    18.7 -#include "ns3/static-mobility-model.h"
    18.8 +#include "ns3/constant-position-mobility-model.h"
    18.9  #include "ns3/vector.h"
   18.10  #include "ns3/packet.h"
   18.11  #include "ns3/simulator.h"
   18.12 @@ -75,9 +75,9 @@
   18.13    m_output.received = 0;
   18.14    m_input = input;
   18.15  
   18.16 -  Ptr<MobilityModel> posTx = CreateObject<StaticMobilityModel> ();
   18.17 +  Ptr<MobilityModel> posTx = CreateObject<ConstantPositionMobilityModel> ();
   18.18    posTx->SetPosition (Vector (0.0, 0.0, 0.0));
   18.19 -  Ptr<MobilityModel> posRx = CreateObject<StaticMobilityModel> ();
   18.20 +  Ptr<MobilityModel> posRx = CreateObject<ConstantPositionMobilityModel> ();
   18.21    posRx->SetPosition (Vector (m_input.distance, 0.0, 0.0));
   18.22  
   18.23    Ptr<YansWifiChannel> channel = CreateObject<YansWifiChannel> ();
   18.24 @@ -207,11 +207,11 @@
   18.25    Ptr<LogDistancePropagationLossModel> log = CreateObject<LogDistancePropagationLossModel> ();
   18.26    channel->SetPropagationLossModel (log);
   18.27  
   18.28 -  Ptr<MobilityModel> posTxA = CreateObject<StaticMobilityModel> ();
   18.29 +  Ptr<MobilityModel> posTxA = CreateObject<ConstantPositionMobilityModel> ();
   18.30    posTxA->SetPosition (Vector (input.xA, 0.0, 0.0));
   18.31 -  Ptr<MobilityModel> posTxB = CreateObject<StaticMobilityModel> ();
   18.32 +  Ptr<MobilityModel> posTxB = CreateObject<ConstantPositionMobilityModel> ();
   18.33    posTxB->SetPosition (Vector (input.xB, 0.0, 0.0));
   18.34 -  Ptr<MobilityModel> posRx = CreateObject<StaticMobilityModel> ();
   18.35 +  Ptr<MobilityModel> posRx = CreateObject<ConstantPositionMobilityModel> ();
   18.36    posRx->SetPosition (Vector (0, 0.0, 0.0));
   18.37  
   18.38    Ptr<YansWifiPhy> txA = CreateObject<YansWifiPhy> ();
    19.1 --- a/src/devices/wifi/wifi-test.cc	Sun Mar 01 02:39:10 2009 +0300
    19.2 +++ b/src/devices/wifi/wifi-test.cc	Tue Mar 10 17:54:58 2009 +0300
    19.3 @@ -9,7 +9,7 @@
    19.4  #include "propagation-loss-model.h"
    19.5  #include "error-rate-model.h"
    19.6  #include "yans-error-rate-model.h"
    19.7 -#include "ns3/static-mobility-model.h"
    19.8 +#include "ns3/constant-position-mobility-model.h"
    19.9  #include "ns3/node.h"
   19.10  #include "ns3/simulator.h"
   19.11  #include "ns3/test.h"
   19.12 @@ -51,7 +51,7 @@
   19.13    Ptr<WifiNetDevice> dev = CreateObject<WifiNetDevice> ();
   19.14  
   19.15    Ptr<WifiMac> mac = m_mac.Create<WifiMac> ();
   19.16 -  Ptr<StaticMobilityModel> mobility = CreateObject<StaticMobilityModel> ();
   19.17 +  Ptr<ConstantPositionMobilityModel> mobility = CreateObject<ConstantPositionMobilityModel> ();
   19.18    Ptr<YansWifiPhy> phy = CreateObject<YansWifiPhy> ();
   19.19    Ptr<ErrorRateModel> error = CreateObject<YansErrorRateModel> ();
   19.20    phy->SetErrorRateModel (error);
    20.1 --- a/src/helper/mobility-helper.cc	Sun Mar 01 02:39:10 2009 +0300
    20.2 +++ b/src/helper/mobility-helper.cc	Tue Mar 10 17:54:58 2009 +0300
    20.3 @@ -37,7 +37,7 @@
    20.4    m_position = CreateObject<RandomRectanglePositionAllocator> 
    20.5      ("X", RandomVariableValue (ConstantVariable (0.0)),
    20.6       "Y", RandomVariableValue (ConstantVariable (0.0)));
    20.7 -  m_mobility.SetTypeId ("ns3::StaticMobilityModel");
    20.8 +  m_mobility.SetTypeId ("ns3::ConstantPositionMobilityModel");
    20.9  }
   20.10  MobilityHelper::~MobilityHelper ()
   20.11  {}
    21.1 --- a/src/helper/ns2-mobility-helper.cc	Sun Mar 01 02:39:10 2009 +0300
    21.2 +++ b/src/helper/ns2-mobility-helper.cc	Tue Mar 10 17:54:58 2009 +0300
    21.3 @@ -23,7 +23,7 @@
    21.4  #include "ns3/simulator.h"
    21.5  #include "ns3/node-list.h"
    21.6  #include "ns3/node.h"
    21.7 -#include "ns3/static-speed-mobility-model.h"
    21.8 +#include "ns3/constant-velocity-mobility-model.h"
    21.9  #include "ns2-mobility-helper.h"
   21.10  
   21.11  NS_LOG_COMPONENT_DEFINE ("Ns2MobilityHelper");
   21.12 @@ -37,7 +37,7 @@
   21.13  
   21.14  
   21.15  
   21.16 -Ptr<StaticSpeedMobilityModel>
   21.17 +Ptr<ConstantVelocityMobilityModel>
   21.18  Ns2MobilityHelper::GetMobilityModel (std::string idString, const ObjectStore &store) const
   21.19  {
   21.20    std::istringstream iss;
   21.21 @@ -49,10 +49,10 @@
   21.22      {
   21.23        return 0;
   21.24      }
   21.25 -  Ptr<StaticSpeedMobilityModel> model = object->GetObject<StaticSpeedMobilityModel> ();
   21.26 +  Ptr<ConstantVelocityMobilityModel> model = object->GetObject<ConstantVelocityMobilityModel> ();
   21.27    if (model == 0)
   21.28      {
   21.29 -      model = CreateObject<StaticSpeedMobilityModel> ();
   21.30 +      model = CreateObject<ConstantVelocityMobilityModel> ();
   21.31        object->AggregateObject (model);
   21.32      }
   21.33    return model;
   21.34 @@ -85,7 +85,7 @@
   21.35              {
   21.36                continue;
   21.37              }
   21.38 -          Ptr<StaticSpeedMobilityModel> model = GetMobilityModel (line.substr (startNodeId + 1, 
   21.39 +          Ptr<ConstantVelocityMobilityModel> model = GetMobilityModel (line.substr (startNodeId + 1, 
   21.40                                                                                 endNodeId - startNodeId), 
   21.41                                                                    store);
   21.42            if (model == 0)
   21.43 @@ -130,7 +130,7 @@
   21.44                double ySpeed = ReadDouble (line.substr (xSpeedEnd + 1, ySpeedEnd - xSpeedEnd - 1));
   21.45                double zSpeed = ReadDouble (line.substr (ySpeedEnd + 1, std::string::npos));
   21.46                NS_LOG_DEBUG ("at=" << at << "xSpeed=" << xSpeed << ", ySpeed=" << ySpeed << ", zSpeed=" << zSpeed);
   21.47 -              Simulator::Schedule (Seconds (at), &StaticSpeedMobilityModel::SetVelocity, model,
   21.48 +              Simulator::Schedule (Seconds (at), &ConstantVelocityMobilityModel::SetVelocity, model,
   21.49                                     Vector (xSpeed, ySpeed, zSpeed));
   21.50              }
   21.51          }
    22.1 --- a/src/helper/ns2-mobility-helper.h	Sun Mar 01 02:39:10 2009 +0300
    22.2 +++ b/src/helper/ns2-mobility-helper.h	Tue Mar 10 17:54:58 2009 +0300
    22.3 @@ -27,7 +27,7 @@
    22.4  
    22.5  namespace ns3 {
    22.6  
    22.7 -class StaticSpeedMobilityModel;
    22.8 +class ConstantVelocityMobilityModel;
    22.9  
   22.10  /**
   22.11   * \brief a topology object which can read ns2's movement files
   22.12 @@ -71,7 +71,7 @@
   22.13      virtual Ptr<Object> Get (uint32_t i) const = 0;
   22.14    };
   22.15    void LayoutObjectStore (const ObjectStore &store) const;
   22.16 -  Ptr<StaticSpeedMobilityModel> GetMobilityModel (std::string idString, const ObjectStore &store) const;
   22.17 +  Ptr<ConstantVelocityMobilityModel> GetMobilityModel (std::string idString, const ObjectStore &store) const;
   22.18    double ReadDouble (std::string valueString) const;
   22.19    std::string m_filename;
   22.20  };
    23.1 --- a/src/internet-stack/arp-cache.cc	Sun Mar 01 02:39:10 2009 +0300
    23.2 +++ b/src/internet-stack/arp-cache.cc	Tue Mar 10 17:54:58 2009 +0300
    23.3 @@ -185,7 +185,7 @@
    23.4    for (CacheI i = m_arpCache.begin (); i != m_arpCache.end (); i++) 
    23.5      {
    23.6        entry = (*i).second;
    23.7 -      if (entry != 0 && entry->IsWaitReply () && entry->IsExpiring () )
    23.8 +      if (entry != 0 && entry->IsWaitReply ())
    23.9            {
   23.10            if (entry->GetRetries () < m_maxRetries)
   23.11              {
   23.12 @@ -374,19 +374,6 @@
   23.13      /* NOTREACHED */
   23.14    }
   23.15  }
   23.16 -bool
   23.17 -ArpCache::Entry::IsExpiring (void) const
   23.18 -{
   23.19 -  NS_LOG_FUNCTION_NOARGS ();
   23.20 -  Time timeout = GetTimeout ();
   23.21 -  Time delta = Simulator::Now () - m_lastSeen;
   23.22 -  NS_LOG_DEBUG ("delta=" << delta.GetSeconds () << "s");
   23.23 -  if (delta >= timeout)
   23.24 -    {
   23.25 -      return true;
   23.26 -    }
   23.27 -  return false;
   23.28 -}
   23.29  bool 
   23.30  ArpCache::Entry::IsExpired (void) const
   23.31  {
    24.1 --- a/src/internet-stack/arp-cache.h	Sun Mar 01 02:39:10 2009 +0300
    24.2 +++ b/src/internet-stack/arp-cache.h	Tue Mar 10 17:54:58 2009 +0300
    24.3 @@ -164,23 +164,9 @@
    24.4       *
    24.5       * This function returns true if the time elapsed strictly exceeds
    24.6       * the timeout value (i.e., is not less than or equal to the timeout).
    24.7 -     * Differs from IsExpiring() only in the boundary condition 
    24.8 -     * delta == timeout.
    24.9 -     * \see IsExpiring
   24.10       */
   24.11      bool IsExpired (void) const;
   24.12      /**
   24.13 -     * \return True if this entry is timing out or has already timed out; 
   24.14 -     * false otherwise.
   24.15 -     *
   24.16 -     * This function returns true if the time elapsed is equal to or exceeds
   24.17 -     * the timeout value.  Differs from IsExpired() only in the boundary 
   24.18 -     * condition delta == timeout.
   24.19 -     * \see IsExpired
   24.20 -     */
   24.21 -    bool IsExpiring (void) const;
   24.22 -
   24.23 -    /**
   24.24       * \returns 0 is no packet is pending, the next packet to send if 
   24.25       *            packets are pending.
   24.26       */
    25.1 --- a/src/internet-stack/wscript	Sun Mar 01 02:39:10 2009 +0300
    25.2 +++ b/src/internet-stack/wscript	Tue Mar 10 17:54:58 2009 +0300
    25.3 @@ -1,6 +1,6 @@
    25.4  ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
    25.5  import os
    25.6 -import urllib
    25.7 +import sys
    25.8  
    25.9  import Options
   25.10  import Logs
   25.11 @@ -45,8 +45,11 @@
   25.12          conf.report_optional_feature("nsc", "Network Simulation Cradle", False,
   25.13                                       "NSC not found (see option --with-nsc)")
   25.14  	return
   25.15 -
   25.16 -    arch = os.uname()[4]
   25.17 +    
   25.18 +    if sys.platform in ['linux2']:
   25.19 +        arch = os.uname()[4]
   25.20 +    else:
   25.21 +        arch = None
   25.22      ok = False
   25.23      if arch == 'x86_64' or arch == 'i686' or arch == 'i586' or arch == 'i486' or arch == 'i386':
   25.24          conf.env['NSC_ENABLED'] = 'yes'
   25.25 @@ -108,14 +111,11 @@
   25.26          'udp-header.h',
   25.27          'tcp-header.h',
   25.28          'sequence-number.h',
   25.29 -        'ipv4-interface.h',
   25.30 -        'ipv4-l3-protocol.h',
   25.31 -        'ipv4-static-routing.h',
   25.32          'ipv4-global-routing.h',
   25.33          'icmpv4.h',
   25.34          ]
   25.35  
   25.36 -    if bld.env['WITH_NSC']:        
   25.37 +    if bld.env['NSC_ENABLED']:
   25.38          obj.source.append ('nsc-tcp-socket-impl.cc')
   25.39          obj.source.append ('nsc-tcp-l4-protocol.cc')
   25.40          obj.source.append ('nsc-tcp-socket-factory-impl.cc')
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/src/mobility/constant-acceleration-mobility-model.cc	Tue Mar 10 17:54:58 2009 +0300
    26.3 @@ -0,0 +1,79 @@
    26.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    26.5 +/*
    26.6 + * This program is free software; you can redistribute it and/or modify
    26.7 + * it under the terms of the GNU General Public License version 2 as
    26.8 + * published by the Free Software Foundation;
    26.9 + *
   26.10 + * This program is distributed in the hope that it will be useful,
   26.11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   26.12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   26.13 + * GNU General Public License for more details.
   26.14 + *
   26.15 + * You should have received a copy of the GNU General Public License
   26.16 + * along with this program; if not, write to the Free Software
   26.17 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   26.18 + *
   26.19 + * Author: Gustavo Carneiro  <gjc@inescporto.pt>
   26.20 + */
   26.21 +#include "constant-acceleration-mobility-model.h"
   26.22 +#include "ns3/simulator.h"
   26.23 +
   26.24 +namespace ns3 {
   26.25 +
   26.26 +NS_OBJECT_ENSURE_REGISTERED (ConstantAccelerationMobilityModel);
   26.27 +
   26.28 +TypeId ConstantAccelerationMobilityModel::GetTypeId (void)
   26.29 +{
   26.30 +  static TypeId tid = TypeId ("ns3::ConstantAccelerationMobilityModel")
   26.31 +    .SetParent<MobilityModel> ()
   26.32 +    .AddConstructor<ConstantAccelerationMobilityModel> ();
   26.33 +  return tid;
   26.34 +}
   26.35 +
   26.36 +ConstantAccelerationMobilityModel::ConstantAccelerationMobilityModel ()
   26.37 +{}
   26.38 +
   26.39 +ConstantAccelerationMobilityModel::~ConstantAccelerationMobilityModel ()
   26.40 +{}
   26.41 +
   26.42 +inline Vector
   26.43 +ConstantAccelerationMobilityModel::DoGetVelocity (void) const
   26.44 +{
   26.45 +  double t = (Simulator::Now () - m_baseTime).GetSeconds ();
   26.46 +  return Vector (m_baseVelocity.x + m_acceleration.x*t,
   26.47 +                 m_baseVelocity.y + m_acceleration.y*t,
   26.48 +                 m_baseVelocity.z + m_acceleration.z*t);
   26.49 +}
   26.50 +
   26.51 +inline Vector
   26.52 +ConstantAccelerationMobilityModel::DoGetPosition (void) const
   26.53 +{
   26.54 +  double t = (Simulator::Now () - m_baseTime).GetSeconds ();
   26.55 +  double half_t_square = t*t*0.5;
   26.56 +  return Vector (m_basePosition.x + m_baseVelocity.x*t + m_acceleration.x*half_t_square,
   26.57 +                 m_basePosition.y + m_baseVelocity.y*t + m_acceleration.y*half_t_square,
   26.58 +                 m_basePosition.z + m_baseVelocity.z*t + m_acceleration.z*half_t_square);
   26.59 +}
   26.60 +
   26.61 +void 
   26.62 +ConstantAccelerationMobilityModel::DoSetPosition (const Vector &position)
   26.63 +{
   26.64 +  m_baseVelocity = DoGetVelocity ();
   26.65 +  m_baseTime = Simulator::Now ();
   26.66 +  m_basePosition = position;
   26.67 +  NotifyCourseChange ();
   26.68 +}
   26.69 +
   26.70 +void 
   26.71 +ConstantAccelerationMobilityModel::SetVelocityAndAcceleration (const Vector &velocity,
   26.72 +                                                               const Vector &acceleration)
   26.73 +{
   26.74 +  m_basePosition = DoGetPosition ();
   26.75 +  m_baseTime = Simulator::Now ();
   26.76 +  m_baseVelocity = velocity;
   26.77 +  m_acceleration = acceleration;
   26.78 +  NotifyCourseChange ();
   26.79 +}
   26.80 +
   26.81 +
   26.82 +}; // namespace ns3
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/src/mobility/constant-acceleration-mobility-model.h	Tue Mar 10 17:54:58 2009 +0300
    27.3 @@ -0,0 +1,56 @@
    27.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    27.5 +/*
    27.6 + * This program is free software; you can redistribute it and/or modify
    27.7 + * it under the terms of the GNU General Public License version 2 as
    27.8 + * published by the Free Software Foundation;
    27.9 + *
   27.10 + * This program is distributed in the hope that it will be useful,
   27.11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   27.12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   27.13 + * GNU General Public License for more details.
   27.14 + *
   27.15 + * You should have received a copy of the GNU General Public License
   27.16 + * along with this program; if not, write to the Free Software
   27.17 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   27.18 + *
   27.19 + * Author: Gustavo Carneiro  <gjc@inescporto.pt>
   27.20 + */
   27.21 +#ifndef CONSTANT_ACCELERATION_MOBILITY_MODEL_H
   27.22 +#define CONSTANT_ACCELERATION_MOBILITY_MODEL_H
   27.23 +
   27.24 +#include "mobility-model.h"
   27.25 +#include "ns3/nstime.h"
   27.26 +
   27.27 +namespace ns3 {
   27.28 +
   27.29 +/**
   27.30 + * \brief a position model for which the current acceleration does not
   27.31 + *        change once it has been set and until it is set again 
   27.32 + *        explicitely to a new value.
   27.33 + */
   27.34 +class ConstantAccelerationMobilityModel : public MobilityModel 
   27.35 +{
   27.36 +public:
   27.37 +  static TypeId GetTypeId (void);
   27.38 +  /**
   27.39 +   * Create position located at coordinates (0,0,0) with
   27.40 +   * speed (0,0,0).
   27.41 +   */
   27.42 +  ConstantAccelerationMobilityModel ();
   27.43 +  virtual ~ConstantAccelerationMobilityModel ();
   27.44 +  void SetVelocityAndAcceleration (const Vector &velocity, const Vector &acceleration);
   27.45 +
   27.46 +private:
   27.47 +  virtual Vector DoGetPosition (void) const;
   27.48 +  virtual void DoSetPosition (const Vector &position);
   27.49 +  virtual Vector DoGetVelocity (void) const;
   27.50 +
   27.51 +  Time m_baseTime;
   27.52 +  Vector m_basePosition;
   27.53 +  Vector m_baseVelocity;
   27.54 +  Vector m_acceleration;
   27.55 +};
   27.56 +
   27.57 +}; // namespace ns3
   27.58 +
   27.59 +#endif /* CONSTANT_ACCELERATION_MOBILITY_MODEL_H */
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/src/mobility/constant-position-mobility-model.cc	Tue Mar 10 17:54:58 2009 +0300
    28.3 @@ -0,0 +1,58 @@
    28.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    28.5 +/*
    28.6 + * Copyright (c) 2006,2007 INRIA
    28.7 + *
    28.8 + * This program is free software; you can redistribute it and/or modify
    28.9 + * it under the terms of the GNU General Public License version 2 as
   28.10 + * published by the Free Software Foundation;
   28.11 + *
   28.12 + * This program is distributed in the hope that it will be useful,
   28.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   28.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   28.15 + * GNU General Public License for more details.
   28.16 + *
   28.17 + * You should have received a copy of the GNU General Public License
   28.18 + * along with this program; if not, write to the Free Software
   28.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   28.20 + *
   28.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   28.22 + */
   28.23 +#include "constant-position-mobility-model.h"
   28.24 +
   28.25 +namespace ns3 {
   28.26 +
   28.27 +NS_OBJECT_ENSURE_REGISTERED (ConstantPositionMobilityModel);
   28.28 +
   28.29 +TypeId
   28.30 +ConstantPositionMobilityModel::GetTypeId (void)
   28.31 +{
   28.32 +  static TypeId tid = TypeId ("ns3::ConstantPositionMobilityModel")
   28.33 +    .SetParent<MobilityModel> ()
   28.34 +    .AddConstructor<ConstantPositionMobilityModel> ()
   28.35 +    ;
   28.36 +  return tid;
   28.37 +}
   28.38 +  
   28.39 +ConstantPositionMobilityModel::ConstantPositionMobilityModel ()
   28.40 +{}
   28.41 +ConstantPositionMobilityModel::~ConstantPositionMobilityModel ()
   28.42 +{}
   28.43 +
   28.44 +Vector
   28.45 +ConstantPositionMobilityModel::DoGetPosition (void) const
   28.46 +{
   28.47 +  return m_position;
   28.48 +}
   28.49 +void 
   28.50 +ConstantPositionMobilityModel::DoSetPosition (const Vector &position)
   28.51 +{
   28.52 +  m_position = position;
   28.53 +  NotifyCourseChange ();
   28.54 +}
   28.55 +Vector
   28.56 +ConstantPositionMobilityModel::DoGetVelocity (void) const
   28.57 +{
   28.58 +  return Vector (0.0, 0.0, 0.0);
   28.59 +}
   28.60 +
   28.61 +}; // namespace ns3
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/src/mobility/constant-position-mobility-model.h	Tue Mar 10 17:54:58 2009 +0300
    29.3 @@ -0,0 +1,53 @@
    29.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    29.5 +/*
    29.6 + * Copyright (c) 2006,2007 INRIA
    29.7 + *
    29.8 + * This program is free software; you can redistribute it and/or modify
    29.9 + * it under the terms of the GNU General Public License version 2 as
   29.10 + * published by the Free Software Foundation;
   29.11 + *
   29.12 + * This program is distributed in the hope that it will be useful,
   29.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   29.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   29.15 + * GNU General Public License for more details.
   29.16 + *
   29.17 + * You should have received a copy of the GNU General Public License
   29.18 + * along with this program; if not, write to the Free Software
   29.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   29.20 + *
   29.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   29.22 + */
   29.23 +#ifndef CONSTANT_POSITION_MOBILITY_MODEL_H
   29.24 +#define CONSTANT_POSITION_MOBILITY_MODEL_H
   29.25 +
   29.26 +#include "mobility-model.h"
   29.27 +#include "vector.h"
   29.28 +
   29.29 +namespace ns3 {
   29.30 +
   29.31 +/**
   29.32 + * \brief a position model for which the current position does not
   29.33 + *        change once it has been set and until it is set again 
   29.34 + *        explicitely to a new value.
   29.35 + */
   29.36 +class ConstantPositionMobilityModel : public MobilityModel 
   29.37 +{
   29.38 +public:
   29.39 +  static TypeId GetTypeId (void);
   29.40 +  /**
   29.41 +   * Create a position located at coordinates (0,0,0)
   29.42 +   */
   29.43 +  ConstantPositionMobilityModel ();
   29.44 +  virtual ~ConstantPositionMobilityModel ();
   29.45 +
   29.46 +private:
   29.47 +  virtual Vector DoGetPosition (void) const;
   29.48 +  virtual void DoSetPosition (const Vector &position);
   29.49 +  virtual Vector DoGetVelocity (void) const;
   29.50 +
   29.51 +  Vector m_position;
   29.52 +};
   29.53 +
   29.54 +}; // namespace ns3
   29.55 +
   29.56 +#endif /* CONSTANT_POSITION_MOBILITY_MODEL_H */
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/src/mobility/constant-velocity-helper.cc	Tue Mar 10 17:54:58 2009 +0300
    30.3 @@ -0,0 +1,104 @@
    30.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    30.5 +/*
    30.6 + * Copyright (c) 2006,2007 INRIA
    30.7 + *
    30.8 + * This program is free software; you can redistribute it and/or modify
    30.9 + * it under the terms of the GNU General Public License version 2 as
   30.10 + * published by the Free Software Foundation;
   30.11 + *
   30.12 + * This program is distributed in the hope that it will be useful,
   30.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   30.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   30.15 + * GNU General Public License for more details.
   30.16 + *
   30.17 + * You should have received a copy of the GNU General Public License
   30.18 + * along with this program; if not, write to the Free Software
   30.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   30.20 + *
   30.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   30.22 + */
   30.23 +#include "ns3/simulator.h"
   30.24 +#include "ns3/rectangle.h"
   30.25 +#include "constant-velocity-helper.h"
   30.26 +
   30.27 +namespace ns3 {
   30.28 +
   30.29 +ConstantVelocityHelper::ConstantVelocityHelper ()
   30.30 +  : m_paused (true)
   30.31 +{}
   30.32 +ConstantVelocityHelper::ConstantVelocityHelper (const Vector &position)
   30.33 +  : m_position (position),
   30.34 +    m_paused (true)
   30.35 +{}
   30.36 +ConstantVelocityHelper::ConstantVelocityHelper (const Vector &position,
   30.37 +				      const Vector &vel)
   30.38 +  : m_position (position),
   30.39 +    m_velocity (vel),
   30.40 +    m_paused (true)
   30.41 +{}
   30.42 +void 
   30.43 +ConstantVelocityHelper::SetPosition (const Vector &position)
   30.44 +{
   30.45 +  m_position = position;
   30.46 +  m_velocity = Vector (0.0, 0.0, 0.0);
   30.47 +  m_lastUpdate = Simulator::Now ();
   30.48 +}
   30.49 +
   30.50 +Vector
   30.51 +ConstantVelocityHelper::GetCurrentPosition (void) const
   30.52 +{
   30.53 +  return m_position;
   30.54 +}
   30.55 +
   30.56 +Vector 
   30.57 +ConstantVelocityHelper::GetVelocity (void) const
   30.58 +{
   30.59 +  return m_paused? Vector (0.0, 0.0, 0.0) : m_velocity;
   30.60 +}
   30.61 +void 
   30.62 +ConstantVelocityHelper::SetVelocity (const Vector &vel)
   30.63 +{
   30.64 +  m_velocity = vel;
   30.65 +  m_lastUpdate = Simulator::Now ();
   30.66 +}
   30.67 +
   30.68 +void
   30.69 +ConstantVelocityHelper::Update (void) const
   30.70 +{
   30.71 +  Time now = Simulator::Now ();
   30.72 +  NS_ASSERT (m_lastUpdate <= now);
   30.73 +  Time deltaTime = now - m_lastUpdate;
   30.74 +  m_lastUpdate = now;
   30.75 +  if (m_paused)
   30.76 +    {
   30.77 +      return;
   30.78 +    }
   30.79 +  double deltaS = deltaTime.GetSeconds ();
   30.80 +  m_position.x += m_velocity.x * deltaS;
   30.81 +  m_position.y += m_velocity.y * deltaS;
   30.82 +  m_position.z += m_velocity.z * deltaS;
   30.83 +}
   30.84 +
   30.85 +void
   30.86 +ConstantVelocityHelper::UpdateWithBounds (const Rectangle &bounds) const
   30.87 +{
   30.88 +  Update ();
   30.89 +  m_position.x = std::min (bounds.xMax, m_position.x);
   30.90 +  m_position.x = std::max (bounds.xMin, m_position.x);
   30.91 +  m_position.y = std::min (bounds.yMax, m_position.y);
   30.92 +  m_position.y = std::max (bounds.yMin, m_position.y);
   30.93 +}
   30.94 +
   30.95 +void 
   30.96 +ConstantVelocityHelper::Pause (void)
   30.97 +{
   30.98 +  m_paused = true;
   30.99 +}
  30.100 +
  30.101 +void 
  30.102 +ConstantVelocityHelper::Unpause (void)
  30.103 +{
  30.104 +  m_paused = false;
  30.105 +}
  30.106 +
  30.107 +} // namespace ns3
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/src/mobility/constant-velocity-helper.h	Tue Mar 10 17:54:58 2009 +0300
    31.3 @@ -0,0 +1,56 @@
    31.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    31.5 +/*
    31.6 + * Copyright (c) 2006,2007 INRIA
    31.7 + *
    31.8 + * This program is free software; you can redistribute it and/or modify
    31.9 + * it under the terms of the GNU General Public License version 2 as
   31.10 + * published by the Free Software Foundation;
   31.11 + *
   31.12 + * This program is distributed in the hope that it will be useful,
   31.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   31.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   31.15 + * GNU General Public License for more details.
   31.16 + *
   31.17 + * You should have received a copy of the GNU General Public License
   31.18 + * along with this program; if not, write to the Free Software
   31.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   31.20 + *
   31.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   31.22 + */
   31.23 +#ifndef CONSTANT_VELOCITY_HELPER_H
   31.24 +#define CONSTANT_VELOCITY_HELPER_H
   31.25 +
   31.26 +#include "ns3/nstime.h"
   31.27 +#include "vector.h"
   31.28 +
   31.29 +namespace ns3 {
   31.30 +
   31.31 +class Rectangle;
   31.32 +
   31.33 +class ConstantVelocityHelper
   31.34 +{
   31.35 + public:
   31.36 +  ConstantVelocityHelper ();
   31.37 +  ConstantVelocityHelper (const Vector &position);
   31.38 +  ConstantVelocityHelper (const Vector &position,
   31.39 +		     const Vector &vel);
   31.40 +
   31.41 +  void SetPosition (const Vector &position);
   31.42 +  Vector GetCurrentPosition (void) const;
   31.43 +  Vector GetVelocity (void) const;
   31.44 +  void SetVelocity (const Vector &vel);
   31.45 +  void Pause (void);
   31.46 +  void Unpause (void);
   31.47 +
   31.48 +  void UpdateWithBounds (const Rectangle &rectangle) const;
   31.49 +  void Update (void) const;
   31.50 + private:
   31.51 +  mutable Time m_lastUpdate;
   31.52 +  mutable Vector m_position;
   31.53 +  Vector m_velocity;
   31.54 +  bool m_paused;
   31.55 +};
   31.56 +
   31.57 +} // namespace ns3
   31.58 +
   31.59 +#endif /* CONSTANT_VELOCITY_HELPER_H */
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/src/mobility/constant-velocity-mobility-model.cc	Tue Mar 10 17:54:58 2009 +0300
    32.3 @@ -0,0 +1,69 @@
    32.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    32.5 +/*
    32.6 + * Copyright (c) 2006, 2007 INRIA
    32.7 + *
    32.8 + * This program is free software; you can redistribute it and/or modify
    32.9 + * it under the terms of the GNU General Public License version 2 as
   32.10 + * published by the Free Software Foundation;
   32.11 + *
   32.12 + * This program is distributed in the hope that it will be useful,
   32.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   32.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   32.15 + * GNU General Public License for more details.
   32.16 + *
   32.17 + * You should have received a copy of the GNU General Public License
   32.18 + * along with this program; if not, write to the Free Software
   32.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   32.20 + *
   32.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   32.22 + */
   32.23 +#include "constant-velocity-mobility-model.h"
   32.24 +#include "ns3/simulator.h"
   32.25 +
   32.26 +namespace ns3 {
   32.27 +
   32.28 +NS_OBJECT_ENSURE_REGISTERED (ConstantVelocityMobilityModel);
   32.29 +
   32.30 +TypeId ConstantVelocityMobilityModel::GetTypeId (void)
   32.31 +{
   32.32 +  static TypeId tid = TypeId ("ns3::ConstantVelocityMobilityModel")
   32.33 +    .SetParent<MobilityModel> ()
   32.34 +    .AddConstructor<ConstantVelocityMobilityModel> ();
   32.35 +  return tid;
   32.36 +}
   32.37 +
   32.38 +ConstantVelocityMobilityModel::ConstantVelocityMobilityModel ()
   32.39 +{}
   32.40 +
   32.41 +ConstantVelocityMobilityModel::~ConstantVelocityMobilityModel ()
   32.42 +{}
   32.43 +
   32.44 +void 
   32.45 +ConstantVelocityMobilityModel::SetVelocity (const Vector &speed)
   32.46 +{
   32.47 +  m_helper.Update ();
   32.48 +  m_helper.SetVelocity (speed);
   32.49 +  m_helper.Unpause ();
   32.50 +  NotifyCourseChange ();
   32.51 +}
   32.52 +
   32.53 +
   32.54 +Vector
   32.55 +ConstantVelocityMobilityModel::DoGetPosition (void) const
   32.56 +{
   32.57 +  m_helper.Update ();
   32.58 +  return m_helper.GetCurrentPosition ();
   32.59 +}
   32.60 +void 
   32.61 +ConstantVelocityMobilityModel::DoSetPosition (const Vector &position)
   32.62 +{
   32.63 +  m_helper.SetPosition (position);
   32.64 +  NotifyCourseChange ();
   32.65 +}
   32.66 +Vector
   32.67 +ConstantVelocityMobilityModel::DoGetVelocity (void) const
   32.68 +{
   32.69 +  return m_helper.GetVelocity ();
   32.70 +}
   32.71 +
   32.72 +}; // namespace ns3
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/src/mobility/constant-velocity-mobility-model.h	Tue Mar 10 17:54:58 2009 +0300
    33.3 @@ -0,0 +1,63 @@
    33.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    33.5 +/*
    33.6 + * Copyright (c) 2006, 2007 INRIA
    33.7 + *
    33.8 + * This program is free software; you can redistribute it and/or modify
    33.9 + * it under the terms of the GNU General Public License version 2 as
   33.10 + * published by the Free Software Foundation;
   33.11 + *
   33.12 + * This program is distributed in the hope that it will be useful,
   33.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   33.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   33.15 + * GNU General Public License for more details.
   33.16 + *
   33.17 + * You should have received a copy of the GNU General Public License
   33.18 + * along with this program; if not, write to the Free Software
   33.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   33.20 + *
   33.21 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   33.22 + */
   33.23 +#ifndef CONSTANT_VELOCITY_MOBILITY_MODEL_H
   33.24 +#define CONSTANT_VELOCITY_MOBILITY_MODEL_H
   33.25 +
   33.26 +#include <stdint.h>
   33.27 +#include "mobility-model.h"
   33.28 +#include "ns3/nstime.h"
   33.29 +#include "constant-velocity-helper.h"
   33.30 +
   33.31 +namespace ns3 {
   33.32 +
   33.33 +/**
   33.34 + * \brief a position model for which the current speed does not
   33.35 + *        change once it has been set and until it is set again 
   33.36 + *        explicitely to a new value.
   33.37 + */
   33.38 +class ConstantVelocityMobilityModel : public MobilityModel 
   33.39 +{
   33.40 +public:
   33.41 +  static TypeId GetTypeId (void);
   33.42 +  /**
   33.43 +   * Create position located at coordinates (0,0,0) with
   33.44 +   * speed (0,0,0).
   33.45 +   */
   33.46 +  ConstantVelocityMobilityModel ();
   33.47 +  virtual ~ConstantVelocityMobilityModel ();
   33.48 +
   33.49 +  /**
   33.50 +   * \param speed the new speed to set.
   33.51 +   *
   33.52 +   * Set the current speed now to (dx,dy,dz)
   33.53 +   * Unit is meters/s
   33.54 +   */
   33.55 +  void SetVelocity (const Vector &speed);
   33.56 +private:
   33.57 +  virtual Vector DoGetPosition (void) const;
   33.58 +  virtual void DoSetPosition (const Vector &position);
   33.59 +  virtual Vector DoGetVelocity (void) const;
   33.60 +  void Update (void) const;
   33.61 +  ConstantVelocityHelper m_helper;
   33.62 +};
   33.63 +
   33.64 +}; // namespace ns3
   33.65 +
   33.66 +#endif /* CONSTANT_VELOCITY_POSITION */
    34.1 --- a/src/mobility/mobility.h	Sun Mar 01 02:39:10 2009 +0300
    34.2 +++ b/src/mobility/mobility.h	Tue Mar 10 17:54:58 2009 +0300
    34.3 @@ -9,10 +9,10 @@
    34.4   *    listeners to the course changes of a mobility model
    34.5   *
    34.6   * The mobility models themselves are:
    34.7 - *   - ns3::StaticMobilityModel: a model which maintains a constant position
    34.8 + *   - ns3::ConstantPositionMobilityModel: a model which maintains a constant position
    34.9   *     until it is changed by the user.
   34.10   *
   34.11 - *   - ns3::StaticSpeedMobilityModel: a model which maintains a constant speed
   34.12 + *   - ns3::ConstantVelocityMobilityModel: a model which maintains a constant speed
   34.13   *     until it is changed by the user.
   34.14   *
   34.15   *   - ns3::HierarchicalMobilityModel: a model which calculates the current 
    35.1 --- a/src/mobility/random-direction-2d-mobility-model.h	Sun Mar 01 02:39:10 2009 +0300
    35.2 +++ b/src/mobility/random-direction-2d-mobility-model.h	Tue Mar 10 17:54:58 2009 +0300
    35.3 @@ -27,7 +27,7 @@
    35.4  #include "ns3/rectangle.h"
    35.5  #include "ns3/random-variable.h"
    35.6  #include "mobility-model.h"
    35.7 -#include "static-speed-helper.h"
    35.8 +#include "constant-velocity-helper.h"
    35.9  
   35.10  namespace ns3 {
   35.11  
   35.12 @@ -63,7 +63,7 @@
   35.13    RandomVariable m_speed;
   35.14    RandomVariable m_pause;
   35.15    EventId m_event;
   35.16 -  StaticSpeedHelper m_helper;
   35.17 +  ConstantVelocityHelper m_helper;
   35.18  };
   35.19  
   35.20  } // namespace ns3
    36.1 --- a/src/mobility/random-walk-2d-mobility-model.h	Sun Mar 01 02:39:10 2009 +0300
    36.2 +++ b/src/mobility/random-walk-2d-mobility-model.h	Tue Mar 10 17:54:58 2009 +0300
    36.3 @@ -26,7 +26,7 @@
    36.4  #include "ns3/rectangle.h"
    36.5  #include "ns3/random-variable.h"
    36.6  #include "mobility-model.h"
    36.7 -#include "static-speed-helper.h"
    36.8 +#include "constant-velocity-helper.h"
    36.9  
   36.10  namespace ns3 {
   36.11  
   36.12 @@ -63,7 +63,7 @@
   36.13    virtual void DoSetPosition (const Vector &position);
   36.14    virtual Vector DoGetVelocity (void) const;
   36.15  
   36.16 -  StaticSpeedHelper m_helper;
   36.17 +  ConstantVelocityHelper m_helper;
   36.18    EventId m_event;
   36.19    enum Mode m_mode;
   36.20    double m_modeDistance;
    37.1 --- a/src/mobility/random-waypoint-mobility-model.h	Sun Mar 01 02:39:10 2009 +0300
    37.2 +++ b/src/mobility/random-waypoint-mobility-model.h	Tue Mar 10 17:54:58 2009 +0300
    37.3 @@ -20,7 +20,7 @@
    37.4  #ifndef RANDOM_WAYPOINT_MOBILITY_MODEL_H
    37.5  #define RANDOM_WAYPOINT_MOBILITY_MODEL_H
    37.6  
    37.7 -#include "static-speed-helper.h"
    37.8 +#include "constant-velocity-helper.h"
    37.9  #include "mobility-model.h"
   37.10  #include "position-allocator.h"
   37.11  #include "ns3/ptr.h"
   37.12 @@ -53,7 +53,7 @@
   37.13    virtual void DoSetPosition (const Vector &position);
   37.14    virtual Vector DoGetVelocity (void) const;
   37.15  
   37.16 -  StaticSpeedHelper m_helper;
   37.17 +  ConstantVelocityHelper m_helper;
   37.18    Ptr<PositionAllocator> m_position;
   37.19    RandomVariable m_speed;
   37.20    RandomVariable m_pause;
    38.1 --- a/src/mobility/static-mobility-model.cc	Sun Mar 01 02:39:10 2009 +0300
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,58 +0,0 @@
    38.4 -/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    38.5 -/*
    38.6 - * Copyright (c) 2006,2007 INRIA
    38.7 - *
    38.8 - * This program is free software; you can redistribute it and/or modify
    38.9 - * it under the terms of the GNU General Public License version 2 as
   38.10 - * published by the Free Software Foundation;
   38.11 - *
   38.12 - * This program is distributed in the hope that it will be useful,
   38.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   38.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   38.15 - * GNU General Public License for more details.
   38.16 - *
   38.17 - * You should have received a copy of the GNU General Public License
   38.18 - * along with this program; if not, write to the Free Software
   38.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   38.20 - *
   38.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   38.22 - */
   38.23 -#include "static-mobility-model.h"
   38.24 -
   38.25 -namespace ns3 {
   38.26 -
   38.27 -NS_OBJECT_ENSURE_REGISTERED (StaticMobilityModel);
   38.28 -
   38.29 -TypeId
   38.30 -StaticMobilityModel::GetTypeId (void)
   38.31 -{
   38.32 -  static TypeId tid = TypeId ("ns3::StaticMobilityModel")
   38.33 -    .SetParent<MobilityModel> ()
   38.34 -    .AddConstructor<StaticMobilityModel> ()
   38.35 -    ;
   38.36 -  return tid;
   38.37 -}
   38.38 -  
   38.39 -StaticMobilityModel::StaticMobilityModel ()
   38.40 -{}
   38.41 -StaticMobilityModel::~StaticMobilityModel ()
   38.42 -{}
   38.43 -
   38.44 -Vector
   38.45 -StaticMobilityModel::DoGetPosition (void) const
   38.46 -{
   38.47 -  return m_position;
   38.48 -}
   38.49 -void 
   38.50 -StaticMobilityModel::DoSetPosition (const Vector &position)
   38.51 -{
   38.52 -  m_position = position;
   38.53 -  NotifyCourseChange ();
   38.54 -}
   38.55 -Vector
   38.56 -StaticMobilityModel::DoGetVelocity (void) const
   38.57 -{
   38.58 -  return Vector (0.0, 0.0, 0.0);
   38.59 -}
   38.60 -
   38.61 -}; // namespace ns3
    39.1 --- a/src/mobility/static-mobility-model.h	Sun Mar 01 02:39:10 2009 +0300
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,53 +0,0 @@
    39.4 -/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    39.5 -/*
    39.6 - * Copyright (c) 2006,2007 INRIA
    39.7 - *
    39.8 - * This program is free software; you can redistribute it and/or modify
    39.9 - * it under the terms of the GNU General Public License version 2 as
   39.10 - * published by the Free Software Foundation;
   39.11 - *
   39.12 - * This program is distributed in the hope that it will be useful,
   39.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   39.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   39.15 - * GNU General Public License for more details.
   39.16 - *
   39.17 - * You should have received a copy of the GNU General Public License
   39.18 - * along with this program; if not, write to the Free Software
   39.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   39.20 - *
   39.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   39.22 - */
   39.23 -#ifndef STATIC_MOBILITY_MODEL_H
   39.24 -#define STATIC_MOBILITY_MODEL_H
   39.25 -
   39.26 -#include "mobility-model.h"
   39.27 -#include "vector.h"
   39.28 -
   39.29 -namespace ns3 {
   39.30 -
   39.31 -/**
   39.32 - * \brief a position model for which the current position does not
   39.33 - *        change once it has been set and until it is set again 
   39.34 - *        explicitely to a new value.
   39.35 - */
   39.36 -class StaticMobilityModel : public MobilityModel 
   39.37 -{
   39.38 -public:
   39.39 -  static TypeId GetTypeId (void);
   39.40 -  /**
   39.41 -   * Create a position located at coordinates (0,0,0)
   39.42 -   */
   39.43 -  StaticMobilityModel ();
   39.44 -  virtual ~StaticMobilityModel ();
   39.45 -
   39.46 -private:
   39.47 -  virtual Vector DoGetPosition (void) const;
   39.48 -  virtual void DoSetPosition (const Vector &position);
   39.49 -  virtual Vector DoGetVelocity (void) const;
   39.50 -
   39.51 -  Vector m_position;
   39.52 -};
   39.53 -
   39.54 -}; // namespace ns3
   39.55 -
   39.56 -#endif /* STATIC_MOBILITY_MODEL_H */
    40.1 --- a/src/mobility/static-speed-helper.cc	Sun Mar 01 02:39:10 2009 +0300
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,104 +0,0 @@
    40.4 -/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    40.5 -/*
    40.6 - * Copyright (c) 2006,2007 INRIA
    40.7 - *
    40.8 - * This program is free software; you can redistribute it and/or modify
    40.9 - * it under the terms of the GNU General Public License version 2 as
   40.10 - * published by the Free Software Foundation;
   40.11 - *
   40.12 - * This program is distributed in the hope that it will be useful,
   40.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   40.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   40.15 - * GNU General Public License for more details.
   40.16 - *
   40.17 - * You should have received a copy of the GNU General Public License
   40.18 - * along with this program; if not, write to the Free Software
   40.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   40.20 - *
   40.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   40.22 - */
   40.23 -#include "ns3/simulator.h"
   40.24 -#include "ns3/rectangle.h"
   40.25 -#include "static-speed-helper.h"
   40.26 -
   40.27 -namespace ns3 {
   40.28 -
   40.29 -StaticSpeedHelper::StaticSpeedHelper ()
   40.30 -  : m_paused (true)
   40.31 -{}
   40.32 -StaticSpeedHelper::StaticSpeedHelper (const Vector &position)
   40.33 -  : m_position (position),
   40.34 -    m_paused (true)
   40.35 -{}
   40.36 -StaticSpeedHelper::StaticSpeedHelper (const Vector &position,
   40.37 -				      const Vector &vel)
   40.38 -  : m_position (position),
   40.39 -    m_velocity (vel),
   40.40 -    m_paused (true)
   40.41 -{}
   40.42 -void 
   40.43 -StaticSpeedHelper::SetPosition (const Vector &position)
   40.44 -{
   40.45 -  m_position = position;
   40.46 -  m_velocity = Vector (0.0, 0.0, 0.0);
   40.47 -  m_lastUpdate = Simulator::Now ();
   40.48 -}
   40.49 -
   40.50 -Vector
   40.51 -StaticSpeedHelper::GetCurrentPosition (void) const
   40.52 -{
   40.53 -  return m_position;
   40.54 -}
   40.55 -
   40.56 -Vector 
   40.57 -StaticSpeedHelper::GetVelocity (void) const
   40.58 -{
   40.59 -  return m_paused? Vector (0.0, 0.0, 0.0) : m_velocity;
   40.60 -}
   40.61 -void 
   40.62 -StaticSpeedHelper::SetVelocity (const Vector &vel)
   40.63 -{
   40.64 -  m_velocity = vel;
   40.65 -  m_lastUpdate = Simulator::Now ();
   40.66 -}
   40.67 -
   40.68 -void
   40.69 -StaticSpeedHelper::Update (void) const
   40.70 -{
   40.71 -  Time now = Simulator::Now ();
   40.72 -  NS_ASSERT (m_lastUpdate <= now);
   40.73 -  Time deltaTime = now - m_lastUpdate;
   40.74 -  m_lastUpdate = now;
   40.75 -  if (m_paused)
   40.76 -    {
   40.77 -      return;
   40.78 -    }
   40.79 -  double deltaS = deltaTime.GetSeconds ();
   40.80 -  m_position.x += m_velocity.x * deltaS;
   40.81 -  m_position.y += m_velocity.y * deltaS;
   40.82 -  m_position.z += m_velocity.z * deltaS;
   40.83 -}
   40.84 -
   40.85 -void
   40.86 -StaticSpeedHelper::UpdateWithBounds (const Rectangle &bounds) const
   40.87 -{
   40.88 -  Update ();
   40.89 -  m_position.x = std::min (bounds.xMax, m_position.x);
   40.90 -  m_position.x = std::max (bounds.xMin, m_position.x);
   40.91 -  m_position.y = std::min (bounds.yMax, m_position.y);
   40.92 -  m_position.y = std::max (bounds.yMin, m_position.y);
   40.93 -}
   40.94 -
   40.95 -void 
   40.96 -StaticSpeedHelper::Pause (void)
   40.97 -{
   40.98 -  m_paused = true;
   40.99 -}
  40.100 -
  40.101 -void 
  40.102 -StaticSpeedHelper::Unpause (void)
  40.103 -{
  40.104 -  m_paused = false;
  40.105 -}
  40.106 -
  40.107 -} // namespace ns3
    41.1 --- a/src/mobility/static-speed-helper.h	Sun Mar 01 02:39:10 2009 +0300
    41.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.3 @@ -1,56 +0,0 @@
    41.4 -/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    41.5 -/*
    41.6 - * Copyright (c) 2006,2007 INRIA
    41.7 - *
    41.8 - * This program is free software; you can redistribute it and/or modify
    41.9 - * it under the terms of the GNU General Public License version 2 as
   41.10 - * published by the Free Software Foundation;
   41.11 - *
   41.12 - * This program is distributed in the hope that it will be useful,
   41.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   41.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   41.15 - * GNU General Public License for more details.
   41.16 - *
   41.17 - * You should have received a copy of the GNU General Public License
   41.18 - * along with this program; if not, write to the Free Software
   41.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   41.20 - *
   41.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   41.22 - */
   41.23 -#ifndef STATIC_SPEED_HELPER_H
   41.24 -#define STATIC_SPEED_HELPER_H
   41.25 -
   41.26 -#include "ns3/nstime.h"
   41.27 -#include "vector.h"
   41.28 -
   41.29 -namespace ns3 {
   41.30 -
   41.31 -class Rectangle;
   41.32 -
   41.33 -class StaticSpeedHelper
   41.34 -{
   41.35 - public:
   41.36 -  StaticSpeedHelper ();
   41.37 -  StaticSpeedHelper (const Vector &position);
   41.38 -  StaticSpeedHelper (const Vector &position,
   41.39 -		     const Vector &vel);
   41.40 -
   41.41 -  void SetPosition (const Vector &position);
   41.42 -  Vector GetCurrentPosition (void) const;
   41.43 -  Vector GetVelocity (void) const;
   41.44 -  void SetVelocity (const Vector &vel);
   41.45 -  void Pause (void);
   41.46 -  void Unpause (void);
   41.47 -
   41.48 -  void UpdateWithBounds (const Rectangle &rectangle) const;
   41.49 -  void Update (void) const;
   41.50 - private:
   41.51 -  mutable Time m_lastUpdate;
   41.52 -  mutable Vector m_position;
   41.53 -  Vector m_velocity;
   41.54 -  bool m_paused;
   41.55 -};
   41.56 -
   41.57 -} // namespace ns3
   41.58 -
   41.59 -#endif /* STATIC_SPEED_HELPER_H */
    42.1 --- a/src/mobility/static-speed-mobility-model.cc	Sun Mar 01 02:39:10 2009 +0300
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,69 +0,0 @@
    42.4 -/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    42.5 -/*
    42.6 - * Copyright (c) 2006, 2007 INRIA
    42.7 - *
    42.8 - * This program is free software; you can redistribute it and/or modify
    42.9 - * it under the terms of the GNU General Public License version 2 as
   42.10 - * published by the Free Software Foundation;
   42.11 - *
   42.12 - * This program is distributed in the hope that it will be useful,
   42.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   42.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   42.15 - * GNU General Public License for more details.
   42.16 - *
   42.17 - * You should have received a copy of the GNU General Public License
   42.18 - * along with this program; if not, write to the Free Software
   42.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   42.20 - *
   42.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   42.22 - */
   42.23 -#include "static-speed-mobility-model.h"
   42.24 -#include "ns3/simulator.h"
   42.25 -
   42.26 -namespace ns3 {
   42.27 -
   42.28 -NS_OBJECT_ENSURE_REGISTERED (StaticSpeedMobilityModel);
   42.29 -
   42.30 -TypeId StaticSpeedMobilityModel::GetTypeId (void)
   42.31 -{
   42.32 -  static TypeId tid = TypeId ("ns3::StaticSpeedMobilityModel")
   42.33 -    .SetParent<MobilityModel> ()
   42.34 -    .AddConstructor<StaticSpeedMobilityModel> ();
   42.35 -  return tid;
   42.36 -}
   42.37 -
   42.38 -StaticSpeedMobilityModel::StaticSpeedMobilityModel ()
   42.39 -{}
   42.40 -
   42.41 -StaticSpeedMobilityModel::~StaticSpeedMobilityModel ()
   42.42 -{}
   42.43 -
   42.44 -void 
   42.45 -StaticSpeedMobilityModel::SetVelocity (const Vector &speed)
   42.46 -{
   42.47 -  m_helper.Update ();
   42.48 -  m_helper.SetVelocity (speed);
   42.49 -  m_helper.Unpause ();
   42.50 -  NotifyCourseChange ();
   42.51 -}
   42.52 -
   42.53 -
   42.54 -Vector
   42.55 -StaticSpeedMobilityModel::DoGetPosition (void) const
   42.56 -{
   42.57 -  m_helper.Update ();
   42.58 -  return m_helper.GetCurrentPosition ();
   42.59 -}
   42.60 -void 
   42.61 -StaticSpeedMobilityModel::DoSetPosition (const Vector &position)
   42.62 -{
   42.63 -  m_helper.SetPosition (position);
   42.64 -  NotifyCourseChange ();
   42.65 -}
   42.66 -Vector
   42.67 -StaticSpeedMobilityModel::DoGetVelocity (void) const
   42.68 -{
   42.69 -  return m_helper.GetVelocity ();
   42.70 -}
   42.71 -
   42.72 -}; // namespace ns3
    43.1 --- a/src/mobility/static-speed-mobility-model.h	Sun Mar 01 02:39:10 2009 +0300
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,63 +0,0 @@
    43.4 -/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    43.5 -/*
    43.6 - * Copyright (c) 2006, 2007 INRIA
    43.7 - *
    43.8 - * This program is free software; you can redistribute it and/or modify
    43.9 - * it under the terms of the GNU General Public License version 2 as
   43.10 - * published by the Free Software Foundation;
   43.11 - *
   43.12 - * This program is distributed in the hope that it will be useful,
   43.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   43.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   43.15 - * GNU General Public License for more details.
   43.16 - *
   43.17 - * You should have received a copy of the GNU General Public License
   43.18 - * along with this program; if not, write to the Free Software
   43.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   43.20 - *
   43.21 - * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   43.22 - */
   43.23 -#ifndef STATIC_SPEED_MOBILITY_MODEL_H
   43.24 -#define STATIC_SPEED_MOBILITY_MODEL_H
   43.25 -
   43.26 -#include <stdint.h>
   43.27 -#include "mobility-model.h"
   43.28 -#include "ns3/nstime.h"
   43.29 -#include "static-speed-helper.h"
   43.30 -
   43.31 -namespace ns3 {
   43.32 -
   43.33 -/**
   43.34 - * \brief a position model for which the current speed does not
   43.35 - *        change once it has been set and until it is set again 
   43.36 - *        explicitely to a new value.
   43.37 - */
   43.38 -class StaticSpeedMobilityModel : public MobilityModel 
   43.39 -{
   43.40 -public:
   43.41 -  static TypeId GetTypeId (void);
   43.42 -  /**
   43.43 -   * Create position located at coordinates (0,0,0) with
   43.44 -   * speed (0,0,0).
   43.45 -   */
   43.46 -  StaticSpeedMobilityModel ();
   43.47 -  virtual ~StaticSpeedMobilityModel ();
   43.48 -
   43.49 -  /**
   43.50 -   * \param speed the new speed to set.
   43.51 -   *
   43.52 -   * Set the current speed now to (dx,dy,dz)
   43.53 -   * Unit is meters/s
   43.54 -   */
   43.55 -  void SetVelocity (const Vector &speed);
   43.56 -private:
   43.57 -  virtual Vector DoGetPosition (void) const;
   43.58 -  virtual void DoSetPosition (const Vector &position);
   43.59 -  virtual Vector DoGetVelocity (void) const;
   43.60 -  void Update (void) const;
   43.61 -  StaticSpeedHelper m_helper;
   43.62 -};
   43.63 -
   43.64 -}; // namespace ns3
   43.65 -
   43.66 -#endif /* STATIC_SPEED_POSITION */
    44.1 --- a/src/mobility/wscript	Sun Mar 01 02:39:10 2009 +0300
    44.2 +++ b/src/mobility/wscript	Tue Mar 10 17:54:58 2009 +0300
    44.3 @@ -8,12 +8,13 @@
    44.4          'mobility-model.cc',
    44.5          'position-allocator.cc',
    44.6          'rectangle.cc',
    44.7 -        'static-mobility-model.cc',
    44.8 -        'static-speed-helper.cc',
    44.9 -        'static-speed-mobility-model.cc',
   44.10 +        'constant-position-mobility-model.cc',
   44.11 +        'constant-velocity-helper.cc',
   44.12 +        'constant-velocity-mobility-model.cc',
   44.13          'random-waypoint-mobility-model.cc',
   44.14          'random-walk-2d-mobility-model.cc',
   44.15          'random-direction-2d-mobility-model.cc',
   44.16 +        'constant-acceleration-mobility-model.cc',
   44.17          ]
   44.18  
   44.19      headers = bld.new_task_gen('ns3header')
   44.20 @@ -24,10 +25,11 @@
   44.21          'mobility-model.h',
   44.22          'position-allocator.h',
   44.23          'rectangle.h',
   44.24 -        'static-mobility-model.h',
   44.25 -        'static-speed-helper.h',
   44.26 -        'static-speed-mobility-model.h',
   44.27 +        'constant-position-mobility-model.h',
   44.28 +        'constant-velocity-helper.h',
   44.29 +        'constant-velocity-mobility-model.h',
   44.30          'random-waypoint-mobility-model.h',
   44.31          'random-walk-2d-mobility-model.h',
   44.32          'random-direction-2d-mobility-model.h',
   44.33 +        'constant-acceleration-mobility-model.h',
   44.34          ]