From a0ce50f7ff59aaa487702b7f94c1e66f276c4a3b Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Tue, 13 Jan 2009 17:15:44 -0500 Subject: [PATCH 01/13] Proposed RNG API changes --- bindings/python/ns3_module_bridge.py | 6 +- bindings/python/ns3_module_common.py | 53 +- bindings/python/ns3_module_contrib.py | 33 +- bindings/python/ns3_module_core.py | 318 ++++----- bindings/python/ns3_module_csma.py | 9 +- bindings/python/ns3_module_emu.py | 3 +- bindings/python/ns3_module_global_routing.py | 3 +- bindings/python/ns3_module_helper.py | 78 +- bindings/python/ns3_module_internet_stack.py | 27 +- bindings/python/ns3_module_mobility.py | 53 +- bindings/python/ns3_module_node.py | 150 ++-- bindings/python/ns3_module_olsr.py | 28 +- bindings/python/ns3_module_onoff.py | 3 +- bindings/python/ns3_module_packet_sink.py | 3 +- bindings/python/ns3_module_point_to_point.py | 9 +- bindings/python/ns3_module_simulator.py | 61 +- bindings/python/ns3_module_stats.py | 36 +- bindings/python/ns3_module_udp_echo.py | 6 +- bindings/python/ns3_module_v4ping.py | 3 +- bindings/python/ns3_module_wifi.py | 123 ++-- examples/csma-bridge-one-hop.cc | 3 +- examples/csma-bridge.cc | 3 +- examples/csma-bridge.py | 3 +- examples/csma-broadcast.cc | 3 +- examples/csma-multicast.cc | 4 +- examples/csma-one-subnet.cc | 3 +- examples/csma-packet-socket.cc | 4 +- examples/csma-ping.cc | 3 +- examples/csma-raw-ip-socket.cc | 3 +- examples/csma-star.cc | 3 +- examples/first.cc | 3 +- examples/global-routing-slash32.cc | 3 +- examples/realtime-udp-echo.cc | 4 +- examples/second.cc | 3 +- examples/simple-alternate-routing.cc | 3 +- examples/simple-error-model.cc | 3 +- examples/simple-global-routing.cc | 3 +- examples/simple-point-to-point-olsr.cc | 3 +- examples/star.cc | 3 +- examples/static-routing-slash32.cc | 3 +- examples/tcp-large-transfer.cc | 3 +- examples/tcp-nsc-lfn.cc | 3 +- examples/tcp-nsc-zoo.cc | 3 +- examples/tcp-star-server.cc | 3 +- examples/third.cc | 3 +- examples/wifi-wired-bridging.cc | 3 +- src/core/random-variable.cc | 671 ++++-------------- src/core/random-variable.h | 270 +++---- src/devices/csma/backoff.cc | 3 +- .../random-direction-2d-mobility-model.cc | 4 +- src/routing/olsr/olsr-agent-impl.cc | 2 +- utils/run-tests.cc | 3 +- 52 files changed, 643 insertions(+), 1396 deletions(-) diff --git a/bindings/python/ns3_module_bridge.py b/bindings/python/ns3_module_bridge.py index 013863812..cad48e097 100644 --- a/bindings/python/ns3_module_bridge.py +++ b/bindings/python/ns3_module_bridge.py @@ -54,8 +54,6 @@ def register_methods(root_module): return def register_Ns3BridgeChannel_methods(root_module, cls): - ## bridge-channel.h: ns3::BridgeChannel::BridgeChannel(ns3::BridgeChannel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::BridgeChannel const &', 'arg0')]) ## bridge-channel.h: static ns3::TypeId ns3::BridgeChannel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -77,11 +75,10 @@ def register_Ns3BridgeChannel_methods(root_module, cls): 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3BridgeNetDevice_methods(root_module, cls): - ## bridge-net-device.h: ns3::BridgeNetDevice::BridgeNetDevice(ns3::BridgeNetDevice const & arg0) [copy constructor] - cls.add_constructor([param('ns3::BridgeNetDevice const &', 'arg0')]) ## bridge-net-device.h: static ns3::TypeId ns3::BridgeNetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -258,6 +255,7 @@ def register_Ns3BridgeNetDevice_methods(root_module, cls): 'ns3::Ptr< ns3::NetDevice >', [param('ns3::Mac48Address', 'source')], visibility='protected') + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_common.py b/bindings/python/ns3_module_common.py index 7877692dd..118311638 100644 --- a/bindings/python/ns3_module_common.py +++ b/bindings/python/ns3_module_common.py @@ -190,8 +190,6 @@ def register_Ns3Buffer_methods(root_module, cls): return def register_Ns3BufferIterator_methods(root_module, cls): - ## buffer.h: ns3::Buffer::Iterator::Iterator(ns3::Buffer::Iterator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Buffer::Iterator const &', 'arg0')]) ## buffer.h: ns3::Buffer::Iterator::Iterator() [constructor] cls.add_constructor([]) ## buffer.h: void ns3::Buffer::Iterator::Next() [member function] @@ -334,6 +332,7 @@ def register_Ns3BufferIterator_methods(root_module, cls): 'uint32_t', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3DataRate_methods(root_module, cls): @@ -596,15 +595,11 @@ def register_Ns3PacketMetadataItem_methods(root_module, cls): cls.add_instance_attribute('currentTrimedFromEnd', 'uint32_t', is_const=False) ## packet-metadata.h: ns3::PacketMetadata::Item::current [variable] cls.add_instance_attribute('current', 'ns3::Buffer::Iterator', is_const=False) - ## packet-metadata.h: ns3::PacketMetadata::Item::Item(ns3::PacketMetadata::Item const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketMetadata::Item const &', 'arg0')]) - ## packet-metadata.h: ns3::PacketMetadata::Item::Item() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3PacketMetadataItemIterator_methods(root_module, cls): - ## packet-metadata.h: ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata::ItemIterator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketMetadata::ItemIterator const &', 'arg0')]) ## packet-metadata.h: ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata const * metadata, ns3::Buffer buffer) [constructor] cls.add_constructor([param('ns3::PacketMetadata const *', 'metadata'), param('ns3::Buffer', 'buffer')]) ## packet-metadata.h: bool ns3::PacketMetadata::ItemIterator::HasNext() const [member function] @@ -616,13 +611,10 @@ def register_Ns3PacketMetadataItemIterator_methods(root_module, cls): cls.add_method('Next', 'ns3::PacketMetadata::Item', []) + cls.add_copy_constructor() return def register_Ns3Tag_methods(root_module, cls): - ## tag.h: ns3::Tag::Tag(ns3::Tag const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Tag const &', 'arg0')]) - ## tag.h: ns3::Tag::Tag() [constructor] - cls.add_constructor([]) ## tag.h: static ns3::TypeId ns3::Tag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -648,11 +640,11 @@ def register_Ns3Tag_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3TagBuffer_methods(root_module, cls): - ## tag-buffer.h: ns3::TagBuffer::TagBuffer(ns3::TagBuffer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TagBuffer const &', 'arg0')]) ## tag-buffer.h: ns3::TagBuffer::TagBuffer(uint8_t * start, uint8_t * end) [constructor] cls.add_constructor([param('uint8_t *', 'start'), param('uint8_t *', 'end')]) ## tag-buffer.h: void ns3::TagBuffer::TrimAtEnd(uint32_t trim) [member function] @@ -711,11 +703,10 @@ def register_Ns3TagBuffer_methods(root_module, cls): cls.add_method('Read', 'void', [param('uint8_t *', 'buffer'), param('uint32_t', 'size')]) + cls.add_copy_constructor() return def register_Ns3TagIterator_methods(root_module, cls): - ## packet.h: ns3::TagIterator::TagIterator(ns3::TagIterator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TagIterator const &', 'arg0')]) ## packet.h: bool ns3::TagIterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', @@ -728,8 +719,6 @@ def register_Ns3TagIterator_methods(root_module, cls): return def register_Ns3TagIteratorItem_methods(root_module, cls): - ## packet.h: ns3::TagIterator::Item::Item(ns3::TagIterator::Item const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TagIterator::Item const &', 'arg0')]) ## packet.h: ns3::TypeId ns3::TagIterator::Item::GetTypeId() const [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -750,6 +739,7 @@ def register_Ns3TagIteratorItem_methods(root_module, cls): 'void', [param('ns3::Tag &', 'tag')], is_const=True) + cls.add_copy_constructor() return def register_Ns3TagList_methods(root_module, cls): @@ -785,8 +775,6 @@ def register_Ns3TagList_methods(root_module, cls): return def register_Ns3TagListIterator_methods(root_module, cls): - ## tag-list.h: ns3::TagList::Iterator::Iterator(ns3::TagList::Iterator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TagList::Iterator const &', 'arg0')]) ## tag-list.h: bool ns3::TagList::Iterator::HasNext() const [member function] cls.add_method('HasNext', 'bool', @@ -801,6 +789,7 @@ def register_Ns3TagListIterator_methods(root_module, cls): 'uint32_t', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3TagListIteratorItem_methods(root_module, cls): @@ -814,17 +803,16 @@ def register_Ns3TagListIteratorItem_methods(root_module, cls): cls.add_instance_attribute('end', 'int32_t', is_const=False) ## tag-list.h: ns3::TagList::Iterator::Item::buf [variable] cls.add_instance_attribute('buf', 'ns3::TagBuffer', is_const=False) - ## tag-list.h: ns3::TagList::Iterator::Item::Item(ns3::TagList::Iterator::Item const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TagList::Iterator::Item const &', 'arg0')]) ## tag-list.h: ns3::TagList::Iterator::Item::Item(ns3::TagBuffer buf) [constructor] cls.add_constructor([param('ns3::TagBuffer', 'buf')]) + cls.add_copy_constructor() return def register_Ns3Chunk_methods(root_module, cls): - ## chunk.h: ns3::Chunk::Chunk(ns3::Chunk const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Chunk const &', 'arg0')]) ## chunk.h: ns3::Chunk::Chunk() [constructor] cls.add_constructor([]) + ## chunk.h: ns3::Chunk::Chunk(ns3::Chunk const & arg0) [copy constructor] + cls.add_constructor([param('ns3::Chunk const &', 'arg0')]) ## chunk.h: static ns3::TypeId ns3::Chunk::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -843,15 +831,11 @@ def register_Ns3Chunk_methods(root_module, cls): return def register_Ns3DataRateChecker_methods(root_module, cls): - ## data-rate.h: ns3::DataRateChecker::DataRateChecker(ns3::DataRateChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DataRateChecker const &', 'arg0')]) - ## data-rate.h: ns3::DataRateChecker::DataRateChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3DataRateValue_methods(root_module, cls): - ## data-rate.h: ns3::DataRateValue::DataRateValue(ns3::DataRateValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DataRateValue const &', 'arg0')]) ## data-rate.h: ns3::DataRateValue::DataRateValue() [constructor] cls.add_constructor([]) ## data-rate.h: ns3::DataRateValue::DataRateValue(ns3::DataRate const & value) [constructor] @@ -880,6 +864,7 @@ def register_Ns3DataRateValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Header_methods(root_module, cls): @@ -916,8 +901,6 @@ def register_Ns3Header_methods(root_module, cls): return def register_Ns3PcapWriter_methods(root_module, cls): - ## pcap-writer.h: ns3::PcapWriter::PcapWriter(ns3::PcapWriter const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PcapWriter const &', 'arg0')]) ## pcap-writer.h: ns3::PcapWriter::PcapWriter() [constructor] cls.add_constructor([]) ## pcap-writer.h: void ns3::PcapWriter::Open(std::string const & name) [member function] @@ -944,6 +927,7 @@ def register_Ns3PcapWriter_methods(root_module, cls): cls.add_method('WritePacket', 'void', [param('ns3::Ptr< ns3::Packet const >', 'packet')]) + cls.add_copy_constructor() return def register_Ns3Trailer_methods(root_module, cls): @@ -980,8 +964,6 @@ def register_Ns3Trailer_methods(root_module, cls): return def register_Ns3ErrorModel_methods(root_module, cls): - ## error-model.h: ns3::ErrorModel::ErrorModel(ns3::ErrorModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ErrorModel const &', 'arg0')]) ## error-model.h: static ns3::TypeId ns3::ErrorModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1020,11 +1002,10 @@ def register_Ns3ErrorModel_methods(root_module, cls): 'void', [], is_pure_virtual=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ListErrorModel_methods(root_module, cls): - ## error-model.h: ns3::ListErrorModel::ListErrorModel(ns3::ListErrorModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ListErrorModel const &', 'arg0')]) ## error-model.h: static ns3::TypeId ns3::ListErrorModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1051,11 +1032,10 @@ def register_Ns3ListErrorModel_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RateErrorModel_methods(root_module, cls): - ## error-model.h: ns3::RateErrorModel::RateErrorModel(ns3::RateErrorModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RateErrorModel const &', 'arg0')]) ## error-model.h: static ns3::TypeId ns3::RateErrorModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1110,6 +1090,7 @@ def register_Ns3RateErrorModel_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_contrib.py b/bindings/python/ns3_module_contrib.py index e9bcfc194..2c9214727 100644 --- a/bindings/python/ns3_module_contrib.py +++ b/bindings/python/ns3_module_contrib.py @@ -88,8 +88,6 @@ def register_methods(root_module): return def register_Ns3DelayJitterEstimation_methods(root_module, cls): - ## delay-jitter-estimation.h: ns3::DelayJitterEstimation::DelayJitterEstimation(ns3::DelayJitterEstimation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DelayJitterEstimation const &', 'arg0')]) ## delay-jitter-estimation.h: ns3::DelayJitterEstimation::DelayJitterEstimation() [constructor] cls.add_constructor([]) ## delay-jitter-estimation.h: static void ns3::DelayJitterEstimation::PrepareTx(ns3::Ptr packet) [member function] @@ -111,22 +109,20 @@ def register_Ns3DelayJitterEstimation_methods(root_module, cls): 'ns3::Time', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3EventGarbageCollector_methods(root_module, cls): - ## event-garbage-collector.h: ns3::EventGarbageCollector::EventGarbageCollector(ns3::EventGarbageCollector const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EventGarbageCollector const &', 'arg0')]) ## event-garbage-collector.h: ns3::EventGarbageCollector::EventGarbageCollector() [constructor] cls.add_constructor([]) ## event-garbage-collector.h: void ns3::EventGarbageCollector::Track(ns3::EventId event) [member function] cls.add_method('Track', 'void', [param('ns3::EventId', 'event')]) + cls.add_copy_constructor() return def register_Ns3Gnuplot_methods(root_module, cls): - ## gnuplot.h: ns3::Gnuplot::Gnuplot(ns3::Gnuplot const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Gnuplot const &', 'arg0')]) ## gnuplot.h: ns3::Gnuplot::Gnuplot(std::string const & outputFilename="", std::string const & title="") [constructor] cls.add_constructor([param('std::string const &', 'outputFilename', default_value='""'), param('std::string const &', 'title', default_value='""')]) ## gnuplot.h: static std::string ns3::Gnuplot::DetectTerminal(std::string const & filename) [member function] @@ -163,11 +159,10 @@ def register_Ns3Gnuplot_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True) + cls.add_copy_constructor() return def register_Ns3GnuplotCollection_methods(root_module, cls): - ## gnuplot.h: ns3::GnuplotCollection::GnuplotCollection(ns3::GnuplotCollection const & arg0) [copy constructor] - cls.add_constructor([param('ns3::GnuplotCollection const &', 'arg0')]) ## gnuplot.h: ns3::GnuplotCollection::GnuplotCollection(std::string const & outputFilename) [constructor] cls.add_constructor([param('std::string const &', 'outputFilename')]) ## gnuplot.h: void ns3::GnuplotCollection::SetTerminal(std::string const & terminal) [member function] @@ -187,6 +182,7 @@ def register_Ns3GnuplotCollection_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True) + cls.add_copy_constructor() return def register_Ns3GnuplotDataset_methods(root_module, cls): @@ -211,19 +207,16 @@ def register_Ns3GnuplotDataset_methods(root_module, cls): return def register_Ns3GtkConfigStore_methods(root_module, cls): - ## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore(ns3::GtkConfigStore const & arg0) [copy constructor] - cls.add_constructor([param('ns3::GtkConfigStore const &', 'arg0')]) ## gtk-config-store.h: ns3::GtkConfigStore::GtkConfigStore() [constructor] cls.add_constructor([]) ## gtk-config-store.h: void ns3::GtkConfigStore::Configure() [member function] cls.add_method('Configure', 'void', []) + cls.add_copy_constructor() return def register_Ns3ConfigStore_methods(root_module, cls): - ## config-store.h: ns3::ConfigStore::ConfigStore(ns3::ConfigStore const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ConfigStore const &', 'arg0')]) ## config-store.h: static ns3::TypeId ns3::ConfigStore::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -240,11 +233,10 @@ def register_Ns3ConfigStore_methods(root_module, cls): cls.add_method('Configure', 'void', []) + cls.add_copy_constructor() return def register_Ns3FlowIdTag_methods(root_module, cls): - ## flow-id-tag.h: ns3::FlowIdTag::FlowIdTag(ns3::FlowIdTag const & arg0) [copy constructor] - cls.add_constructor([param('ns3::FlowIdTag const &', 'arg0')]) ## flow-id-tag.h: static ns3::TypeId ns3::FlowIdTag::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -293,11 +285,10 @@ def register_Ns3FlowIdTag_methods(root_module, cls): 'uint32_t', [], is_static=True) + cls.add_copy_constructor() return def register_Ns3Gnuplot2dDataset_methods(root_module, cls): - ## gnuplot.h: ns3::Gnuplot2dDataset::Gnuplot2dDataset(ns3::Gnuplot2dDataset const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Gnuplot2dDataset const &', 'arg0')]) ## gnuplot.h: ns3::Gnuplot2dDataset::Gnuplot2dDataset(std::string const & title="Untitled") [constructor] cls.add_constructor([param('std::string const &', 'title', default_value='"Untitled"')]) ## gnuplot.h: static void ns3::Gnuplot2dDataset::SetDefaultStyle(ns3::Gnuplot2dDataset::Style style) [member function] @@ -334,22 +325,20 @@ def register_Ns3Gnuplot2dDataset_methods(root_module, cls): cls.add_method('AddEmptyLine', 'void', []) + cls.add_copy_constructor() return def register_Ns3Gnuplot2dFunction_methods(root_module, cls): - ## gnuplot.h: ns3::Gnuplot2dFunction::Gnuplot2dFunction(ns3::Gnuplot2dFunction const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Gnuplot2dFunction const &', 'arg0')]) ## gnuplot.h: ns3::Gnuplot2dFunction::Gnuplot2dFunction(std::string const & title="Untitled", std::string const & function="") [constructor] cls.add_constructor([param('std::string const &', 'title', default_value='"Untitled"'), param('std::string const &', 'function', default_value='""')]) ## gnuplot.h: void ns3::Gnuplot2dFunction::SetFunction(std::string const & function) [member function] cls.add_method('SetFunction', 'void', [param('std::string const &', 'function')]) + cls.add_copy_constructor() return def register_Ns3Gnuplot3dDataset_methods(root_module, cls): - ## gnuplot.h: ns3::Gnuplot3dDataset::Gnuplot3dDataset(ns3::Gnuplot3dDataset const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Gnuplot3dDataset const &', 'arg0')]) ## gnuplot.h: ns3::Gnuplot3dDataset::Gnuplot3dDataset(std::string const & title="Untitled") [constructor] cls.add_constructor([param('std::string const &', 'title', default_value='"Untitled"')]) ## gnuplot.h: static void ns3::Gnuplot3dDataset::SetDefaultStyle(std::string const & style) [member function] @@ -369,17 +358,17 @@ def register_Ns3Gnuplot3dDataset_methods(root_module, cls): cls.add_method('AddEmptyLine', 'void', []) + cls.add_copy_constructor() return def register_Ns3Gnuplot3dFunction_methods(root_module, cls): - ## gnuplot.h: ns3::Gnuplot3dFunction::Gnuplot3dFunction(ns3::Gnuplot3dFunction const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Gnuplot3dFunction const &', 'arg0')]) ## gnuplot.h: ns3::Gnuplot3dFunction::Gnuplot3dFunction(std::string const & title="Untitled", std::string const & function="") [constructor] cls.add_constructor([param('std::string const &', 'title', default_value='"Untitled"'), param('std::string const &', 'function', default_value='""')]) ## gnuplot.h: void ns3::Gnuplot3dFunction::SetFunction(std::string const & function) [member function] cls.add_method('SetFunction', 'void', [param('std::string const &', 'function')]) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py index dc4b76aec..b680c1766 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -55,6 +55,8 @@ def register_types(module): module.add_class('RefCountBase', automatic_type_narrowing=True, memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount')) ## rng-stream.h: ns3::RngStream [class] module.add_class('RngStream') + ## random-variable.h: ns3::SeedManager [class] + module.add_class('SeedManager') ## random-variable.h: ns3::SequentialVariable [class] module.add_class('SequentialVariable', parent=root_module['ns3::RandomVariable']) ## system-condition.h: ns3::SystemCondition [class] @@ -228,6 +230,7 @@ def register_methods(root_module): register_Ns3RandomVariable_methods(root_module, root_module['ns3::RandomVariable']) register_Ns3RefCountBase_methods(root_module, root_module['ns3::RefCountBase']) register_Ns3RngStream_methods(root_module, root_module['ns3::RngStream']) + register_Ns3SeedManager_methods(root_module, root_module['ns3::SeedManager']) register_Ns3SequentialVariable_methods(root_module, root_module['ns3::SequentialVariable']) register_Ns3SystemCondition_methods(root_module, root_module['ns3::SystemCondition']) register_Ns3SystemMutex_methods(root_module, root_module['ns3::SystemMutex']) @@ -319,8 +322,6 @@ def register_Ns3AttributeList_methods(root_module, cls): return def register_Ns3CallbackBase_methods(root_module, cls): - ## callback.h: ns3::CallbackBase::CallbackBase(ns3::CallbackBase const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CallbackBase const &', 'arg0')]) ## callback.h: ns3::CallbackBase::CallbackBase() [constructor] cls.add_constructor([]) ## callback.h: ns3::Ptr ns3::CallbackBase::GetImpl() const [member function] @@ -331,11 +332,10 @@ def register_Ns3CallbackBase_methods(root_module, cls): ## callback.h: ns3::CallbackBase::CallbackBase(ns3::Ptr impl) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::CallbackImplBase >', 'impl')], visibility='protected') + cls.add_copy_constructor() return def register_Ns3CallbackImplBase_methods(root_module, cls): - ## callback.h: ns3::CallbackImplBase::CallbackImplBase(ns3::CallbackImplBase const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CallbackImplBase const &', 'arg0')]) ## callback.h: ns3::CallbackImplBase::CallbackImplBase() [constructor] cls.add_constructor([]) ## callback.h: bool ns3::CallbackImplBase::IsEqual(ns3::Ptr other) const [member function] @@ -343,29 +343,25 @@ def register_Ns3CallbackImplBase_methods(root_module, cls): 'bool', [param('ns3::Ptr< ns3::CallbackImplBase const >', 'other')], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3CommandLine_methods(root_module, cls): - ## command-line.h: ns3::CommandLine::CommandLine(ns3::CommandLine const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CommandLine const &', 'arg0')]) - ## command-line.h: ns3::CommandLine::CommandLine() [constructor] - cls.add_constructor([]) ## command-line.h: void ns3::CommandLine::AddValue(std::string const & name, std::string const & help, ns3::Callback callback) [member function] cls.add_method('AddValue', 'void', [param('std::string const &', 'name'), param('std::string const &', 'help'), param('ns3::Callback< bool, std::string, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3CriticalSection_methods(root_module, cls): - ## system-mutex.h: ns3::CriticalSection::CriticalSection(ns3::CriticalSection const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CriticalSection const &', 'arg0')]) ## system-mutex.h: ns3::CriticalSection::CriticalSection(ns3::SystemMutex & mutex) [constructor] cls.add_constructor([param('ns3::SystemMutex &', 'mutex')]) + cls.add_copy_constructor() return def register_Ns3GlobalValue_methods(root_module, cls): - ## global-value.h: ns3::GlobalValue::GlobalValue(ns3::GlobalValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::GlobalValue const &', 'arg0')]) ## global-value.h: ns3::GlobalValue::GlobalValue(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr checker) [constructor] cls.add_constructor([param('std::string', 'name'), param('std::string', 'help'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')]) ## global-value.h: std::string ns3::GlobalValue::GetName() const [member function] @@ -412,62 +408,49 @@ def register_Ns3GlobalValue_methods(root_module, cls): '__gnu_cxx::__normal_iterator< ns3::GlobalValue * const *, std::vector< ns3::GlobalValue * > >', [], is_static=True) + cls.add_copy_constructor() return def register_Ns3IntToType__0_methods(root_module, cls): - ## int-to-type.h: ns3::IntToType<0>::IntToType(ns3::IntToType<0> const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntToType< 0 > const &', 'arg0')]) - ## int-to-type.h: ns3::IntToType<0>::IntToType() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3IntToType__1_methods(root_module, cls): - ## int-to-type.h: ns3::IntToType<1>::IntToType(ns3::IntToType<1> const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntToType< 1 > const &', 'arg0')]) - ## int-to-type.h: ns3::IntToType<1>::IntToType() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3IntToType__2_methods(root_module, cls): - ## int-to-type.h: ns3::IntToType<2>::IntToType(ns3::IntToType<2> const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntToType< 2 > const &', 'arg0')]) - ## int-to-type.h: ns3::IntToType<2>::IntToType() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3IntToType__3_methods(root_module, cls): - ## int-to-type.h: ns3::IntToType<3>::IntToType(ns3::IntToType<3> const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntToType< 3 > const &', 'arg0')]) - ## int-to-type.h: ns3::IntToType<3>::IntToType() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3IntToType__4_methods(root_module, cls): - ## int-to-type.h: ns3::IntToType<4>::IntToType(ns3::IntToType<4> const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntToType< 4 > const &', 'arg0')]) - ## int-to-type.h: ns3::IntToType<4>::IntToType() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3IntToType__5_methods(root_module, cls): - ## int-to-type.h: ns3::IntToType<5>::IntToType(ns3::IntToType<5> const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntToType< 5 > const &', 'arg0')]) - ## int-to-type.h: ns3::IntToType<5>::IntToType() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3IntToType__6_methods(root_module, cls): - ## int-to-type.h: ns3::IntToType<6>::IntToType(ns3::IntToType<6> const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntToType< 6 > const &', 'arg0')]) - ## int-to-type.h: ns3::IntToType<6>::IntToType() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3ObjectBase_methods(root_module, cls): - ## object-base.h: ns3::ObjectBase::ObjectBase(ns3::ObjectBase const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ObjectBase const &', 'arg0')]) ## object-base.h: ns3::ObjectBase::ObjectBase() [constructor] cls.add_constructor([]) + ## object-base.h: ns3::ObjectBase::ObjectBase(ns3::ObjectBase const & arg0) [copy constructor] + cls.add_constructor([param('ns3::ObjectBase const &', 'arg0')]) ## object-base.h: static ns3::TypeId ns3::ObjectBase::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -573,31 +556,11 @@ def register_Ns3RandomVariable_methods(root_module, cls): 'uint32_t', [], is_const=True) - ## random-variable.h: void ns3::RandomVariable::GetSeed(uint32_t * seed) const [member function] - cls.add_method('GetSeed', - 'void', - [param('uint32_t *', 'seed', direction=2, array_length=6)], - is_const=True) ## random-variable.h: double ns3::RandomVariable::GetValue() const [member function] cls.add_method('GetValue', 'double', [], is_const=True) - ## random-variable.h: static void ns3::RandomVariable::SetRunNumber(uint32_t n) [member function] - cls.add_method('SetRunNumber', - 'void', - [param('uint32_t', 'n')], - is_static=True) - ## random-variable.h: static void ns3::RandomVariable::UseDevRandom(bool udr=true) [member function] - cls.add_method('UseDevRandom', - 'void', - [param('bool', 'udr', default_value='true')], - is_static=True) - ## random-variable.h: static void ns3::RandomVariable::UseGlobalSeed(uint32_t s0, uint32_t s1, uint32_t s2, uint32_t s3, uint32_t s4, uint32_t s5) [member function] - cls.add_method('UseGlobalSeed', - 'void', - [param('uint32_t', 's0'), param('uint32_t', 's1'), param('uint32_t', 's2'), param('uint32_t', 's3'), param('uint32_t', 's4'), param('uint32_t', 's5')], - is_static=True) return def register_Ns3RefCountBase_methods(root_module, cls): @@ -673,18 +636,60 @@ def register_Ns3RngStream_methods(root_module, cls): is_static=True) return +def register_Ns3SeedManager_methods(root_module, cls): + ## random-variable.h: static void ns3::SeedManager::SetSeed(uint32_t seed) [member function] + cls.add_method('SetSeed', + 'void', + [param('uint32_t', 'seed')], + is_static=True) + ## random-variable.h: static uint32_t ns3::SeedManager::GetSeed() [member function] + cls.add_method('GetSeed', + 'uint32_t', + [], + is_static=True) + ## random-variable.h: static void ns3::SeedManager::SetSeed(uint32_t * seed) [member function] + cls.add_method('SetSeed', + 'void', + [param('uint32_t *', 'seed')], + is_static=True) + ## random-variable.h: static void ns3::SeedManager::GetSeed(uint32_t * seed) [member function] + cls.add_method('GetSeed', + 'void', + [param('uint32_t *', 'seed')], + is_static=True) + ## random-variable.h: static void ns3::SeedManager::SetRun(uint32_t run) [member function] + cls.add_method('SetRun', + 'void', + [param('uint32_t', 'run')], + is_static=True) + ## random-variable.h: static uint32_t ns3::SeedManager::GetRun() [member function] + cls.add_method('GetRun', + 'uint32_t', + [], + is_static=True) + ## random-variable.h: static bool ns3::SeedManager::CheckSeed(uint32_t seed) [member function] + cls.add_method('CheckSeed', + 'bool', + [param('uint32_t', 'seed')], + is_static=True) + ## random-variable.h: static bool ns3::SeedManager::CheckSeed(uint32_t * seed) [member function] + cls.add_method('CheckSeed', + 'bool', + [param('uint32_t *', 'seed')], + is_static=True) + cls.add_constructor([]) + cls.add_copy_constructor() + return + def register_Ns3SequentialVariable_methods(root_module, cls): - ## random-variable.h: ns3::SequentialVariable::SequentialVariable(ns3::SequentialVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SequentialVariable const &', 'arg0')]) ## random-variable.h: ns3::SequentialVariable::SequentialVariable(double f, double l, double i=1, uint32_t c=1) [constructor] cls.add_constructor([param('double', 'f'), param('double', 'l'), param('double', 'i', default_value='1'), param('uint32_t', 'c', default_value='1')]) ## random-variable.h: ns3::SequentialVariable::SequentialVariable(double f, double l, ns3::RandomVariable const & i, uint32_t c=1) [constructor] cls.add_constructor([param('double', 'f'), param('double', 'l'), param('ns3::RandomVariable const &', 'i'), param('uint32_t', 'c', default_value='1')]) + cls.add_copy_constructor() return def register_Ns3SystemCondition_methods(root_module, cls): - ## system-condition.h: ns3::SystemCondition::SystemCondition(ns3::SystemCondition const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SystemCondition const &', 'arg0')]) ## system-condition.h: ns3::SystemCondition::SystemCondition() [constructor] cls.add_constructor([]) ## system-condition.h: void ns3::SystemCondition::SetCondition(bool condition) [member function] @@ -711,11 +716,10 @@ def register_Ns3SystemCondition_methods(root_module, cls): cls.add_method('TimedWait', 'bool', [param('uint64_t', 'ns')]) + cls.add_copy_constructor() return def register_Ns3SystemMutex_methods(root_module, cls): - ## system-mutex.h: ns3::SystemMutex::SystemMutex(ns3::SystemMutex const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SystemMutex const &', 'arg0')]) ## system-mutex.h: ns3::SystemMutex::SystemMutex() [constructor] cls.add_constructor([]) ## system-mutex.h: void ns3::SystemMutex::Lock() [member function] @@ -726,11 +730,10 @@ def register_Ns3SystemMutex_methods(root_module, cls): cls.add_method('Unlock', 'void', []) + cls.add_copy_constructor() return def register_Ns3SystemThread_methods(root_module, cls): - ## system-thread.h: ns3::SystemThread::SystemThread(ns3::SystemThread const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SystemThread const &', 'arg0')]) ## system-thread.h: ns3::SystemThread::SystemThread(ns3::Callback callback) [constructor] cls.add_constructor([param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')]) ## system-thread.h: void ns3::SystemThread::Ref() const [member function] @@ -759,11 +762,10 @@ def register_Ns3SystemThread_methods(root_module, cls): cls.add_method('Break', 'bool', []) + cls.add_copy_constructor() return def register_Ns3SystemWallClockMs_methods(root_module, cls): - ## system-wall-clock-ms.h: ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')]) ## system-wall-clock-ms.h: ns3::SystemWallClockMs::SystemWallClockMs() [constructor] cls.add_constructor([]) ## system-wall-clock-ms.h: void ns3::SystemWallClockMs::Start() [member function] @@ -774,11 +776,10 @@ def register_Ns3SystemWallClockMs_methods(root_module, cls): cls.add_method('End', 'long long unsigned int', []) + cls.add_copy_constructor() return def register_Ns3TraceSourceAccessor_methods(root_module, cls): - ## trace-source-accessor.h: ns3::TraceSourceAccessor::TraceSourceAccessor(ns3::TraceSourceAccessor const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TraceSourceAccessor const &', 'arg0')]) ## trace-source-accessor.h: ns3::TraceSourceAccessor::TraceSourceAccessor() [constructor] cls.add_constructor([]) ## trace-source-accessor.h: void ns3::TraceSourceAccessor::Ref() const [member function] @@ -811,20 +812,15 @@ def register_Ns3TraceSourceAccessor_methods(root_module, cls): 'bool', [param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3TriangularVariable_methods(root_module, cls): - ## random-variable.h: ns3::TriangularVariable::TriangularVariable(ns3::TriangularVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TriangularVariable const &', 'arg0')]) ## random-variable.h: ns3::TriangularVariable::TriangularVariable() [constructor] cls.add_constructor([]) ## random-variable.h: ns3::TriangularVariable::TriangularVariable(double s, double l, double mean) [constructor] cls.add_constructor([param('double', 's'), param('double', 'l'), param('double', 'mean')]) - ## random-variable.h: static double ns3::TriangularVariable::GetSingleValue(double s, double l, double mean) [member function] - cls.add_method('GetSingleValue', - 'double', - [param('double', 's'), param('double', 'l'), param('double', 'mean')], - is_static=True) + cls.add_copy_constructor() return def register_Ns3TypeId_methods(root_module, cls): @@ -1007,24 +1003,24 @@ def register_Ns3TypeIdAttributeInfo_methods(root_module, cls): cls.add_instance_attribute('flags', 'uint32_t', is_const=False) ## type-id.h: ns3::TypeId::AttributeInfo::checker [variable] cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False) - ## type-id.h: ns3::TypeId::AttributeInfo::AttributeInfo(ns3::TypeId::AttributeInfo const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TypeId::AttributeInfo const &', 'arg0')]) - ## type-id.h: ns3::TypeId::AttributeInfo::AttributeInfo() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3UniformVariable_methods(root_module, cls): - ## random-variable.h: ns3::UniformVariable::UniformVariable(ns3::UniformVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UniformVariable const &', 'arg0')]) ## random-variable.h: ns3::UniformVariable::UniformVariable() [constructor] cls.add_constructor([]) ## random-variable.h: ns3::UniformVariable::UniformVariable(double s, double l) [constructor] cls.add_constructor([param('double', 's'), param('double', 'l')]) - ## random-variable.h: static double ns3::UniformVariable::GetSingleValue(double s, double l) [member function] - cls.add_method('GetSingleValue', + ## random-variable.h: double ns3::UniformVariable::GetValue() [member function] + cls.add_method('GetValue', 'double', - [param('double', 's'), param('double', 'l')], - is_static=True) + []) + ## random-variable.h: double ns3::UniformVariable::GetValue(double s, double l) [member function] + cls.add_method('GetValue', + 'double', + [param('double', 's'), param('double', 'l')]) + cls.add_copy_constructor() return def register_Ns3UnsafeAttributeList_methods(root_module, cls): @@ -1044,8 +1040,6 @@ def register_Ns3UnsafeAttributeList_methods(root_module, cls): return def register_Ns3WeibullVariable_methods(root_module, cls): - ## random-variable.h: ns3::WeibullVariable::WeibullVariable(ns3::WeibullVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WeibullVariable const &', 'arg0')]) ## random-variable.h: ns3::WeibullVariable::WeibullVariable() [constructor] cls.add_constructor([]) ## random-variable.h: ns3::WeibullVariable::WeibullVariable(double m) [constructor] @@ -1054,23 +1048,15 @@ def register_Ns3WeibullVariable_methods(root_module, cls): cls.add_constructor([param('double', 'm'), param('double', 's')]) ## random-variable.h: ns3::WeibullVariable::WeibullVariable(double m, double s, double b) [constructor] cls.add_constructor([param('double', 'm'), param('double', 's'), param('double', 'b')]) - ## random-variable.h: static double ns3::WeibullVariable::GetSingleValue(double m, double s, double b=0) [member function] - cls.add_method('GetSingleValue', - 'double', - [param('double', 'm'), param('double', 's'), param('double', 'b', default_value='0')], - is_static=True) + cls.add_copy_constructor() return def register_Ns3Empty_methods(root_module, cls): - ## empty.h: ns3::empty::empty(ns3::empty const & arg0) [copy constructor] - cls.add_constructor([param('ns3::empty const &', 'arg0')]) - ## empty.h: ns3::empty::empty() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3AttributeAccessor_methods(root_module, cls): - ## attribute.h: ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [copy constructor] - cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')]) ## attribute.h: ns3::AttributeAccessor::AttributeAccessor() [constructor] cls.add_constructor([]) ## attribute.h: bool ns3::AttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function] @@ -1093,11 +1079,10 @@ def register_Ns3AttributeAccessor_methods(root_module, cls): 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3AttributeChecker_methods(root_module, cls): - ## attribute.h: ns3::AttributeChecker::AttributeChecker(ns3::AttributeChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::AttributeChecker const &', 'arg0')]) ## attribute.h: ns3::AttributeChecker::AttributeChecker() [constructor] cls.add_constructor([]) ## attribute.h: bool ns3::AttributeChecker::Check(ns3::AttributeValue const & value) const [member function] @@ -1130,6 +1115,7 @@ def register_Ns3AttributeChecker_methods(root_module, cls): 'bool', [param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3AttributeValue_methods(root_module, cls): @@ -1155,10 +1141,8 @@ def register_Ns3AttributeValue_methods(root_module, cls): return def register_Ns3BooleanChecker_methods(root_module, cls): - ## boolean.h: ns3::BooleanChecker::BooleanChecker(ns3::BooleanChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::BooleanChecker const &', 'arg0')]) - ## boolean.h: ns3::BooleanChecker::BooleanChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3BooleanValue_methods(root_module, cls): @@ -1196,15 +1180,11 @@ def register_Ns3BooleanValue_methods(root_module, cls): return def register_Ns3CallbackChecker_methods(root_module, cls): - ## callback.h: ns3::CallbackChecker::CallbackChecker(ns3::CallbackChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CallbackChecker const &', 'arg0')]) - ## callback.h: ns3::CallbackChecker::CallbackChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3CallbackValue_methods(root_module, cls): - ## callback.h: ns3::CallbackValue::CallbackValue(ns3::CallbackValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CallbackValue const &', 'arg0')]) ## callback.h: ns3::CallbackValue::CallbackValue() [constructor] cls.add_constructor([]) ## callback.h: ns3::CallbackValue::CallbackValue(ns3::CallbackBase const & base) [constructor] @@ -1228,11 +1208,10 @@ def register_Ns3CallbackValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ConstantVariable_methods(root_module, cls): - ## random-variable.h: ns3::ConstantVariable::ConstantVariable(ns3::ConstantVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ConstantVariable const &', 'arg0')]) ## random-variable.h: ns3::ConstantVariable::ConstantVariable() [constructor] cls.add_constructor([]) ## random-variable.h: ns3::ConstantVariable::ConstantVariable(double c) [constructor] @@ -1241,18 +1220,16 @@ def register_Ns3ConstantVariable_methods(root_module, cls): cls.add_method('SetConstant', 'void', [param('double', 'c')]) + cls.add_copy_constructor() return def register_Ns3DeterministicVariable_methods(root_module, cls): - ## random-variable.h: ns3::DeterministicVariable::DeterministicVariable(ns3::DeterministicVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DeterministicVariable const &', 'arg0')]) ## random-variable.h: ns3::DeterministicVariable::DeterministicVariable(double * d, uint32_t c) [constructor] cls.add_constructor([param('double *', 'd'), param('uint32_t', 'c')]) + cls.add_copy_constructor() return def register_Ns3DoubleValue_methods(root_module, cls): - ## double.h: ns3::DoubleValue::DoubleValue(ns3::DoubleValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DoubleValue const &', 'arg0')]) ## double.h: ns3::DoubleValue::DoubleValue() [constructor] cls.add_constructor([]) ## double.h: ns3::DoubleValue::DoubleValue(double const & value) [constructor] @@ -1281,17 +1258,17 @@ def register_Ns3DoubleValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3EmpiricalVariable_methods(root_module, cls): - ## random-variable.h: ns3::EmpiricalVariable::EmpiricalVariable(ns3::EmpiricalVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EmpiricalVariable const &', 'arg0')]) ## random-variable.h: ns3::EmpiricalVariable::EmpiricalVariable() [constructor] cls.add_constructor([]) ## random-variable.h: void ns3::EmpiricalVariable::CDF(double v, double c) [member function] cls.add_method('CDF', 'void', [param('double', 'v'), param('double', 'c')]) + cls.add_copy_constructor() return def register_Ns3EmptyAttributeValue_methods(root_module, cls): @@ -1317,8 +1294,6 @@ def register_Ns3EmptyAttributeValue_methods(root_module, cls): return def register_Ns3EnumChecker_methods(root_module, cls): - ## enum.h: ns3::EnumChecker::EnumChecker(ns3::EnumChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EnumChecker const &', 'arg0')]) ## enum.h: ns3::EnumChecker::EnumChecker() [constructor] cls.add_constructor([]) ## enum.h: void ns3::EnumChecker::AddDefault(int v, std::string name) [member function] @@ -1359,11 +1334,10 @@ def register_Ns3EnumChecker_methods(root_module, cls): 'bool', [param('ns3::AttributeValue const &', 'src'), param('ns3::AttributeValue &', 'dst')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3EnumValue_methods(root_module, cls): - ## enum.h: ns3::EnumValue::EnumValue(ns3::EnumValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EnumValue const &', 'arg0')]) ## enum.h: ns3::EnumValue::EnumValue() [constructor] cls.add_constructor([]) ## enum.h: ns3::EnumValue::EnumValue(int v) [constructor] @@ -1392,34 +1366,26 @@ def register_Ns3EnumValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ExponentialVariable_methods(root_module, cls): - ## random-variable.h: ns3::ExponentialVariable::ExponentialVariable(ns3::ExponentialVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ExponentialVariable const &', 'arg0')]) ## random-variable.h: ns3::ExponentialVariable::ExponentialVariable() [constructor] cls.add_constructor([]) ## random-variable.h: ns3::ExponentialVariable::ExponentialVariable(double m) [constructor] cls.add_constructor([param('double', 'm')]) ## random-variable.h: ns3::ExponentialVariable::ExponentialVariable(double m, double b) [constructor] cls.add_constructor([param('double', 'm'), param('double', 'b')]) - ## random-variable.h: static double ns3::ExponentialVariable::GetSingleValue(double m, double b=0) [member function] - cls.add_method('GetSingleValue', - 'double', - [param('double', 'm'), param('double', 'b', default_value='0')], - is_static=True) + cls.add_copy_constructor() return def register_Ns3IntEmpiricalVariable_methods(root_module, cls): - ## random-variable.h: ns3::IntEmpiricalVariable::IntEmpiricalVariable(ns3::IntEmpiricalVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntEmpiricalVariable const &', 'arg0')]) ## random-variable.h: ns3::IntEmpiricalVariable::IntEmpiricalVariable() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3IntegerValue_methods(root_module, cls): - ## integer.h: ns3::IntegerValue::IntegerValue(ns3::IntegerValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IntegerValue const &', 'arg0')]) ## integer.h: ns3::IntegerValue::IntegerValue() [constructor] cls.add_constructor([]) ## integer.h: ns3::IntegerValue::IntegerValue(int64_t const & value) [constructor] @@ -1448,39 +1414,23 @@ def register_Ns3IntegerValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3LogNormalVariable_methods(root_module, cls): - ## random-variable.h: ns3::LogNormalVariable::LogNormalVariable(ns3::LogNormalVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::LogNormalVariable const &', 'arg0')]) ## random-variable.h: ns3::LogNormalVariable::LogNormalVariable(double mu, double sigma) [constructor] cls.add_constructor([param('double', 'mu'), param('double', 'sigma')]) - ## random-variable.h: static double ns3::LogNormalVariable::GetSingleValue(double mu, double sigma) [member function] - cls.add_method('GetSingleValue', - 'double', - [param('double', 'mu'), param('double', 'sigma')], - is_static=True) + cls.add_copy_constructor() return def register_Ns3NormalVariable_methods(root_module, cls): - ## random-variable.h: ns3::NormalVariable::NormalVariable(ns3::NormalVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::NormalVariable const &', 'arg0')]) + ## random-variable.h: ns3::NormalVariable::INFINITE_VALUE [variable] + cls.add_static_attribute('INFINITE_VALUE', 'double const', is_const=True) ## random-variable.h: ns3::NormalVariable::NormalVariable() [constructor] cls.add_constructor([]) - ## random-variable.h: ns3::NormalVariable::NormalVariable(double m, double v) [constructor] - cls.add_constructor([param('double', 'm'), param('double', 'v')]) - ## random-variable.h: ns3::NormalVariable::NormalVariable(double m, double v, double b) [constructor] - cls.add_constructor([param('double', 'm'), param('double', 'v'), param('double', 'b')]) - ## random-variable.h: static double ns3::NormalVariable::GetSingleValue(double m, double v) [member function] - cls.add_method('GetSingleValue', - 'double', - [param('double', 'm'), param('double', 'v')], - is_static=True) - ## random-variable.h: static double ns3::NormalVariable::GetSingleValue(double m, double v, double b) [member function] - cls.add_method('GetSingleValue', - 'double', - [param('double', 'm'), param('double', 'v'), param('double', 'b')], - is_static=True) + ## random-variable.h: ns3::NormalVariable::NormalVariable(double m, double v, double b=ns3::NormalVariable::INFINITE_VALUE) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 'v'), param('double', 'b', default_value='ns3::NormalVariable::INFINITE_VALUE')]) + cls.add_copy_constructor() return def register_Ns3Object_methods(root_module, cls): @@ -1525,8 +1475,6 @@ def register_Ns3Object_methods(root_module, cls): return def register_Ns3ObjectAggregateIterator_methods(root_module, cls): - ## object.h: ns3::Object::AggregateIterator::AggregateIterator(ns3::Object::AggregateIterator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Object::AggregateIterator const &', 'arg0')]) ## object.h: ns3::Object::AggregateIterator::AggregateIterator() [constructor] cls.add_constructor([]) ## object.h: bool ns3::Object::AggregateIterator::HasNext() const [member function] @@ -1538,18 +1486,15 @@ def register_Ns3ObjectAggregateIterator_methods(root_module, cls): cls.add_method('Next', 'ns3::Ptr< ns3::Object const >', []) + cls.add_copy_constructor() return def register_Ns3ObjectFactoryChecker_methods(root_module, cls): - ## object-factory.h: ns3::ObjectFactoryChecker::ObjectFactoryChecker(ns3::ObjectFactoryChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ObjectFactoryChecker const &', 'arg0')]) - ## object-factory.h: ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3ObjectFactoryValue_methods(root_module, cls): - ## object-factory.h: ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactoryValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ObjectFactoryValue const &', 'arg0')]) ## object-factory.h: ns3::ObjectFactoryValue::ObjectFactoryValue() [constructor] cls.add_constructor([]) ## object-factory.h: ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactory const & value) [constructor] @@ -1578,13 +1523,10 @@ def register_Ns3ObjectFactoryValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ObjectVectorAccessor_methods(root_module, cls): - ## object-vector.h: ns3::ObjectVectorAccessor::ObjectVectorAccessor(ns3::ObjectVectorAccessor const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ObjectVectorAccessor const &', 'arg0')]) - ## object-vector.h: ns3::ObjectVectorAccessor::ObjectVectorAccessor() [constructor] - cls.add_constructor([]) ## object-vector.h: bool ns3::ObjectVectorAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function] cls.add_method('Set', 'bool', @@ -1615,23 +1557,21 @@ def register_Ns3ObjectVectorAccessor_methods(root_module, cls): 'ns3::Ptr< ns3::Object >', [param('ns3::ObjectBase const *', 'object'), param('uint32_t', 'i')], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3ObjectVectorChecker_methods(root_module, cls): - ## object-vector.h: ns3::ObjectVectorChecker::ObjectVectorChecker(ns3::ObjectVectorChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ObjectVectorChecker const &', 'arg0')]) - ## object-vector.h: ns3::ObjectVectorChecker::ObjectVectorChecker() [constructor] - cls.add_constructor([]) ## object-vector.h: ns3::TypeId ns3::ObjectVectorChecker::GetItemTypeId() const [member function] cls.add_method('GetItemTypeId', 'ns3::TypeId', [], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3ObjectVectorValue_methods(root_module, cls): - ## object-vector.h: ns3::ObjectVectorValue::ObjectVectorValue(ns3::ObjectVectorValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ObjectVectorValue const &', 'arg0')]) ## object-vector.h: ns3::ObjectVectorValue::ObjectVectorValue() [constructor] cls.add_constructor([]) ## object-vector.h: __gnu_cxx::__normal_iterator*,std::vector, std::allocator > > > ns3::ObjectVectorValue::Begin() const [member function] @@ -1669,11 +1609,10 @@ def register_Ns3ObjectVectorValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ParetoVariable_methods(root_module, cls): - ## random-variable.h: ns3::ParetoVariable::ParetoVariable(ns3::ParetoVariable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ParetoVariable const &', 'arg0')]) ## random-variable.h: ns3::ParetoVariable::ParetoVariable() [constructor] cls.add_constructor([]) ## random-variable.h: ns3::ParetoVariable::ParetoVariable(double m) [constructor] @@ -1682,23 +1621,17 @@ def register_Ns3ParetoVariable_methods(root_module, cls): cls.add_constructor([param('double', 'm'), param('double', 's')]) ## random-variable.h: ns3::ParetoVariable::ParetoVariable(double m, double s, double b) [constructor] cls.add_constructor([param('double', 'm'), param('double', 's'), param('double', 'b')]) - ## random-variable.h: static double ns3::ParetoVariable::GetSingleValue(double m, double s, double b=0) [member function] - cls.add_method('GetSingleValue', - 'double', - [param('double', 'm'), param('double', 's'), param('double', 'b', default_value='0')], - is_static=True) + cls.add_copy_constructor() return def register_Ns3PointerChecker_methods(root_module, cls): - ## pointer.h: ns3::PointerChecker::PointerChecker(ns3::PointerChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PointerChecker const &', 'arg0')]) - ## pointer.h: ns3::PointerChecker::PointerChecker() [constructor] - cls.add_constructor([]) ## pointer.h: ns3::TypeId ns3::PointerChecker::GetPointeeTypeId() const [member function] cls.add_method('GetPointeeTypeId', 'ns3::TypeId', [], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3PointerValue_methods(root_module, cls): @@ -1735,15 +1668,11 @@ def register_Ns3PointerValue_methods(root_module, cls): return def register_Ns3RandomVariableChecker_methods(root_module, cls): - ## random-variable.h: ns3::RandomVariableChecker::RandomVariableChecker(ns3::RandomVariableChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RandomVariableChecker const &', 'arg0')]) - ## random-variable.h: ns3::RandomVariableChecker::RandomVariableChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3RandomVariableValue_methods(root_module, cls): - ## random-variable.h: ns3::RandomVariableValue::RandomVariableValue(ns3::RandomVariableValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RandomVariableValue const &', 'arg0')]) ## random-variable.h: ns3::RandomVariableValue::RandomVariableValue() [constructor] cls.add_constructor([]) ## random-variable.h: ns3::RandomVariableValue::RandomVariableValue(ns3::RandomVariable const & value) [constructor] @@ -1772,18 +1701,15 @@ def register_Ns3RandomVariableValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3StringChecker_methods(root_module, cls): - ## string.h: ns3::StringChecker::StringChecker(ns3::StringChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::StringChecker const &', 'arg0')]) - ## string.h: ns3::StringChecker::StringChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3StringValue_methods(root_module, cls): - ## string.h: ns3::StringValue::StringValue(ns3::StringValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::StringValue const &', 'arg0')]) ## string.h: ns3::StringValue::StringValue() [constructor] cls.add_constructor([]) ## string.h: ns3::StringValue::StringValue(std::string const & value) [constructor] @@ -1812,18 +1738,15 @@ def register_Ns3StringValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3TypeIdChecker_methods(root_module, cls): - ## type-id.h: ns3::TypeIdChecker::TypeIdChecker(ns3::TypeIdChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TypeIdChecker const &', 'arg0')]) - ## type-id.h: ns3::TypeIdChecker::TypeIdChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3TypeIdValue_methods(root_module, cls): - ## type-id.h: ns3::TypeIdValue::TypeIdValue(ns3::TypeIdValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TypeIdValue const &', 'arg0')]) ## type-id.h: ns3::TypeIdValue::TypeIdValue() [constructor] cls.add_constructor([]) ## type-id.h: ns3::TypeIdValue::TypeIdValue(ns3::TypeId const & value) [constructor] @@ -1852,11 +1775,10 @@ def register_Ns3TypeIdValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3UintegerValue_methods(root_module, cls): - ## uinteger.h: ns3::UintegerValue::UintegerValue(ns3::UintegerValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UintegerValue const &', 'arg0')]) ## uinteger.h: ns3::UintegerValue::UintegerValue() [constructor] cls.add_constructor([]) ## uinteger.h: ns3::UintegerValue::UintegerValue(uint64_t const & value) [constructor] @@ -1885,6 +1807,7 @@ def register_Ns3UintegerValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls): @@ -1930,8 +1853,6 @@ def register_Ns3TracedValue__Unsigned_int_methods(root_module, cls): return def register_Ns3ConfigMatchContainer_methods(root_module, cls): - ## config.h: ns3::Config::MatchContainer::MatchContainer(ns3::Config::MatchContainer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Config::MatchContainer const &', 'arg0')]) ## config.h: ns3::Config::MatchContainer::MatchContainer() [constructor] cls.add_constructor([]) ## config.h: ns3::Config::MatchContainer::MatchContainer(std::vector, std::allocator > > const & objects, std::vector > const & contexts, std::string path) [constructor] @@ -1986,6 +1907,7 @@ def register_Ns3ConfigMatchContainer_methods(root_module, cls): cls.add_method('DisconnectWithoutContext', 'void', [param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')]) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_csma.py b/bindings/python/ns3_module_csma.py index 17494ae9e..999e5abb1 100644 --- a/bindings/python/ns3_module_csma.py +++ b/bindings/python/ns3_module_csma.py @@ -74,8 +74,6 @@ def register_Ns3Backoff_methods(root_module, cls): cls.add_instance_attribute('m_maxRetries', 'uint32_t', is_const=False) ## backoff.h: ns3::Backoff::m_slotTime [variable] cls.add_instance_attribute('m_slotTime', 'ns3::Time', is_const=False) - ## backoff.h: ns3::Backoff::Backoff(ns3::Backoff const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Backoff const &', 'arg0')]) ## backoff.h: ns3::Backoff::Backoff() [constructor] cls.add_constructor([]) ## backoff.h: ns3::Backoff::Backoff(ns3::Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t ceiling, uint32_t maxRetries) [constructor] @@ -96,6 +94,7 @@ def register_Ns3Backoff_methods(root_module, cls): cls.add_method('IncrNumRetries', 'void', []) + cls.add_copy_constructor() return def register_Ns3CsmaDeviceRec_methods(root_module, cls): @@ -103,8 +102,6 @@ def register_Ns3CsmaDeviceRec_methods(root_module, cls): cls.add_instance_attribute('devicePtr', 'ns3::Ptr< ns3::CsmaNetDevice >', is_const=False) ## csma-channel.h: ns3::CsmaDeviceRec::active [variable] cls.add_instance_attribute('active', 'bool', is_const=False) - ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec(ns3::CsmaDeviceRec const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CsmaDeviceRec const &', 'arg0')]) ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec() [constructor] cls.add_constructor([]) ## csma-channel.h: ns3::CsmaDeviceRec::CsmaDeviceRec(ns3::Ptr device) [constructor] @@ -113,11 +110,10 @@ def register_Ns3CsmaDeviceRec_methods(root_module, cls): cls.add_method('IsActive', 'bool', []) + cls.add_copy_constructor() return def register_Ns3CsmaChannel_methods(root_module, cls): - ## csma-channel.h: ns3::CsmaChannel::CsmaChannel(ns3::CsmaChannel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CsmaChannel const &', 'arg0')]) ## csma-channel.h: static ns3::TypeId ns3::CsmaChannel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -202,6 +198,7 @@ def register_Ns3CsmaChannel_methods(root_module, cls): 'ns3::Time', [], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3CsmaNetDevice_methods(root_module, cls): diff --git a/bindings/python/ns3_module_emu.py b/bindings/python/ns3_module_emu.py index 54ffede89..68cc73906 100644 --- a/bindings/python/ns3_module_emu.py +++ b/bindings/python/ns3_module_emu.py @@ -51,8 +51,6 @@ def register_methods(root_module): return def register_Ns3EmuNetDevice_methods(root_module, cls): - ## emu-net-device.h: ns3::EmuNetDevice::EmuNetDevice(ns3::EmuNetDevice const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EmuNetDevice const &', 'arg0')]) ## emu-net-device.h: static ns3::TypeId ns3::EmuNetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -210,6 +208,7 @@ def register_Ns3EmuNetDevice_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_global_routing.py b/bindings/python/ns3_module_global_routing.py index c3e0386d5..749bb819b 100644 --- a/bindings/python/ns3_module_global_routing.py +++ b/bindings/python/ns3_module_global_routing.py @@ -205,8 +205,6 @@ def register_Ns3GlobalRoutingLSA_methods(root_module, cls): return def register_Ns3GlobalRoutingLinkRecord_methods(root_module, cls): - ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord(ns3::GlobalRoutingLinkRecord const & arg0) [copy constructor] - cls.add_constructor([param('ns3::GlobalRoutingLinkRecord const &', 'arg0')]) ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord() [constructor] cls.add_constructor([]) ## global-router-interface.h: ns3::GlobalRoutingLinkRecord::GlobalRoutingLinkRecord(ns3::GlobalRoutingLinkRecord::LinkType linkType, ns3::Ipv4Address linkId, ns3::Ipv4Address linkData, uint16_t metric) [constructor] @@ -247,6 +245,7 @@ def register_Ns3GlobalRoutingLinkRecord_methods(root_module, cls): cls.add_method('SetMetric', 'void', [param('uint16_t', 'metric')]) + cls.add_copy_constructor() return def register_Ns3GlobalRouter_methods(root_module, cls): diff --git a/bindings/python/ns3_module_helper.py b/bindings/python/ns3_module_helper.py index 8744186c1..efd11da9e 100644 --- a/bindings/python/ns3_module_helper.py +++ b/bindings/python/ns3_module_helper.py @@ -120,8 +120,6 @@ def register_methods(root_module): return def register_Ns3ApplicationContainer_methods(root_module, cls): - ## application-container.h: ns3::ApplicationContainer::ApplicationContainer(ns3::ApplicationContainer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ApplicationContainer const &', 'arg0')]) ## application-container.h: ns3::ApplicationContainer::ApplicationContainer() [constructor] cls.add_constructor([]) ## application-container.h: ns3::ApplicationContainer::ApplicationContainer(ns3::Ptr application) [constructor] @@ -162,11 +160,10 @@ def register_Ns3ApplicationContainer_methods(root_module, cls): cls.add_method('Stop', 'void', [param('ns3::Time', 'stop')]) + cls.add_copy_constructor() return def register_Ns3BridgeHelper_methods(root_module, cls): - ## bridge-helper.h: ns3::BridgeHelper::BridgeHelper(ns3::BridgeHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::BridgeHelper const &', 'arg0')]) ## bridge-helper.h: ns3::BridgeHelper::BridgeHelper() [constructor] cls.add_constructor([]) ## bridge-helper.h: void ns3::BridgeHelper::SetDeviceAttribute(std::string n1, ns3::AttributeValue const & v1) [member function] @@ -177,11 +174,10 @@ def register_Ns3BridgeHelper_methods(root_module, cls): cls.add_method('Install', 'ns3::NetDeviceContainer', [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::NetDeviceContainer', 'c')]) + cls.add_copy_constructor() return def register_Ns3CsmaHelper_methods(root_module, cls): - ## csma-helper.h: ns3::CsmaHelper::CsmaHelper(ns3::CsmaHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CsmaHelper const &', 'arg0')]) ## csma-helper.h: ns3::CsmaHelper::CsmaHelper() [constructor] cls.add_constructor([]) ## csma-helper.h: void ns3::CsmaHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] @@ -270,11 +266,10 @@ def register_Ns3CsmaHelper_methods(root_module, cls): cls.add_method('InstallStar', 'void', [param('ns3::Ptr< ns3::Node >', 'hub'), param('ns3::NodeContainer', 'spokes'), param('ns3::NetDeviceContainer &', 'hubDevices'), param('ns3::NetDeviceContainer &', 'spokeDevices')]) + cls.add_copy_constructor() return def register_Ns3EmuHelper_methods(root_module, cls): - ## emu-helper.h: ns3::EmuHelper::EmuHelper(ns3::EmuHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EmuHelper const &', 'arg0')]) ## emu-helper.h: ns3::EmuHelper::EmuHelper() [constructor] cls.add_constructor([]) ## emu-helper.h: void ns3::EmuHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] @@ -335,11 +330,10 @@ def register_Ns3EmuHelper_methods(root_module, cls): 'ns3::NetDeviceContainer', [param('ns3::NodeContainer const &', 'c')], is_const=True) + cls.add_copy_constructor() return def register_Ns3InternetStackHelper_methods(root_module, cls): - ## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper(ns3::InternetStackHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::InternetStackHelper const &', 'arg0')]) ## internet-stack-helper.h: ns3::InternetStackHelper::InternetStackHelper() [constructor] cls.add_constructor([]) ## internet-stack-helper.h: void ns3::InternetStackHelper::Install(ns3::Ptr node) const [member function] @@ -371,11 +365,10 @@ def register_Ns3InternetStackHelper_methods(root_module, cls): 'void', [param('std::string', 'filename')], is_static=True) + cls.add_copy_constructor() return def register_Ns3Ipv4AddressHelper_methods(root_module, cls): - ## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper(ns3::Ipv4AddressHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4AddressHelper const &', 'arg0')]) ## ipv4-address-helper.h: ns3::Ipv4AddressHelper::Ipv4AddressHelper() [constructor] cls.add_constructor([]) ## ipv4-address-helper.h: void ns3::Ipv4AddressHelper::SetBase(ns3::Ipv4Address network, ns3::Ipv4Mask mask, ns3::Ipv4Address base="0.0.0.1") [member function] @@ -394,11 +387,10 @@ def register_Ns3Ipv4AddressHelper_methods(root_module, cls): cls.add_method('Assign', 'ns3::Ipv4InterfaceContainer', [param('ns3::NetDeviceContainer const &', 'c')]) + cls.add_copy_constructor() return def register_Ns3Ipv4InterfaceContainer_methods(root_module, cls): - ## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer::Ipv4InterfaceContainer(ns3::Ipv4InterfaceContainer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4InterfaceContainer const &', 'arg0')]) ## ipv4-interface-container.h: ns3::Ipv4InterfaceContainer::Ipv4InterfaceContainer() [constructor] cls.add_constructor([]) ## ipv4-interface-container.h: void ns3::Ipv4InterfaceContainer::Add(ns3::Ipv4InterfaceContainer other) [member function] @@ -423,11 +415,10 @@ def register_Ns3Ipv4InterfaceContainer_methods(root_module, cls): cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::Ipv4 >', 'ipv4'), param('uint32_t', 'interface')]) + cls.add_copy_constructor() return def register_Ns3MobilityHelper_methods(root_module, cls): - ## mobility-helper.h: ns3::MobilityHelper::MobilityHelper(ns3::MobilityHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::MobilityHelper const &', 'arg0')]) ## mobility-helper.h: ns3::MobilityHelper::MobilityHelper() [constructor] cls.add_constructor([]) ## mobility-helper.h: void ns3::MobilityHelper::SetPositionAllocator(ns3::Ptr allocator) [member function] @@ -484,11 +475,10 @@ def register_Ns3MobilityHelper_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_static=True) + cls.add_copy_constructor() return def register_Ns3NetDeviceContainer_methods(root_module, cls): - ## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::NetDeviceContainer const &', 'arg0')]) ## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer() [constructor] cls.add_constructor([]) ## net-device-container.h: ns3::NetDeviceContainer::NetDeviceContainer(ns3::Ptr dev) [constructor] @@ -523,11 +513,10 @@ def register_Ns3NetDeviceContainer_methods(root_module, cls): cls.add_method('Add', 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device')]) + cls.add_copy_constructor() return def register_Ns3NodeContainer_methods(root_module, cls): - ## node-container.h: ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::NodeContainer const &', 'arg0')]) ## node-container.h: ns3::NodeContainer::NodeContainer() [constructor] cls.add_constructor([]) ## node-container.h: ns3::NodeContainer::NodeContainer(ns3::Ptr node) [constructor] @@ -577,11 +566,10 @@ def register_Ns3NodeContainer_methods(root_module, cls): 'ns3::NodeContainer', [], is_static=True) + cls.add_copy_constructor() return def register_Ns3Ns2MobilityHelper_methods(root_module, cls): - ## ns2-mobility-helper.h: ns3::Ns2MobilityHelper::Ns2MobilityHelper(ns3::Ns2MobilityHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ns2MobilityHelper const &', 'arg0')]) ## ns2-mobility-helper.h: ns3::Ns2MobilityHelper::Ns2MobilityHelper(std::string filename) [constructor] cls.add_constructor([param('std::string', 'filename')]) ## ns2-mobility-helper.h: void ns3::Ns2MobilityHelper::Install() const [member function] @@ -589,11 +577,10 @@ def register_Ns3Ns2MobilityHelper_methods(root_module, cls): 'void', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3OlsrHelper_methods(root_module, cls): - ## olsr-helper.h: ns3::OlsrHelper::OlsrHelper(ns3::OlsrHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::OlsrHelper const &', 'arg0')]) ## olsr-helper.h: ns3::OlsrHelper::OlsrHelper() [constructor] cls.add_constructor([]) ## olsr-helper.h: void ns3::OlsrHelper::SetAgent(std::string tid, std::string n0="", ns3::AttributeValue const & v0=ns3::EmptyAttributeValue(), std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue(), std::string n5="", ns3::AttributeValue const & v5=ns3::EmptyAttributeValue(), std::string n6="", ns3::AttributeValue const & v6=ns3::EmptyAttributeValue(), std::string n7="", ns3::AttributeValue const & v7=ns3::EmptyAttributeValue()) [member function] @@ -612,11 +599,10 @@ def register_Ns3OlsrHelper_methods(root_module, cls): cls.add_method('InstallAll', 'void', []) + cls.add_copy_constructor() return def register_Ns3OnOffHelper_methods(root_module, cls): - ## on-off-helper.h: ns3::OnOffHelper::OnOffHelper(ns3::OnOffHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::OnOffHelper const &', 'arg0')]) ## on-off-helper.h: ns3::OnOffHelper::OnOffHelper(std::string protocol, ns3::Address address) [constructor] cls.add_constructor([param('std::string', 'protocol'), param('ns3::Address', 'address')]) ## on-off-helper.h: void ns3::OnOffHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] @@ -633,11 +619,10 @@ def register_Ns3OnOffHelper_methods(root_module, cls): 'ns3::ApplicationContainer', [param('ns3::Ptr< ns3::Node >', 'node')], is_const=True) + cls.add_copy_constructor() return def register_Ns3PacketSinkHelper_methods(root_module, cls): - ## packet-sink-helper.h: ns3::PacketSinkHelper::PacketSinkHelper(ns3::PacketSinkHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketSinkHelper const &', 'arg0')]) ## packet-sink-helper.h: ns3::PacketSinkHelper::PacketSinkHelper(std::string protocol, ns3::Address address) [constructor] cls.add_constructor([param('std::string', 'protocol'), param('ns3::Address', 'address')]) ## packet-sink-helper.h: void ns3::PacketSinkHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] @@ -654,13 +639,10 @@ def register_Ns3PacketSinkHelper_methods(root_module, cls): 'ns3::ApplicationContainer', [param('ns3::Ptr< ns3::Node >', 'node')], is_const=True) + cls.add_copy_constructor() return def register_Ns3PacketSocketHelper_methods(root_module, cls): - ## packet-socket-helper.h: ns3::PacketSocketHelper::PacketSocketHelper(ns3::PacketSocketHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketSocketHelper const &', 'arg0')]) - ## packet-socket-helper.h: ns3::PacketSocketHelper::PacketSocketHelper() [constructor] - cls.add_constructor([]) ## packet-socket-helper.h: void ns3::PacketSocketHelper::Install(ns3::Ptr node) const [member function] cls.add_method('Install', 'void', @@ -671,11 +653,11 @@ def register_Ns3PacketSocketHelper_methods(root_module, cls): 'void', [param('ns3::NodeContainer', 'c')], is_const=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3PointToPointHelper_methods(root_module, cls): - ## point-to-point-helper.h: ns3::PointToPointHelper::PointToPointHelper(ns3::PointToPointHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PointToPointHelper const &', 'arg0')]) ## point-to-point-helper.h: ns3::PointToPointHelper::PointToPointHelper() [constructor] cls.add_constructor([]) ## point-to-point-helper.h: void ns3::PointToPointHelper::SetQueue(std::string type, std::string n1="", ns3::AttributeValue const & v1=ns3::EmptyAttributeValue(), std::string n2="", ns3::AttributeValue const & v2=ns3::EmptyAttributeValue(), std::string n3="", ns3::AttributeValue const & v3=ns3::EmptyAttributeValue(), std::string n4="", ns3::AttributeValue const & v4=ns3::EmptyAttributeValue()) [member function] @@ -752,11 +734,10 @@ def register_Ns3PointToPointHelper_methods(root_module, cls): cls.add_method('InstallStar', 'void', [param('ns3::Ptr< ns3::Node >', 'hub'), param('ns3::NodeContainer', 'spokes'), param('ns3::NetDeviceContainer &', 'hubDevices'), param('ns3::NetDeviceContainer &', 'spokeDevices')]) + cls.add_copy_constructor() return def register_Ns3StaticMulticastRouteHelper_methods(root_module, cls): - ## static-multicast-route-helper.h: ns3::StaticMulticastRouteHelper::StaticMulticastRouteHelper(ns3::StaticMulticastRouteHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::StaticMulticastRouteHelper const &', 'arg0')]) ## static-multicast-route-helper.h: ns3::StaticMulticastRouteHelper::StaticMulticastRouteHelper() [constructor] cls.add_constructor([]) ## static-multicast-route-helper.h: void ns3::StaticMulticastRouteHelper::AddMulticastRoute(ns3::Ptr arg0, ns3::Ipv4Address source, ns3::Ipv4Address group, ns3::Ptr input, ns3::NetDeviceContainer output) [member function] @@ -771,11 +752,10 @@ def register_Ns3StaticMulticastRouteHelper_methods(root_module, cls): cls.add_method('JoinMulticastGroup', 'void', [param('ns3::Ptr< ns3::Node >', 'n'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'group')]) + cls.add_copy_constructor() return def register_Ns3UdpEchoClientHelper_methods(root_module, cls): - ## udp-echo-helper.h: ns3::UdpEchoClientHelper::UdpEchoClientHelper(ns3::UdpEchoClientHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UdpEchoClientHelper const &', 'arg0')]) ## udp-echo-helper.h: ns3::UdpEchoClientHelper::UdpEchoClientHelper(ns3::Ipv4Address ip, uint16_t port) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ip'), param('uint16_t', 'port')]) ## udp-echo-helper.h: void ns3::UdpEchoClientHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] @@ -792,11 +772,10 @@ def register_Ns3UdpEchoClientHelper_methods(root_module, cls): 'ns3::ApplicationContainer', [param('ns3::NodeContainer', 'c')], is_const=True) + cls.add_copy_constructor() return def register_Ns3UdpEchoServerHelper_methods(root_module, cls): - ## udp-echo-helper.h: ns3::UdpEchoServerHelper::UdpEchoServerHelper(ns3::UdpEchoServerHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UdpEchoServerHelper const &', 'arg0')]) ## udp-echo-helper.h: ns3::UdpEchoServerHelper::UdpEchoServerHelper(uint16_t port) [constructor] cls.add_constructor([param('uint16_t', 'port')]) ## udp-echo-helper.h: void ns3::UdpEchoServerHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] @@ -813,11 +792,10 @@ def register_Ns3UdpEchoServerHelper_methods(root_module, cls): 'ns3::ApplicationContainer', [param('ns3::NodeContainer', 'c')], is_const=True) + cls.add_copy_constructor() return def register_Ns3V4PingHelper_methods(root_module, cls): - ## v4ping-helper.h: ns3::V4PingHelper::V4PingHelper(ns3::V4PingHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::V4PingHelper const &', 'arg0')]) ## v4ping-helper.h: ns3::V4PingHelper::V4PingHelper(ns3::Ipv4Address remote) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'remote')]) ## v4ping-helper.h: void ns3::V4PingHelper::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function] @@ -834,11 +812,10 @@ def register_Ns3V4PingHelper_methods(root_module, cls): 'ns3::ApplicationContainer', [param('ns3::Ptr< ns3::Node >', 'node')], is_const=True) + cls.add_copy_constructor() return def register_Ns3WifiHelper_methods(root_module, cls): - ## wifi-helper.h: ns3::WifiHelper::WifiHelper(ns3::WifiHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiHelper const &', 'arg0')]) ## wifi-helper.h: ns3::WifiHelper::WifiHelper() [constructor] cls.add_constructor([]) ## wifi-helper.h: static ns3::WifiHelper ns3::WifiHelper::Default() [member function] @@ -864,23 +841,20 @@ def register_Ns3WifiHelper_methods(root_module, cls): 'ns3::NetDeviceContainer', [param('ns3::WifiPhyHelper const &', 'phy'), param('ns3::Ptr< ns3::Node >', 'node')], is_const=True) + cls.add_copy_constructor() return def register_Ns3WifiPhyHelper_methods(root_module, cls): - ## wifi-helper.h: ns3::WifiPhyHelper::WifiPhyHelper(ns3::WifiPhyHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiPhyHelper const &', 'arg0')]) - ## wifi-helper.h: ns3::WifiPhyHelper::WifiPhyHelper() [constructor] - cls.add_constructor([]) ## wifi-helper.h: ns3::Ptr ns3::WifiPhyHelper::Create(ns3::Ptr node, ns3::Ptr device) const [member function] cls.add_method('Create', 'ns3::Ptr< ns3::WifiPhy >', [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::WifiNetDevice >', 'device')], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3YansWifiChannelHelper_methods(root_module, cls): - ## yans-wifi-helper.h: ns3::YansWifiChannelHelper::YansWifiChannelHelper(ns3::YansWifiChannelHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::YansWifiChannelHelper const &', 'arg0')]) ## yans-wifi-helper.h: ns3::YansWifiChannelHelper::YansWifiChannelHelper() [constructor] cls.add_constructor([]) ## yans-wifi-helper.h: static ns3::YansWifiChannelHelper ns3::YansWifiChannelHelper::Default() [member function] @@ -901,11 +875,10 @@ def register_Ns3YansWifiChannelHelper_methods(root_module, cls): 'ns3::Ptr< ns3::YansWifiChannel >', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3YansWifiPhyHelper_methods(root_module, cls): - ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::YansWifiPhyHelper(ns3::YansWifiPhyHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::YansWifiPhyHelper const &', 'arg0')]) ## yans-wifi-helper.h: ns3::YansWifiPhyHelper::YansWifiPhyHelper() [constructor] cls.add_constructor([]) ## yans-wifi-helper.h: static ns3::YansWifiPhyHelper ns3::YansWifiPhyHelper::Default() [member function] @@ -970,6 +943,7 @@ def register_Ns3YansWifiPhyHelper_methods(root_module, cls): 'ns3::Ptr< ns3::WifiPhy >', [param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::WifiNetDevice >', 'device')], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_internet_stack.py b/bindings/python/ns3_module_internet_stack.py index 64c968ed4..20e906e82 100644 --- a/bindings/python/ns3_module_internet_stack.py +++ b/bindings/python/ns3_module_internet_stack.py @@ -86,8 +86,6 @@ def register_methods(root_module): return def register_Ns3Icmpv4DestinationUnreachable_methods(root_module, cls): - ## icmpv4.h: ns3::Icmpv4DestinationUnreachable::Icmpv4DestinationUnreachable(ns3::Icmpv4DestinationUnreachable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Icmpv4DestinationUnreachable const &', 'arg0')]) ## icmpv4.h: static ns3::TypeId ns3::Icmpv4DestinationUnreachable::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -147,11 +145,10 @@ def register_Ns3Icmpv4DestinationUnreachable_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Icmpv4Echo_methods(root_module, cls): - ## icmpv4.h: ns3::Icmpv4Echo::Icmpv4Echo(ns3::Icmpv4Echo const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Icmpv4Echo const &', 'arg0')]) ## icmpv4.h: void ns3::Icmpv4Echo::SetIdentifier(uint16_t id) [member function] cls.add_method('SetIdentifier', 'void', @@ -211,11 +208,10 @@ def register_Ns3Icmpv4Echo_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Icmpv4Header_methods(root_module, cls): - ## icmpv4.h: ns3::Icmpv4Header::Icmpv4Header(ns3::Icmpv4Header const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Icmpv4Header const &', 'arg0')]) ## icmpv4.h: void ns3::Icmpv4Header::EnableChecksum() [member function] cls.add_method('EnableChecksum', 'void', @@ -270,11 +266,10 @@ def register_Ns3Icmpv4Header_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Icmpv4TimeExceeded_methods(root_module, cls): - ## icmpv4.h: ns3::Icmpv4TimeExceeded::Icmpv4TimeExceeded(ns3::Icmpv4TimeExceeded const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Icmpv4TimeExceeded const &', 'arg0')]) ## icmpv4.h: void ns3::Icmpv4TimeExceeded::SetData(ns3::Ptr data) [member function] cls.add_method('SetData', 'void', @@ -325,11 +320,10 @@ def register_Ns3Icmpv4TimeExceeded_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3TcpHeader_methods(root_module, cls): - ## tcp-header.h: ns3::TcpHeader::TcpHeader(ns3::TcpHeader const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TcpHeader const &', 'arg0')]) ## tcp-header.h: ns3::TcpHeader::TcpHeader() [constructor] cls.add_constructor([]) ## tcp-header.h: void ns3::TcpHeader::EnableChecksums() [member function] @@ -447,11 +441,10 @@ def register_Ns3TcpHeader_methods(root_module, cls): 'bool', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3UdpHeader_methods(root_module, cls): - ## udp-header.h: ns3::UdpHeader::UdpHeader(ns3::UdpHeader const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UdpHeader const &', 'arg0')]) ## udp-header.h: ns3::UdpHeader::UdpHeader() [constructor] cls.add_constructor([]) ## udp-header.h: void ns3::UdpHeader::EnableChecksums() [member function] @@ -515,11 +508,10 @@ def register_Ns3UdpHeader_methods(root_module, cls): 'bool', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3Ipv4Interface_methods(root_module, cls): - ## ipv4-interface.h: ns3::Ipv4Interface::Ipv4Interface(ns3::Ipv4Interface const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4Interface const &', 'arg0')]) ## ipv4-interface.h: static ns3::TypeId ns3::Ipv4Interface::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -601,6 +593,7 @@ def register_Ns3Ipv4Interface_methods(root_module, cls): 'void', [param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Address', 'dest')], is_pure_virtual=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv4L3Protocol_methods(root_module, cls): @@ -815,8 +808,6 @@ def register_Ns3Ipv4L3Protocol_methods(root_module, cls): return def register_Ns3Ipv4StaticRouting_methods(root_module, cls): - ## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting(ns3::Ipv4StaticRouting const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4StaticRouting const &', 'arg0')]) ## ipv4-static-routing.h: ns3::Ipv4StaticRouting::Ipv4StaticRouting() [constructor] cls.add_constructor([]) ## ipv4-static-routing.h: bool ns3::Ipv4StaticRouting::RequestRoute(uint32_t ifIndex, ns3::Ipv4Header const & ipHeader, ns3::Ptr packet, ns3::Callback,const ns3::Ipv4Header&,ns3::empty,ns3::empty,ns3::empty,ns3::empty,ns3::empty> routeReply) [member function] @@ -901,11 +892,10 @@ def register_Ns3Ipv4StaticRouting_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv4GlobalRouting_methods(root_module, cls): - ## ipv4-global-routing.h: ns3::Ipv4GlobalRouting::Ipv4GlobalRouting(ns3::Ipv4GlobalRouting const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4GlobalRouting const &', 'arg0')]) ## ipv4-global-routing.h: static ns3::TypeId ns3::Ipv4GlobalRouting::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -956,6 +946,7 @@ def register_Ns3Ipv4GlobalRouting_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_mobility.py b/bindings/python/ns3_module_mobility.py index 48a316457..659d5c1b0 100644 --- a/bindings/python/ns3_module_mobility.py +++ b/bindings/python/ns3_module_mobility.py @@ -144,8 +144,6 @@ def register_Ns3Rectangle_methods(root_module, cls): return def register_Ns3StaticSpeedHelper_methods(root_module, cls): - ## static-speed-helper.h: ns3::StaticSpeedHelper::StaticSpeedHelper(ns3::StaticSpeedHelper const & arg0) [copy constructor] - cls.add_constructor([param('ns3::StaticSpeedHelper const &', 'arg0')]) ## static-speed-helper.h: ns3::StaticSpeedHelper::StaticSpeedHelper() [constructor] cls.add_constructor([]) ## static-speed-helper.h: ns3::StaticSpeedHelper::StaticSpeedHelper(ns3::Vector const & position) [constructor] @@ -188,6 +186,7 @@ def register_Ns3StaticSpeedHelper_methods(root_module, cls): 'void', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3Vector_methods(root_module, cls): @@ -207,8 +206,6 @@ def register_Ns3Vector_methods(root_module, cls): return def register_Ns3PositionAllocator_methods(root_module, cls): - ## position-allocator.h: ns3::PositionAllocator::PositionAllocator(ns3::PositionAllocator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PositionAllocator const &', 'arg0')]) ## position-allocator.h: static ns3::TypeId ns3::PositionAllocator::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -221,11 +218,10 @@ def register_Ns3PositionAllocator_methods(root_module, cls): 'ns3::Vector', [], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RandomDiscPositionAllocator_methods(root_module, cls): - ## position-allocator.h: ns3::RandomDiscPositionAllocator::RandomDiscPositionAllocator(ns3::RandomDiscPositionAllocator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RandomDiscPositionAllocator const &', 'arg0')]) ## position-allocator.h: static ns3::TypeId ns3::RandomDiscPositionAllocator::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -254,11 +250,10 @@ def register_Ns3RandomDiscPositionAllocator_methods(root_module, cls): 'ns3::Vector', [], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RandomRectanglePositionAllocator_methods(root_module, cls): - ## position-allocator.h: ns3::RandomRectanglePositionAllocator::RandomRectanglePositionAllocator(ns3::RandomRectanglePositionAllocator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RandomRectanglePositionAllocator const &', 'arg0')]) ## position-allocator.h: static ns3::TypeId ns3::RandomRectanglePositionAllocator::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -279,18 +274,15 @@ def register_Ns3RandomRectanglePositionAllocator_methods(root_module, cls): 'ns3::Vector', [], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RectangleChecker_methods(root_module, cls): - ## rectangle.h: ns3::RectangleChecker::RectangleChecker(ns3::RectangleChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RectangleChecker const &', 'arg0')]) - ## rectangle.h: ns3::RectangleChecker::RectangleChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3RectangleValue_methods(root_module, cls): - ## rectangle.h: ns3::RectangleValue::RectangleValue(ns3::RectangleValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RectangleValue const &', 'arg0')]) ## rectangle.h: ns3::RectangleValue::RectangleValue() [constructor] cls.add_constructor([]) ## rectangle.h: ns3::RectangleValue::RectangleValue(ns3::Rectangle const & value) [constructor] @@ -319,18 +311,15 @@ def register_Ns3RectangleValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3VectorChecker_methods(root_module, cls): - ## vector.h: ns3::VectorChecker::VectorChecker(ns3::VectorChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::VectorChecker const &', 'arg0')]) - ## vector.h: ns3::VectorChecker::VectorChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3VectorValue_methods(root_module, cls): - ## vector.h: ns3::VectorValue::VectorValue(ns3::VectorValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::VectorValue const &', 'arg0')]) ## vector.h: ns3::VectorValue::VectorValue() [constructor] cls.add_constructor([]) ## vector.h: ns3::VectorValue::VectorValue(ns3::Vector const & value) [constructor] @@ -359,11 +348,10 @@ def register_Ns3VectorValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3GridPositionAllocator_methods(root_module, cls): - ## position-allocator.h: ns3::GridPositionAllocator::GridPositionAllocator(ns3::GridPositionAllocator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::GridPositionAllocator const &', 'arg0')]) ## position-allocator.h: static ns3::TypeId ns3::GridPositionAllocator::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -430,11 +418,10 @@ def register_Ns3GridPositionAllocator_methods(root_module, cls): 'ns3::Vector', [], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ListPositionAllocator_methods(root_module, cls): - ## position-allocator.h: ns3::ListPositionAllocator::ListPositionAllocator(ns3::ListPositionAllocator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ListPositionAllocator const &', 'arg0')]) ## position-allocator.h: static ns3::TypeId ns3::ListPositionAllocator::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -451,11 +438,10 @@ def register_Ns3ListPositionAllocator_methods(root_module, cls): 'ns3::Vector', [], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3MobilityModel_methods(root_module, cls): - ## mobility-model.h: ns3::MobilityModel::MobilityModel(ns3::MobilityModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::MobilityModel const &', 'arg0')]) ## mobility-model.h: static ns3::TypeId ns3::MobilityModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -502,11 +488,10 @@ def register_Ns3MobilityModel_methods(root_module, cls): 'ns3::Vector', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RandomDirection2dMobilityModel_methods(root_module, cls): - ## random-direction-2d-mobility-model.h: ns3::RandomDirection2dMobilityModel::RandomDirection2dMobilityModel(ns3::RandomDirection2dMobilityModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RandomDirection2dMobilityModel const &', 'arg0')]) ## random-direction-2d-mobility-model.h: static ns3::TypeId ns3::RandomDirection2dMobilityModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -534,11 +519,10 @@ def register_Ns3RandomDirection2dMobilityModel_methods(root_module, cls): 'ns3::Vector', [], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RandomWalk2dMobilityModel_methods(root_module, cls): - ## random-walk-2d-mobility-model.h: ns3::RandomWalk2dMobilityModel::RandomWalk2dMobilityModel(ns3::RandomWalk2dMobilityModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RandomWalk2dMobilityModel const &', 'arg0')]) ## random-walk-2d-mobility-model.h: static ns3::TypeId ns3::RandomWalk2dMobilityModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -566,11 +550,10 @@ def register_Ns3RandomWalk2dMobilityModel_methods(root_module, cls): 'ns3::Vector', [], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RandomWaypointMobilityModel_methods(root_module, cls): - ## random-waypoint-mobility-model.h: ns3::RandomWaypointMobilityModel::RandomWaypointMobilityModel(ns3::RandomWaypointMobilityModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RandomWaypointMobilityModel const &', 'arg0')]) ## random-waypoint-mobility-model.h: static ns3::TypeId ns3::RandomWaypointMobilityModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -593,11 +576,10 @@ def register_Ns3RandomWaypointMobilityModel_methods(root_module, cls): 'ns3::Vector', [], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3StaticMobilityModel_methods(root_module, cls): - ## static-mobility-model.h: ns3::StaticMobilityModel::StaticMobilityModel(ns3::StaticMobilityModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::StaticMobilityModel const &', 'arg0')]) ## static-mobility-model.h: static ns3::TypeId ns3::StaticMobilityModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -620,11 +602,10 @@ def register_Ns3StaticMobilityModel_methods(root_module, cls): 'ns3::Vector', [], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3StaticSpeedMobilityModel_methods(root_module, cls): - ## static-speed-mobility-model.h: ns3::StaticSpeedMobilityModel::StaticSpeedMobilityModel(ns3::StaticSpeedMobilityModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::StaticSpeedMobilityModel const &', 'arg0')]) ## static-speed-mobility-model.h: static ns3::TypeId ns3::StaticSpeedMobilityModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -651,11 +632,10 @@ def register_Ns3StaticSpeedMobilityModel_methods(root_module, cls): 'ns3::Vector', [], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3HierarchicalMobilityModel_methods(root_module, cls): - ## hierarchical-mobility-model.h: ns3::HierarchicalMobilityModel::HierarchicalMobilityModel(ns3::HierarchicalMobilityModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::HierarchicalMobilityModel const &', 'arg0')]) ## hierarchical-mobility-model.h: static ns3::TypeId ns3::HierarchicalMobilityModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -688,6 +668,7 @@ def register_Ns3HierarchicalMobilityModel_methods(root_module, cls): 'ns3::Vector', [], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_node.py b/bindings/python/ns3_module_node.py index 2e50f5842..01cda78d6 100644 --- a/bindings/python/ns3_module_node.py +++ b/bindings/python/ns3_module_node.py @@ -299,8 +299,6 @@ def register_Ns3Address_methods(root_module, cls): return def register_Ns3Inet6SocketAddress_methods(root_module, cls): - ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Inet6SocketAddress const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Inet6SocketAddress const &', 'arg0')]) ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6, uint16_t port) [constructor] cls.add_constructor([param('ns3::Ipv6Address', 'ipv6'), param('uint16_t', 'port')]) ## inet6-socket-address.h: ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6) [constructor] @@ -339,11 +337,10 @@ def register_Ns3Inet6SocketAddress_methods(root_module, cls): 'ns3::Inet6SocketAddress', [param('ns3::Address const &', 'addr')], is_static=True) + cls.add_copy_constructor() return def register_Ns3InetSocketAddress_methods(root_module, cls): - ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(ns3::InetSocketAddress const & arg0) [copy constructor] - cls.add_constructor([param('ns3::InetSocketAddress const &', 'arg0')]) ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4, uint16_t port) [constructor] cls.add_constructor([param('ns3::Ipv4Address', 'ipv4'), param('uint16_t', 'port')]) ## inet-socket-address.h: ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4) [constructor] @@ -382,6 +379,7 @@ def register_Ns3InetSocketAddress_methods(root_module, cls): 'ns3::InetSocketAddress', [param('ns3::Address const &', 'address')], is_static=True) + cls.add_copy_constructor() return def register_Ns3Ipv4Address_methods(root_module, cls): @@ -488,10 +486,6 @@ def register_Ns3Ipv4Address_methods(root_module, cls): return def register_Ns3Ipv4AddressGenerator_methods(root_module, cls): - ## ipv4-address-generator.h: ns3::Ipv4AddressGenerator::Ipv4AddressGenerator(ns3::Ipv4AddressGenerator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4AddressGenerator const &', 'arg0')]) - ## ipv4-address-generator.h: ns3::Ipv4AddressGenerator::Ipv4AddressGenerator() [constructor] - cls.add_constructor([]) ## ipv4-address-generator.h: static void ns3::Ipv4AddressGenerator::Init(ns3::Ipv4Address const net, ns3::Ipv4Mask const mask, ns3::Ipv4Address const addr="0.0.0.1") [member function] cls.add_method('Init', 'void', @@ -537,6 +531,8 @@ def register_Ns3Ipv4AddressGenerator_methods(root_module, cls): 'void', [], is_static=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Ipv4Mask_methods(root_module, cls): @@ -1033,10 +1029,6 @@ def register_Ns3Mac64Address_methods(root_module, cls): return def register_Ns3NodeList_methods(root_module, cls): - ## node-list.h: ns3::NodeList::NodeList(ns3::NodeList const & arg0) [copy constructor] - cls.add_constructor([param('ns3::NodeList const &', 'arg0')]) - ## node-list.h: ns3::NodeList::NodeList() [constructor] - cls.add_constructor([]) ## node-list.h: static uint32_t ns3::NodeList::Add(ns3::Ptr node) [member function] cls.add_method('Add', 'uint32_t', @@ -1062,11 +1054,11 @@ def register_Ns3NodeList_methods(root_module, cls): 'uint32_t', [], is_static=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3PacketSocketAddress_methods(root_module, cls): - ## packet-socket-address.h: ns3::PacketSocketAddress::PacketSocketAddress(ns3::PacketSocketAddress const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketSocketAddress const &', 'arg0')]) ## packet-socket-address.h: ns3::PacketSocketAddress::PacketSocketAddress() [constructor] cls.add_constructor([]) ## packet-socket-address.h: void ns3::PacketSocketAddress::SetProtocol(uint16_t protocol) [member function] @@ -1115,18 +1107,15 @@ def register_Ns3PacketSocketAddress_methods(root_module, cls): 'bool', [param('ns3::Address const &', 'address')], is_static=True) + cls.add_copy_constructor() return def register_Ns3Ipv4AddressChecker_methods(root_module, cls): - ## ipv4-address.h: ns3::Ipv4AddressChecker::Ipv4AddressChecker(ns3::Ipv4AddressChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4AddressChecker const &', 'arg0')]) - ## ipv4-address.h: ns3::Ipv4AddressChecker::Ipv4AddressChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Ipv4AddressValue_methods(root_module, cls): - ## ipv4-address.h: ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4AddressValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4AddressValue const &', 'arg0')]) ## ipv4-address.h: ns3::Ipv4AddressValue::Ipv4AddressValue() [constructor] cls.add_constructor([]) ## ipv4-address.h: ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4Address const & value) [constructor] @@ -1155,11 +1144,10 @@ def register_Ns3Ipv4AddressValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv4Header_methods(root_module, cls): - ## ipv4-header.h: ns3::Ipv4Header::Ipv4Header(ns3::Ipv4Header const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4Header const &', 'arg0')]) ## ipv4-header.h: ns3::Ipv4Header::Ipv4Header() [constructor] cls.add_constructor([]) ## ipv4-header.h: void ns3::Ipv4Header::EnableChecksum() [member function] @@ -1299,18 +1287,15 @@ def register_Ns3Ipv4Header_methods(root_module, cls): 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv4MaskChecker_methods(root_module, cls): - ## ipv4-address.h: ns3::Ipv4MaskChecker::Ipv4MaskChecker(ns3::Ipv4MaskChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4MaskChecker const &', 'arg0')]) - ## ipv4-address.h: ns3::Ipv4MaskChecker::Ipv4MaskChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Ipv4MaskValue_methods(root_module, cls): - ## ipv4-address.h: ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4MaskValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4MaskValue const &', 'arg0')]) ## ipv4-address.h: ns3::Ipv4MaskValue::Ipv4MaskValue() [constructor] cls.add_constructor([]) ## ipv4-address.h: ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4Mask const & value) [constructor] @@ -1339,18 +1324,15 @@ def register_Ns3Ipv4MaskValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv6AddressChecker_methods(root_module, cls): - ## ipv6-address.h: ns3::Ipv6AddressChecker::Ipv6AddressChecker(ns3::Ipv6AddressChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv6AddressChecker const &', 'arg0')]) - ## ipv6-address.h: ns3::Ipv6AddressChecker::Ipv6AddressChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Ipv6AddressValue_methods(root_module, cls): - ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6AddressValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv6AddressValue const &', 'arg0')]) ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue() [constructor] cls.add_constructor([]) ## ipv6-address.h: ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6Address const & value) [constructor] @@ -1379,11 +1361,10 @@ def register_Ns3Ipv6AddressValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv6Header_methods(root_module, cls): - ## ipv6-header.h: ns3::Ipv6Header::Ipv6Header(ns3::Ipv6Header const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv6Header const &', 'arg0')]) ## ipv6-header.h: static ns3::TypeId ns3::Ipv6Header::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1479,18 +1460,15 @@ def register_Ns3Ipv6Header_methods(root_module, cls): 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv6PrefixChecker_methods(root_module, cls): - ## ipv6-address.h: ns3::Ipv6PrefixChecker::Ipv6PrefixChecker(ns3::Ipv6PrefixChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv6PrefixChecker const &', 'arg0')]) - ## ipv6-address.h: ns3::Ipv6PrefixChecker::Ipv6PrefixChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Ipv6PrefixValue_methods(root_module, cls): - ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6PrefixValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv6PrefixValue const &', 'arg0')]) ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue() [constructor] cls.add_constructor([]) ## ipv6-address.h: ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6Prefix const & value) [constructor] @@ -1519,11 +1497,10 @@ def register_Ns3Ipv6PrefixValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3LlcSnapHeader_methods(root_module, cls): - ## llc-snap-header.h: ns3::LlcSnapHeader::LlcSnapHeader(ns3::LlcSnapHeader const & arg0) [copy constructor] - cls.add_constructor([param('ns3::LlcSnapHeader const &', 'arg0')]) ## llc-snap-header.h: ns3::LlcSnapHeader::LlcSnapHeader() [constructor] cls.add_constructor([]) ## llc-snap-header.h: void ns3::LlcSnapHeader::SetType(uint16_t type) [member function] @@ -1564,18 +1541,15 @@ def register_Ns3LlcSnapHeader_methods(root_module, cls): 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Mac48AddressChecker_methods(root_module, cls): - ## mac48-address.h: ns3::Mac48AddressChecker::Mac48AddressChecker(ns3::Mac48AddressChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Mac48AddressChecker const &', 'arg0')]) - ## mac48-address.h: ns3::Mac48AddressChecker::Mac48AddressChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Mac48AddressValue_methods(root_module, cls): - ## mac48-address.h: ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48AddressValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Mac48AddressValue const &', 'arg0')]) ## mac48-address.h: ns3::Mac48AddressValue::Mac48AddressValue() [constructor] cls.add_constructor([]) ## mac48-address.h: ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48Address const & value) [constructor] @@ -1604,11 +1578,10 @@ def register_Ns3Mac48AddressValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Queue_methods(root_module, cls): - ## queue.h: ns3::Queue::Queue(ns3::Queue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Queue const &', 'arg0')]) ## queue.h: static ns3::TypeId ns3::Queue::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1692,11 +1665,10 @@ def register_Ns3Queue_methods(root_module, cls): 'ns3::Ptr< ns3::Packet const >', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Socket_methods(root_module, cls): - ## socket.h: ns3::Socket::Socket(ns3::Socket const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Socket const &', 'arg0')]) ## socket.h: ns3::Socket::Socket() [constructor] cls.add_constructor([]) ## socket.h: static ns3::Ptr ns3::Socket::CreateSocket(ns3::Ptr node, ns3::TypeId tid) [member function] @@ -1867,11 +1839,10 @@ def register_Ns3Socket_methods(root_module, cls): 'void', [], visibility='protected') + cls.add_copy_constructor() return def register_Ns3SocketAddressTag_methods(root_module, cls): - ## socket.h: ns3::SocketAddressTag::SocketAddressTag(ns3::SocketAddressTag const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SocketAddressTag const &', 'arg0')]) ## socket.h: ns3::SocketAddressTag::SocketAddressTag() [constructor] cls.add_constructor([]) ## socket.h: void ns3::SocketAddressTag::SetAddress(ns3::Address addr) [member function] @@ -1913,11 +1884,10 @@ def register_Ns3SocketAddressTag_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3SocketFactory_methods(root_module, cls): - ## socket-factory.h: ns3::SocketFactory::SocketFactory(ns3::SocketFactory const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SocketFactory const &', 'arg0')]) ## socket-factory.h: static ns3::TypeId ns3::SocketFactory::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1930,11 +1900,10 @@ def register_Ns3SocketFactory_methods(root_module, cls): 'ns3::Ptr< ns3::Socket >', [], is_pure_virtual=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3SocketIpTtlTag_methods(root_module, cls): - ## socket.h: ns3::SocketIpTtlTag::SocketIpTtlTag(ns3::SocketIpTtlTag const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SocketIpTtlTag const &', 'arg0')]) ## socket.h: ns3::SocketIpTtlTag::SocketIpTtlTag() [constructor] cls.add_constructor([]) ## socket.h: void ns3::SocketIpTtlTag::SetTtl(uint8_t ttl) [member function] @@ -1976,11 +1945,10 @@ def register_Ns3SocketIpTtlTag_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls): - ## socket.h: ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag(ns3::SocketSetDontFragmentTag const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SocketSetDontFragmentTag const &', 'arg0')]) ## socket.h: ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag() [constructor] cls.add_constructor([]) ## socket.h: void ns3::SocketSetDontFragmentTag::Enable() [member function] @@ -2026,11 +1994,10 @@ def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls): 'void', [param('std::ostream &', 'os')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3TcpSocket_methods(root_module, cls): - ## tcp-socket.h: ns3::TcpSocket::TcpSocket(ns3::TcpSocket const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TcpSocket const &', 'arg0')]) ## tcp-socket.h: static ns3::TypeId ns3::TcpSocket::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2128,23 +2095,20 @@ def register_Ns3TcpSocket_methods(root_module, cls): 'uint32_t', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3TcpSocketFactory_methods(root_module, cls): - ## tcp-socket-factory.h: ns3::TcpSocketFactory::TcpSocketFactory(ns3::TcpSocketFactory const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TcpSocketFactory const &', 'arg0')]) - ## tcp-socket-factory.h: ns3::TcpSocketFactory::TcpSocketFactory() [constructor] - cls.add_constructor([]) ## tcp-socket-factory.h: static ns3::TypeId ns3::TcpSocketFactory::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3UdpSocket_methods(root_module, cls): - ## udp-socket.h: ns3::UdpSocket::UdpSocket(ns3::UdpSocket const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UdpSocket const &', 'arg0')]) ## udp-socket.h: static ns3::TypeId ns3::UdpSocket::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2192,30 +2156,25 @@ def register_Ns3UdpSocket_methods(root_module, cls): 'bool', [], is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3UdpSocketFactory_methods(root_module, cls): - ## udp-socket-factory.h: ns3::UdpSocketFactory::UdpSocketFactory(ns3::UdpSocketFactory const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UdpSocketFactory const &', 'arg0')]) - ## udp-socket-factory.h: ns3::UdpSocketFactory::UdpSocketFactory() [constructor] - cls.add_constructor([]) ## udp-socket-factory.h: static ns3::TypeId ns3::UdpSocketFactory::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3AddressChecker_methods(root_module, cls): - ## address.h: ns3::AddressChecker::AddressChecker(ns3::AddressChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::AddressChecker const &', 'arg0')]) - ## address.h: ns3::AddressChecker::AddressChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3AddressValue_methods(root_module, cls): - ## address.h: ns3::AddressValue::AddressValue(ns3::AddressValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::AddressValue const &', 'arg0')]) ## address.h: ns3::AddressValue::AddressValue() [constructor] cls.add_constructor([]) ## address.h: ns3::AddressValue::AddressValue(ns3::Address const & value) [constructor] @@ -2244,11 +2203,10 @@ def register_Ns3AddressValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Application_methods(root_module, cls): - ## application.h: ns3::Application::Application(ns3::Application const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Application const &', 'arg0')]) ## application.h: static ns3::TypeId ns3::Application::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2296,11 +2254,10 @@ def register_Ns3Application_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Channel_methods(root_module, cls): - ## channel.h: ns3::Channel::Channel(ns3::Channel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Channel const &', 'arg0')]) ## channel.h: static ns3::TypeId ns3::Channel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2328,11 +2285,10 @@ def register_Ns3Channel_methods(root_module, cls): 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3DropTailQueue_methods(root_module, cls): - ## drop-tail-queue.h: ns3::DropTailQueue::DropTailQueue(ns3::DropTailQueue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DropTailQueue const &', 'arg0')]) ## drop-tail-queue.h: static ns3::TypeId ns3::DropTailQueue::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2355,11 +2311,10 @@ def register_Ns3DropTailQueue_methods(root_module, cls): 'ns3::Ptr< ns3::Packet const >', [], is_const=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3EthernetHeader_methods(root_module, cls): - ## ethernet-header.h: ns3::EthernetHeader::EthernetHeader(ns3::EthernetHeader const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EthernetHeader const &', 'arg0')]) ## ethernet-header.h: ns3::EthernetHeader::EthernetHeader(bool hasPreamble) [constructor] cls.add_constructor([param('bool', 'hasPreamble')]) ## ethernet-header.h: ns3::EthernetHeader::EthernetHeader() [constructor] @@ -2440,11 +2395,10 @@ def register_Ns3EthernetHeader_methods(root_module, cls): 'uint32_t', [param('ns3::Buffer::Iterator', 'start')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3EthernetTrailer_methods(root_module, cls): - ## ethernet-trailer.h: ns3::EthernetTrailer::EthernetTrailer(ns3::EthernetTrailer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EthernetTrailer const &', 'arg0')]) ## ethernet-trailer.h: ns3::EthernetTrailer::EthernetTrailer() [constructor] cls.add_constructor([]) ## ethernet-trailer.h: static void ns3::EthernetTrailer::EnableFcs(bool enable) [member function] @@ -2504,11 +2458,10 @@ def register_Ns3EthernetTrailer_methods(root_module, cls): 'uint32_t', [param('ns3::Buffer::Iterator', 'end')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv4_methods(root_module, cls): - ## ipv4.h: ns3::Ipv4::Ipv4(ns3::Ipv4 const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4 const &', 'arg0')]) ## ipv4.h: static ns3::TypeId ns3::Ipv4::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2696,18 +2649,17 @@ def register_Ns3Ipv4_methods(root_module, cls): 'uint32_t', [param('ns3::Ipv4Address', 'addr'), param('ns3::Ipv4Mask', 'mask', default_value='ns3::Ipv4Mask(((const char*)"255.255.255.255"))')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3Ipv4RawSocketFactory_methods(root_module, cls): - ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory::Ipv4RawSocketFactory(ns3::Ipv4RawSocketFactory const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Ipv4RawSocketFactory const &', 'arg0')]) - ## ipv4-raw-socket-factory.h: ns3::Ipv4RawSocketFactory::Ipv4RawSocketFactory() [constructor] - cls.add_constructor([]) ## ipv4-raw-socket-factory.h: static ns3::TypeId ns3::Ipv4RawSocketFactory::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Ipv4RoutingProtocol_methods(root_module, cls): @@ -2730,10 +2682,6 @@ def register_Ns3Ipv4RoutingProtocol_methods(root_module, cls): return def register_Ns3NetDevice_methods(root_module, cls): - ## net-device.h: ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [copy constructor] - cls.add_constructor([param('ns3::NetDevice const &', 'arg0')]) - ## net-device.h: ns3::NetDevice::NetDevice() [constructor] - cls.add_constructor([]) ## net-device.h: static ns3::TypeId ns3::NetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2864,11 +2812,11 @@ def register_Ns3NetDevice_methods(root_module, cls): 'bool', [], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Node_methods(root_module, cls): - ## node.h: ns3::Node::Node(ns3::Node const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Node const &', 'arg0')]) ## node.h: static ns3::TypeId ns3::Node::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2934,11 +2882,10 @@ def register_Ns3Node_methods(root_module, cls): 'void', [param('ns3::Ptr< ns3::NetDevice >', 'device')], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3PacketSocketFactory_methods(root_module, cls): - ## packet-socket-factory.h: ns3::PacketSocketFactory::PacketSocketFactory(ns3::PacketSocketFactory const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketSocketFactory const &', 'arg0')]) ## packet-socket-factory.h: static ns3::TypeId ns3::PacketSocketFactory::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2951,11 +2898,10 @@ def register_Ns3PacketSocketFactory_methods(root_module, cls): 'ns3::Ptr< ns3::Socket >', [], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3SimpleChannel_methods(root_module, cls): - ## simple-channel.h: ns3::SimpleChannel::SimpleChannel(ns3::SimpleChannel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SimpleChannel const &', 'arg0')]) ## simple-channel.h: static ns3::TypeId ns3::SimpleChannel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2981,11 +2927,10 @@ def register_Ns3SimpleChannel_methods(root_module, cls): 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3SimpleNetDevice_methods(root_module, cls): - ## simple-net-device.h: ns3::SimpleNetDevice::SimpleNetDevice(ns3::SimpleNetDevice const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SimpleNetDevice const &', 'arg0')]) ## simple-net-device.h: static ns3::TypeId ns3::SimpleNetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -3135,6 +3080,7 @@ def register_Ns3SimpleNetDevice_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_olsr.py b/bindings/python/ns3_module_olsr.py index 7f269fbef..22c42ef34 100644 --- a/bindings/python/ns3_module_olsr.py +++ b/bindings/python/ns3_module_olsr.py @@ -86,10 +86,6 @@ def register_methods(root_module): return def register_Ns3OlsrAgent_methods(root_module, cls): - ## olsr-agent.h: ns3::olsr::Agent::Agent(ns3::olsr::Agent const & arg0) [copy constructor] - cls.add_constructor([param('ns3::olsr::Agent const &', 'arg0')]) - ## olsr-agent.h: ns3::olsr::Agent::Agent() [constructor] - cls.add_constructor([]) ## olsr-agent.h: static ns3::TypeId ns3::olsr::Agent::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -115,6 +111,8 @@ def register_Ns3OlsrAgent_methods(root_module, cls): 'ns3::Ptr< ns3::olsr::RoutingTable const >', [], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3OlsrMessageHeader_methods(root_module, cls): @@ -246,8 +244,6 @@ def register_Ns3OlsrMessageHeader_methods(root_module, cls): return def register_Ns3OlsrMessageHeaderHello_methods(root_module, cls): - ## olsr-header.h: ns3::olsr::MessageHeader::Hello::Hello() [constructor] - cls.add_constructor([]) ## olsr-header.h: ns3::olsr::MessageHeader::Hello::Hello(ns3::olsr::MessageHeader::Hello const & arg0) [copy constructor] cls.add_constructor([param('ns3::olsr::MessageHeader::Hello const &', 'arg0')]) ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hello::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function] @@ -291,15 +287,11 @@ def register_Ns3OlsrMessageHeaderHelloLinkMessage_methods(root_module, cls): cls.add_instance_attribute('linkCode', 'uint8_t', is_const=False) ## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses [variable] cls.add_instance_attribute('neighborInterfaceAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False) - ## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::LinkMessage(ns3::olsr::MessageHeader::Hello::LinkMessage const & arg0) [copy constructor] - cls.add_constructor([param('ns3::olsr::MessageHeader::Hello::LinkMessage const &', 'arg0')]) - ## olsr-header.h: ns3::olsr::MessageHeader::Hello::LinkMessage::LinkMessage() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3OlsrMessageHeaderHna_methods(root_module, cls): - ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Hna() [constructor] - cls.add_constructor([]) ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Hna(ns3::olsr::MessageHeader::Hna const & arg0) [copy constructor] cls.add_constructor([param('ns3::olsr::MessageHeader::Hna const &', 'arg0')]) ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Hna::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function] @@ -330,15 +322,11 @@ def register_Ns3OlsrMessageHeaderHnaAssociation_methods(root_module, cls): cls.add_instance_attribute('address', 'ns3::Ipv4Address', is_const=False) ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::mask [variable] cls.add_instance_attribute('mask', 'ns3::Ipv4Mask', is_const=False) - ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::Association(ns3::olsr::MessageHeader::Hna::Association const & arg0) [copy constructor] - cls.add_constructor([param('ns3::olsr::MessageHeader::Hna::Association const &', 'arg0')]) - ## olsr-header.h: ns3::olsr::MessageHeader::Hna::Association::Association() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3OlsrMessageHeaderMid_methods(root_module, cls): - ## olsr-header.h: ns3::olsr::MessageHeader::Mid::Mid() [constructor] - cls.add_constructor([]) ## olsr-header.h: ns3::olsr::MessageHeader::Mid::Mid(ns3::olsr::MessageHeader::Mid const & arg0) [copy constructor] cls.add_constructor([param('ns3::olsr::MessageHeader::Mid const &', 'arg0')]) ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Mid::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function] @@ -365,8 +353,6 @@ def register_Ns3OlsrMessageHeaderMid_methods(root_module, cls): return def register_Ns3OlsrMessageHeaderTc_methods(root_module, cls): - ## olsr-header.h: ns3::olsr::MessageHeader::Tc::Tc() [constructor] - cls.add_constructor([]) ## olsr-header.h: ns3::olsr::MessageHeader::Tc::Tc(ns3::olsr::MessageHeader::Tc const & arg0) [copy constructor] cls.add_constructor([param('ns3::olsr::MessageHeader::Tc const &', 'arg0')]) ## olsr-header.h: uint32_t ns3::olsr::MessageHeader::Tc::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function] @@ -451,8 +437,6 @@ def register_Ns3OlsrPacketHeader_methods(root_module, cls): return def register_Ns3OlsrRoutingTable_methods(root_module, cls): - ## olsr-routing-table.h: ns3::olsr::RoutingTable::RoutingTable(ns3::olsr::RoutingTable const & arg0) [copy constructor] - cls.add_constructor([param('ns3::olsr::RoutingTable const &', 'arg0')]) ## olsr-routing-table.h: ns3::olsr::RoutingTable::RoutingTable() [constructor] cls.add_constructor([]) ## olsr-routing-table.h: void ns3::olsr::RoutingTable::SetIpv4(ns3::Ptr ipv4) [member function] @@ -514,6 +498,7 @@ def register_Ns3OlsrRoutingTable_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3OlsrRoutingTableEntry_methods(root_module, cls): @@ -525,10 +510,9 @@ def register_Ns3OlsrRoutingTableEntry_methods(root_module, cls): cls.add_instance_attribute('interface', 'uint32_t', is_const=False) ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::distance [variable] cls.add_instance_attribute('distance', 'uint32_t', is_const=False) - ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::RoutingTableEntry(ns3::olsr::RoutingTableEntry const & arg0) [copy constructor] - cls.add_constructor([param('ns3::olsr::RoutingTableEntry const &', 'arg0')]) ## olsr-routing-table.h: ns3::olsr::RoutingTableEntry::RoutingTableEntry() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_onoff.py b/bindings/python/ns3_module_onoff.py index 2d253ec6d..73fcc23c9 100644 --- a/bindings/python/ns3_module_onoff.py +++ b/bindings/python/ns3_module_onoff.py @@ -51,8 +51,6 @@ def register_methods(root_module): return def register_Ns3OnOffApplication_methods(root_module, cls): - ## onoff-application.h: ns3::OnOffApplication::OnOffApplication(ns3::OnOffApplication const & arg0) [copy constructor] - cls.add_constructor([param('ns3::OnOffApplication const &', 'arg0')]) ## onoff-application.h: static ns3::TypeId ns3::OnOffApplication::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -79,6 +77,7 @@ def register_Ns3OnOffApplication_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_packet_sink.py b/bindings/python/ns3_module_packet_sink.py index 8478d79c4..8a374d204 100644 --- a/bindings/python/ns3_module_packet_sink.py +++ b/bindings/python/ns3_module_packet_sink.py @@ -51,8 +51,6 @@ def register_methods(root_module): return def register_Ns3PacketSink_methods(root_module, cls): - ## packet-sink.h: ns3::PacketSink::PacketSink(ns3::PacketSink const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketSink const &', 'arg0')]) ## packet-sink.h: static ns3::TypeId ns3::PacketSink::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -75,6 +73,7 @@ def register_Ns3PacketSink_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_point_to_point.py b/bindings/python/ns3_module_point_to_point.py index 1541d7d25..a6e7903ff 100644 --- a/bindings/python/ns3_module_point_to_point.py +++ b/bindings/python/ns3_module_point_to_point.py @@ -57,8 +57,6 @@ def register_methods(root_module): return def register_Ns3PppHeader_methods(root_module, cls): - ## ppp-header.h: ns3::PppHeader::PppHeader(ns3::PppHeader const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PppHeader const &', 'arg0')]) ## ppp-header.h: ns3::PppHeader::PppHeader() [constructor] cls.add_constructor([]) ## ppp-header.h: static ns3::TypeId ns3::PppHeader::GetTypeId() [member function] @@ -91,11 +89,10 @@ def register_Ns3PppHeader_methods(root_module, cls): 'uint32_t', [], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3PointToPointChannel_methods(root_module, cls): - ## point-to-point-channel.h: ns3::PointToPointChannel::PointToPointChannel(ns3::PointToPointChannel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PointToPointChannel const &', 'arg0')]) ## point-to-point-channel.h: static ns3::TypeId ns3::PointToPointChannel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -126,11 +123,10 @@ def register_Ns3PointToPointChannel_methods(root_module, cls): 'ns3::Ptr< ns3::NetDevice >', [param('uint32_t', 'i')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3PointToPointNetDevice_methods(root_module, cls): - ## point-to-point-net-device.h: ns3::PointToPointNetDevice::PointToPointNetDevice(ns3::PointToPointNetDevice const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PointToPointNetDevice const &', 'arg0')]) ## point-to-point-net-device.h: static ns3::TypeId ns3::PointToPointNetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -305,6 +301,7 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_simulator.py b/bindings/python/ns3_module_simulator.py index cc3a38859..add4be16a 100644 --- a/bindings/python/ns3_module_simulator.py +++ b/bindings/python/ns3_module_simulator.py @@ -171,8 +171,6 @@ def register_Ns3EventId_methods(root_module, cls): return def register_Ns3EventImpl_methods(root_module, cls): - ## event-impl.h: ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [copy constructor] - cls.add_constructor([param('ns3::EventImpl const &', 'arg0')]) ## event-impl.h: ns3::EventImpl::EventImpl() [constructor] cls.add_constructor([]) ## event-impl.h: void ns3::EventImpl::Ref() const [member function] @@ -202,6 +200,7 @@ def register_Ns3EventImpl_methods(root_module, cls): 'void', [], is_pure_virtual=True, visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3HighPrecision_methods(root_module, cls): @@ -257,8 +256,6 @@ def register_Ns3HighPrecision_methods(root_module, cls): return def register_Ns3Simulator_methods(root_module, cls): - ## simulator.h: ns3::Simulator::Simulator(ns3::Simulator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Simulator const &', 'arg0')]) ## simulator.h: static void ns3::Simulator::SetImplementation(ns3::Ptr impl) [member function] cls.add_method('SetImplementation', 'void', @@ -344,6 +341,7 @@ def register_Ns3Simulator_methods(root_module, cls): 'ns3::Time', [], is_static=True) + cls.add_copy_constructor() return def register_Ns3TimeInvert_methods(root_module, cls): @@ -587,8 +585,6 @@ def register_Ns3TimeSquare_methods(root_module, cls): return def register_Ns3Timer_methods(root_module, cls): - ## timer.h: ns3::Timer::Timer(ns3::Timer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Timer const &', 'arg0')]) ## timer.h: ns3::Timer::Timer() [constructor] cls.add_constructor([]) ## timer.h: ns3::Timer::Timer(ns3::Timer::DestroyPolicy destroyPolicy) [constructor] @@ -651,13 +647,10 @@ def register_Ns3Timer_methods(root_module, cls): cls.add_method('Resume', 'void', []) + cls.add_copy_constructor() return def register_Ns3TimerImpl_methods(root_module, cls): - ## timer-impl.h: ns3::TimerImpl::TimerImpl(ns3::TimerImpl const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TimerImpl const &', 'arg0')]) - ## timer-impl.h: ns3::TimerImpl::TimerImpl() [constructor] - cls.add_constructor([]) ## timer-impl.h: ns3::EventId ns3::TimerImpl::Schedule(ns3::Time const & delay) [member function] cls.add_method('Schedule', 'ns3::EventId', @@ -668,24 +661,21 @@ def register_Ns3TimerImpl_methods(root_module, cls): 'void', [], is_pure_virtual=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Watchdog_methods(root_module, cls): - ## watchdog.h: ns3::Watchdog::Watchdog(ns3::Watchdog const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Watchdog const &', 'arg0')]) ## watchdog.h: ns3::Watchdog::Watchdog() [constructor] cls.add_constructor([]) ## watchdog.h: void ns3::Watchdog::Ping(ns3::Time delay) [member function] cls.add_method('Ping', 'void', [param('ns3::Time', 'delay')]) + cls.add_copy_constructor() return def register_Ns3Scheduler_methods(root_module, cls): - ## scheduler.h: ns3::Scheduler::Scheduler(ns3::Scheduler const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Scheduler const &', 'arg0')]) - ## scheduler.h: ns3::Scheduler::Scheduler() [constructor] - cls.add_constructor([]) ## scheduler.h: static ns3::TypeId ns3::Scheduler::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -716,6 +706,8 @@ def register_Ns3Scheduler_methods(root_module, cls): 'void', [param('ns3::Scheduler::Event const &', 'ev')], is_pure_virtual=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3SchedulerEvent_methods(root_module, cls): @@ -743,10 +735,6 @@ def register_Ns3SchedulerEventKey_methods(root_module, cls): return def register_Ns3SimulatorImpl_methods(root_module, cls): - ## simulator-impl.h: ns3::SimulatorImpl::SimulatorImpl(ns3::SimulatorImpl const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SimulatorImpl const &', 'arg0')]) - ## simulator-impl.h: ns3::SimulatorImpl::SimulatorImpl() [constructor] - cls.add_constructor([]) ## simulator-impl.h: void ns3::SimulatorImpl::Destroy() [member function] cls.add_method('Destroy', 'void', @@ -832,11 +820,11 @@ def register_Ns3SimulatorImpl_methods(root_module, cls): 'ns3::Ptr< ns3::Scheduler >', [], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Synchronizer_methods(root_module, cls): - ## synchronizer.h: ns3::Synchronizer::Synchronizer(ns3::Synchronizer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::Synchronizer const &', 'arg0')]) ## synchronizer.h: static ns3::TypeId ns3::Synchronizer::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -929,18 +917,15 @@ def register_Ns3Synchronizer_methods(root_module, cls): 'uint64_t', [], is_pure_virtual=True, visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3TimeChecker_methods(root_module, cls): - ## nstime.h: ns3::TimeChecker::TimeChecker(ns3::TimeChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TimeChecker const &', 'arg0')]) - ## nstime.h: ns3::TimeChecker::TimeChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3TimeValue_methods(root_module, cls): - ## nstime.h: ns3::TimeValue::TimeValue(ns3::TimeValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TimeValue const &', 'arg0')]) ## nstime.h: ns3::TimeValue::TimeValue() [constructor] cls.add_constructor([]) ## nstime.h: ns3::TimeValue::TimeValue(ns3::Time const & value) [constructor] @@ -969,6 +954,7 @@ def register_Ns3TimeValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3WallClockSynchronizer_methods(root_module, cls): @@ -978,8 +964,6 @@ def register_Ns3WallClockSynchronizer_methods(root_module, cls): cls.add_static_attribute('US_PER_SEC', 'uint64_t const', is_const=True) ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer::NS_PER_SEC [variable] cls.add_static_attribute('NS_PER_SEC', 'uint64_t const', is_const=True) - ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer::WallClockSynchronizer(ns3::WallClockSynchronizer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WallClockSynchronizer const &', 'arg0')]) ## wall-clock-synchronizer.h: ns3::WallClockSynchronizer::WallClockSynchronizer() [constructor] cls.add_constructor([]) ## wall-clock-synchronizer.h: bool ns3::WallClockSynchronizer::DoRealtime() [member function] @@ -1067,11 +1051,10 @@ def register_Ns3WallClockSynchronizer_methods(root_module, cls): 'void', [param('timeval *', 'tv1'), param('timeval *', 'tv2'), param('timeval *', 'result')], visibility='protected') + cls.add_copy_constructor() return def register_Ns3CalendarScheduler_methods(root_module, cls): - ## calendar-scheduler.h: ns3::CalendarScheduler::CalendarScheduler(ns3::CalendarScheduler const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CalendarScheduler const &', 'arg0')]) ## calendar-scheduler.h: static ns3::TypeId ns3::CalendarScheduler::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1104,11 +1087,10 @@ def register_Ns3CalendarScheduler_methods(root_module, cls): 'void', [param('ns3::Scheduler::Event const &', 'ev')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3DefaultSimulatorImpl_methods(root_module, cls): - ## default-simulator-impl.h: ns3::DefaultSimulatorImpl::DefaultSimulatorImpl(ns3::DefaultSimulatorImpl const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DefaultSimulatorImpl const &', 'arg0')]) ## default-simulator-impl.h: static ns3::TypeId ns3::DefaultSimulatorImpl::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1201,11 +1183,10 @@ def register_Ns3DefaultSimulatorImpl_methods(root_module, cls): 'ns3::Ptr< ns3::Scheduler >', [], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3HeapScheduler_methods(root_module, cls): - ## heap-scheduler.h: ns3::HeapScheduler::HeapScheduler(ns3::HeapScheduler const & arg0) [copy constructor] - cls.add_constructor([param('ns3::HeapScheduler const &', 'arg0')]) ## heap-scheduler.h: static ns3::TypeId ns3::HeapScheduler::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1238,11 +1219,10 @@ def register_Ns3HeapScheduler_methods(root_module, cls): 'void', [param('ns3::Scheduler::Event const &', 'ev')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ListScheduler_methods(root_module, cls): - ## list-scheduler.h: ns3::ListScheduler::ListScheduler(ns3::ListScheduler const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ListScheduler const &', 'arg0')]) ## list-scheduler.h: static ns3::TypeId ns3::ListScheduler::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1275,11 +1255,10 @@ def register_Ns3ListScheduler_methods(root_module, cls): 'void', [param('ns3::Scheduler::Event const &', 'ev')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3MapScheduler_methods(root_module, cls): - ## map-scheduler.h: ns3::MapScheduler::MapScheduler(ns3::MapScheduler const & arg0) [copy constructor] - cls.add_constructor([param('ns3::MapScheduler const &', 'arg0')]) ## map-scheduler.h: static ns3::TypeId ns3::MapScheduler::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1312,11 +1291,10 @@ def register_Ns3MapScheduler_methods(root_module, cls): 'void', [param('ns3::Scheduler::Event const &', 'ev')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls): - ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl::RealtimeSimulatorImpl(ns3::RealtimeSimulatorImpl const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RealtimeSimulatorImpl const &', 'arg0')]) ## realtime-simulator-impl.h: static ns3::TypeId ns3::RealtimeSimulatorImpl::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1440,6 +1418,7 @@ def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls): 'ns3::Time', [], is_const=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_stats.py b/bindings/python/ns3_module_stats.py index 6da736fe1..8f8ad86f7 100644 --- a/bindings/python/ns3_module_stats.py +++ b/bindings/python/ns3_module_stats.py @@ -81,10 +81,6 @@ def register_methods(root_module): return def register_Ns3DataOutputCallback_methods(root_module, cls): - ## data-output-interface.h: ns3::DataOutputCallback::DataOutputCallback(ns3::DataOutputCallback const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DataOutputCallback const &', 'arg0')]) - ## data-output-interface.h: ns3::DataOutputCallback::DataOutputCallback() [constructor] - cls.add_constructor([]) ## data-output-interface.h: void ns3::DataOutputCallback::OutputSingleton(std::string key, std::string variable, int val) [member function] cls.add_method('OutputSingleton', 'void', @@ -110,11 +106,11 @@ def register_Ns3DataOutputCallback_methods(root_module, cls): 'void', [param('std::string', 'key'), param('std::string', 'variable'), param('ns3::Time', 'val')], is_pure_virtual=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3DataCalculator_methods(root_module, cls): - ## data-calculator.h: ns3::DataCalculator::DataCalculator(ns3::DataCalculator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DataCalculator const &', 'arg0')]) ## data-calculator.h: ns3::DataCalculator::DataCalculator() [constructor] cls.add_constructor([]) ## data-calculator.h: bool ns3::DataCalculator::GetEnabled() const [member function] @@ -159,11 +155,10 @@ def register_Ns3DataCalculator_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3DataCollector_methods(root_module, cls): - ## data-collector.h: ns3::DataCollector::DataCollector(ns3::DataCollector const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DataCollector const &', 'arg0')]) ## data-collector.h: ns3::DataCollector::DataCollector() [constructor] cls.add_constructor([]) ## data-collector.h: void ns3::DataCollector::DescribeRun(std::string experiment, std::string strategy, std::string input, std::string runID, std::string description="") [member function] @@ -232,11 +227,10 @@ def register_Ns3DataCollector_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3DataOutputInterface_methods(root_module, cls): - ## data-output-interface.h: ns3::DataOutputInterface::DataOutputInterface(ns3::DataOutputInterface const & arg0) [copy constructor] - cls.add_constructor([param('ns3::DataOutputInterface const &', 'arg0')]) ## data-output-interface.h: ns3::DataOutputInterface::DataOutputInterface() [constructor] cls.add_constructor([]) ## data-output-interface.h: void ns3::DataOutputInterface::Output(ns3::DataCollector & dc) [member function] @@ -249,11 +243,10 @@ def register_Ns3DataOutputInterface_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, cls): - ## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator::MinMaxAvgTotalCalculator(ns3::MinMaxAvgTotalCalculator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::MinMaxAvgTotalCalculator< unsigned int > const &', 'arg0')]) ## basic-data-calculators.h: ns3::MinMaxAvgTotalCalculator::MinMaxAvgTotalCalculator() [constructor] cls.add_constructor([]) ## basic-data-calculators.h: void ns3::MinMaxAvgTotalCalculator::Update(unsigned int const i) [member function] @@ -270,11 +263,10 @@ def register_Ns3MinMaxAvgTotalCalculator__Unsigned_int_methods(root_module, cls) 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3OmnetDataOutput_methods(root_module, cls): - ## omnet-data-output.h: ns3::OmnetDataOutput::OmnetDataOutput(ns3::OmnetDataOutput const & arg0) [copy constructor] - cls.add_constructor([param('ns3::OmnetDataOutput const &', 'arg0')]) ## omnet-data-output.h: ns3::OmnetDataOutput::OmnetDataOutput() [constructor] cls.add_constructor([]) ## omnet-data-output.h: void ns3::OmnetDataOutput::Output(ns3::DataCollector & dc) [member function] @@ -296,11 +288,10 @@ def register_Ns3OmnetDataOutput_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, cls): - ## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator(ns3::PacketSizeMinMaxAvgTotalCalculator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketSizeMinMaxAvgTotalCalculator const &', 'arg0')]) ## packet-data-calculators.h: ns3::PacketSizeMinMaxAvgTotalCalculator::PacketSizeMinMaxAvgTotalCalculator() [constructor] cls.add_constructor([]) ## packet-data-calculators.h: void ns3::PacketSizeMinMaxAvgTotalCalculator::PacketUpdate(std::string path, ns3::Ptr packet) [member function] @@ -316,11 +307,10 @@ def register_Ns3PacketSizeMinMaxAvgTotalCalculator_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3SqliteDataOutput_methods(root_module, cls): - ## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput(ns3::SqliteDataOutput const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SqliteDataOutput const &', 'arg0')]) ## sqlite-data-output.h: ns3::SqliteDataOutput::SqliteDataOutput() [constructor] cls.add_constructor([]) ## sqlite-data-output.h: void ns3::SqliteDataOutput::Output(ns3::DataCollector & dc) [member function] @@ -342,11 +332,10 @@ def register_Ns3SqliteDataOutput_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, cls): - ## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator::TimeMinMaxAvgTotalCalculator(ns3::TimeMinMaxAvgTotalCalculator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::TimeMinMaxAvgTotalCalculator const &', 'arg0')]) ## time-data-calculators.h: ns3::TimeMinMaxAvgTotalCalculator::TimeMinMaxAvgTotalCalculator() [constructor] cls.add_constructor([]) ## time-data-calculators.h: void ns3::TimeMinMaxAvgTotalCalculator::Update(ns3::Time const i) [member function] @@ -363,11 +352,10 @@ def register_Ns3TimeMinMaxAvgTotalCalculator_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3CounterCalculator__Unsigned_int_methods(root_module, cls): - ## basic-data-calculators.h: ns3::CounterCalculator::CounterCalculator(ns3::CounterCalculator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::CounterCalculator< unsigned int > const &', 'arg0')]) ## basic-data-calculators.h: ns3::CounterCalculator::CounterCalculator() [constructor] cls.add_constructor([]) ## basic-data-calculators.h: void ns3::CounterCalculator::Update() [member function] @@ -393,11 +381,10 @@ def register_Ns3CounterCalculator__Unsigned_int_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3PacketCounterCalculator_methods(root_module, cls): - ## packet-data-calculators.h: ns3::PacketCounterCalculator::PacketCounterCalculator(ns3::PacketCounterCalculator const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PacketCounterCalculator const &', 'arg0')]) ## packet-data-calculators.h: ns3::PacketCounterCalculator::PacketCounterCalculator() [constructor] cls.add_constructor([]) ## packet-data-calculators.h: void ns3::PacketCounterCalculator::PacketUpdate(std::string path, ns3::Ptr packet) [member function] @@ -413,6 +400,7 @@ def register_Ns3PacketCounterCalculator_methods(root_module, cls): 'void', [], visibility='protected', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_udp_echo.py b/bindings/python/ns3_module_udp_echo.py index dae92a56e..c7ede62a3 100644 --- a/bindings/python/ns3_module_udp_echo.py +++ b/bindings/python/ns3_module_udp_echo.py @@ -54,8 +54,6 @@ def register_methods(root_module): return def register_Ns3UdpEchoClient_methods(root_module, cls): - ## udp-echo-client.h: ns3::UdpEchoClient::UdpEchoClient(ns3::UdpEchoClient const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UdpEchoClient const &', 'arg0')]) ## udp-echo-client.h: static ns3::TypeId ns3::UdpEchoClient::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -82,11 +80,10 @@ def register_Ns3UdpEchoClient_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3UdpEchoServer_methods(root_module, cls): - ## udp-echo-server.h: ns3::UdpEchoServer::UdpEchoServer(ns3::UdpEchoServer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::UdpEchoServer const &', 'arg0')]) ## udp-echo-server.h: static ns3::TypeId ns3::UdpEchoServer::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -109,6 +106,7 @@ def register_Ns3UdpEchoServer_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_v4ping.py b/bindings/python/ns3_module_v4ping.py index ec2bc2357..ace21b68f 100644 --- a/bindings/python/ns3_module_v4ping.py +++ b/bindings/python/ns3_module_v4ping.py @@ -51,8 +51,6 @@ def register_methods(root_module): return def register_Ns3V4Ping_methods(root_module, cls): - ## v4ping.h: ns3::V4Ping::V4Ping(ns3::V4Ping const & arg0) [copy constructor] - cls.add_constructor([param('ns3::V4Ping const &', 'arg0')]) ## v4ping.h: static ns3::TypeId ns3::V4Ping::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -75,6 +73,7 @@ def register_Ns3V4Ping_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/bindings/python/ns3_module_wifi.py b/bindings/python/ns3_module_wifi.py index 71b951c39..be2a192fd 100644 --- a/bindings/python/ns3_module_wifi.py +++ b/bindings/python/ns3_module_wifi.py @@ -244,14 +244,12 @@ def register_Ns3InterferenceHelper_methods(root_module, cls): return def register_Ns3InterferenceHelperSnrPer_methods(root_module, cls): - ## interference-helper.h: ns3::InterferenceHelper::SnrPer::SnrPer() [constructor] - cls.add_constructor([]) - ## interference-helper.h: ns3::InterferenceHelper::SnrPer::SnrPer(ns3::InterferenceHelper::SnrPer const & arg0) [copy constructor] - cls.add_constructor([param('ns3::InterferenceHelper::SnrPer const &', 'arg0')]) ## interference-helper.h: ns3::InterferenceHelper::SnrPer::per [variable] cls.add_instance_attribute('per', 'double', is_const=False) ## interference-helper.h: ns3::InterferenceHelper::SnrPer::snr [variable] cls.add_instance_attribute('snr', 'double', is_const=False) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3Ssid_methods(root_module, cls): @@ -359,10 +357,8 @@ def register_Ns3ThresholdsItem_methods(root_module, cls): cls.add_instance_attribute('pmtl', 'double', is_const=False) ## rraa-wifi-manager.h: ns3::ThresholdsItem::ewnd [variable] cls.add_instance_attribute('ewnd', 'uint32_t', is_const=False) - ## rraa-wifi-manager.h: ns3::ThresholdsItem::ThresholdsItem(ns3::ThresholdsItem const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ThresholdsItem const &', 'arg0')]) - ## rraa-wifi-manager.h: ns3::ThresholdsItem::ThresholdsItem() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3WifiMode_methods(root_module, cls): @@ -427,8 +423,6 @@ def register_Ns3WifiMode_methods(root_module, cls): return def register_Ns3WifiModeFactory_methods(root_module, cls): - ## wifi-mode.h: ns3::WifiModeFactory::WifiModeFactory(ns3::WifiModeFactory const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiModeFactory const &', 'arg0')]) ## wifi-mode.h: static ns3::WifiMode ns3::WifiModeFactory::CreateBpsk(std::string uniqueName, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, uint32_t phyRate) [member function] cls.add_method('CreateBpsk', 'ns3::WifiMode', @@ -439,13 +433,10 @@ def register_Ns3WifiModeFactory_methods(root_module, cls): 'ns3::WifiMode', [param('std::string', 'uniqueName'), param('bool', 'isMandatory'), param('uint32_t', 'bandwidth'), param('uint32_t', 'dataRate'), param('uint32_t', 'phyRate'), param('uint8_t', 'constellationSize')], is_static=True) + cls.add_copy_constructor() return def register_Ns3WifiPhyListener_methods(root_module, cls): - ## wifi-phy.h: ns3::WifiPhyListener::WifiPhyListener(ns3::WifiPhyListener const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiPhyListener const &', 'arg0')]) - ## wifi-phy.h: ns3::WifiPhyListener::WifiPhyListener() [constructor] - cls.add_constructor([]) ## wifi-phy.h: void ns3::WifiPhyListener::NotifyRxStart(ns3::Time duration) [member function] cls.add_method('NotifyRxStart', 'void', @@ -471,11 +462,11 @@ def register_Ns3WifiPhyListener_methods(root_module, cls): 'void', [param('ns3::Time', 'duration')], is_pure_virtual=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3WifiRemoteStation_methods(root_module, cls): - ## wifi-remote-station-manager.h: ns3::WifiRemoteStation::WifiRemoteStation(ns3::WifiRemoteStation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiRemoteStation const &', 'arg0')]) ## wifi-remote-station-manager.h: static ns3::TypeId ns3::WifiRemoteStation::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -665,11 +656,10 @@ def register_Ns3WifiRemoteStation_methods(root_module, cls): 'ns3::WifiMode', [], is_pure_virtual=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3AmrrWifiRemoteStation_methods(root_module, cls): - ## amrr-wifi-manager.h: ns3::AmrrWifiRemoteStation::AmrrWifiRemoteStation(ns3::AmrrWifiRemoteStation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::AmrrWifiRemoteStation const &', 'arg0')]) ## amrr-wifi-manager.h: ns3::AmrrWifiRemoteStation::AmrrWifiRemoteStation(ns3::Ptr stations) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::AmrrWifiManager >', 'stations')]) ## amrr-wifi-manager.h: void ns3::AmrrWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] @@ -722,11 +712,10 @@ def register_Ns3AmrrWifiRemoteStation_methods(root_module, cls): 'ns3::WifiMode', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ArfWifiRemoteStation_methods(root_module, cls): - ## arf-wifi-manager.h: ns3::ArfWifiRemoteStation::ArfWifiRemoteStation(ns3::ArfWifiRemoteStation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ArfWifiRemoteStation const &', 'arg0')]) ## arf-wifi-manager.h: ns3::ArfWifiRemoteStation::ArfWifiRemoteStation(ns3::Ptr stations, int minTimerTimeout, int minSuccessThreshold) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::ArfWifiManager >', 'stations'), param('int', 'minTimerTimeout'), param('int', 'minSuccessThreshold')]) ## arf-wifi-manager.h: void ns3::ArfWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] @@ -819,11 +808,10 @@ def register_Ns3ArfWifiRemoteStation_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ConstantRateWifiRemoteStation_methods(root_module, cls): - ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiRemoteStation::ConstantRateWifiRemoteStation(ns3::ConstantRateWifiRemoteStation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ConstantRateWifiRemoteStation const &', 'arg0')]) ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiRemoteStation::ConstantRateWifiRemoteStation(ns3::Ptr stations) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::ConstantRateWifiManager >', 'stations')]) ## constant-rate-wifi-manager.h: void ns3::ConstantRateWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] @@ -876,11 +864,10 @@ def register_Ns3ConstantRateWifiRemoteStation_methods(root_module, cls): 'ns3::WifiMode', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3IdealWifiRemoteStation_methods(root_module, cls): - ## ideal-wifi-manager.h: ns3::IdealWifiRemoteStation::IdealWifiRemoteStation(ns3::IdealWifiRemoteStation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IdealWifiRemoteStation const &', 'arg0')]) ## ideal-wifi-manager.h: ns3::IdealWifiRemoteStation::IdealWifiRemoteStation(ns3::Ptr stations) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::IdealWifiManager >', 'stations')]) ## ideal-wifi-manager.h: void ns3::IdealWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] @@ -933,11 +920,10 @@ def register_Ns3IdealWifiRemoteStation_methods(root_module, cls): 'ns3::WifiMode', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3OnoeWifiRemoteStation_methods(root_module, cls): - ## onoe-wifi-manager.h: ns3::OnoeWifiRemoteStation::OnoeWifiRemoteStation(ns3::OnoeWifiRemoteStation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::OnoeWifiRemoteStation const &', 'arg0')]) ## onoe-wifi-manager.h: ns3::OnoeWifiRemoteStation::OnoeWifiRemoteStation(ns3::Ptr stations) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::OnoeWifiManager >', 'stations')]) ## onoe-wifi-manager.h: void ns3::OnoeWifiRemoteStation::DoReportRxOk(double rxSnr, ns3::WifiMode txMode) [member function] @@ -990,13 +976,10 @@ def register_Ns3OnoeWifiRemoteStation_methods(root_module, cls): 'ns3::WifiMode', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3PropagationDelayModel_methods(root_module, cls): - ## propagation-delay-model.h: ns3::PropagationDelayModel::PropagationDelayModel(ns3::PropagationDelayModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::PropagationDelayModel const &', 'arg0')]) - ## propagation-delay-model.h: ns3::PropagationDelayModel::PropagationDelayModel() [constructor] - cls.add_constructor([]) ## propagation-delay-model.h: static ns3::TypeId ns3::PropagationDelayModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1007,6 +990,8 @@ def register_Ns3PropagationDelayModel_methods(root_module, cls): 'ns3::Time', [param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3PropagationLossModel_methods(root_module, cls): @@ -1034,8 +1019,6 @@ def register_Ns3PropagationLossModel_methods(root_module, cls): return def register_Ns3RandomPropagationDelayModel_methods(root_module, cls): - ## propagation-delay-model.h: ns3::RandomPropagationDelayModel::RandomPropagationDelayModel(ns3::RandomPropagationDelayModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RandomPropagationDelayModel const &', 'arg0')]) ## propagation-delay-model.h: static ns3::TypeId ns3::RandomPropagationDelayModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1048,6 +1031,7 @@ def register_Ns3RandomPropagationDelayModel_methods(root_module, cls): 'ns3::Time', [param('ns3::Ptr< ns3::MobilityModel >', 'a'), param('ns3::Ptr< ns3::MobilityModel >', 'b')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RandomPropagationLossModel_methods(root_module, cls): @@ -1066,8 +1050,6 @@ def register_Ns3RandomPropagationLossModel_methods(root_module, cls): return def register_Ns3RraaWifiRemoteStation_methods(root_module, cls): - ## rraa-wifi-manager.h: ns3::RraaWifiRemoteStation::RraaWifiRemoteStation(ns3::RraaWifiRemoteStation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RraaWifiRemoteStation const &', 'arg0')]) ## rraa-wifi-manager.h: ns3::RraaWifiRemoteStation::RraaWifiRemoteStation(ns3::Ptr stations) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::RraaWifiManager >', 'stations')]) ## rraa-wifi-manager.h: bool ns3::RraaWifiRemoteStation::NeedRts(ns3::Ptr packet) [member function] @@ -1125,18 +1107,15 @@ def register_Ns3RraaWifiRemoteStation_methods(root_module, cls): 'ns3::WifiMode', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3SsidChecker_methods(root_module, cls): - ## ssid.h: ns3::SsidChecker::SsidChecker(ns3::SsidChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SsidChecker const &', 'arg0')]) - ## ssid.h: ns3::SsidChecker::SsidChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3SsidValue_methods(root_module, cls): - ## ssid.h: ns3::SsidValue::SsidValue(ns3::SsidValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::SsidValue const &', 'arg0')]) ## ssid.h: ns3::SsidValue::SsidValue() [constructor] cls.add_constructor([]) ## ssid.h: ns3::SsidValue::SsidValue(ns3::Ssid const & value) [constructor] @@ -1165,6 +1144,7 @@ def register_Ns3SsidValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ThreeLogDistancePropagationLossModel_methods(root_module, cls): @@ -1183,10 +1163,6 @@ def register_Ns3ThreeLogDistancePropagationLossModel_methods(root_module, cls): return def register_Ns3WifiMac_methods(root_module, cls): - ## wifi-mac.h: ns3::WifiMac::WifiMac(ns3::WifiMac const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiMac const &', 'arg0')]) - ## wifi-mac.h: ns3::WifiMac::WifiMac() [constructor] - cls.add_constructor([]) ## wifi-mac.h: static ns3::TypeId ns3::WifiMac::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1336,18 +1312,16 @@ def register_Ns3WifiMac_methods(root_module, cls): 'void', [param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'linkDown')], is_pure_virtual=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3WifiModeChecker_methods(root_module, cls): - ## wifi-mode.h: ns3::WifiModeChecker::WifiModeChecker(ns3::WifiModeChecker const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiModeChecker const &', 'arg0')]) - ## wifi-mode.h: ns3::WifiModeChecker::WifiModeChecker() [constructor] cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3WifiModeValue_methods(root_module, cls): - ## wifi-mode.h: ns3::WifiModeValue::WifiModeValue(ns3::WifiModeValue const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiModeValue const &', 'arg0')]) ## wifi-mode.h: ns3::WifiModeValue::WifiModeValue() [constructor] cls.add_constructor([]) ## wifi-mode.h: ns3::WifiModeValue::WifiModeValue(ns3::WifiMode const & value) [constructor] @@ -1376,11 +1350,10 @@ def register_Ns3WifiModeValue_methods(root_module, cls): 'bool', [param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')], is_virtual=True) + cls.add_copy_constructor() return def register_Ns3WifiPhy_methods(root_module, cls): - ## wifi-phy.h: ns3::WifiPhy::WifiPhy(ns3::WifiPhy const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiPhy const &', 'arg0')]) ## wifi-phy.h: static ns3::TypeId ns3::WifiPhy::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1528,11 +1501,10 @@ def register_Ns3WifiPhy_methods(root_module, cls): 'ns3::WifiMode', [], is_static=True) + cls.add_copy_constructor() return def register_Ns3WifiRemoteStationManager_methods(root_module, cls): - ## wifi-remote-station-manager.h: ns3::WifiRemoteStationManager::WifiRemoteStationManager(ns3::WifiRemoteStationManager const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiRemoteStationManager const &', 'arg0')]) ## wifi-remote-station-manager.h: static ns3::TypeId ns3::WifiRemoteStationManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -1637,6 +1609,7 @@ def register_Ns3WifiRemoteStationManager_methods(root_module, cls): 'ns3::WifiRemoteStation *', [], is_pure_virtual=True, visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3YansWifiPhy_methods(root_module, cls): @@ -1850,8 +1823,6 @@ def register_Ns3YansWifiPhy_methods(root_module, cls): return def register_Ns3AarfWifiRemoteStation_methods(root_module, cls): - ## aarf-wifi-manager.h: ns3::AarfWifiRemoteStation::AarfWifiRemoteStation(ns3::AarfWifiRemoteStation const & arg0) [copy constructor] - cls.add_constructor([param('ns3::AarfWifiRemoteStation const &', 'arg0')]) ## aarf-wifi-manager.h: ns3::AarfWifiRemoteStation::AarfWifiRemoteStation(ns3::Ptr stations, uint32_t minTimerThreshold, uint32_t minSuccessThreshold, double successK, uint32_t maxSuccessThreshold, double timerK) [constructor] cls.add_constructor([param('ns3::Ptr< ns3::AarfWifiManager >', 'stations'), param('uint32_t', 'minTimerThreshold'), param('uint32_t', 'minSuccessThreshold'), param('double', 'successK'), param('uint32_t', 'maxSuccessThreshold'), param('double', 'timerK')]) ## aarf-wifi-manager.h: void ns3::AarfWifiRemoteStation::ReportRecoveryFailure() [member function] @@ -1864,6 +1835,7 @@ def register_Ns3AarfWifiRemoteStation_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3AdhocWifiMac_methods(root_module, cls): @@ -2007,8 +1979,6 @@ def register_Ns3AdhocWifiMac_methods(root_module, cls): return def register_Ns3AmrrWifiManager_methods(root_module, cls): - ## amrr-wifi-manager.h: ns3::AmrrWifiManager::AmrrWifiManager(ns3::AmrrWifiManager const & arg0) [copy constructor] - cls.add_constructor([param('ns3::AmrrWifiManager const &', 'arg0')]) ## amrr-wifi-manager.h: static ns3::TypeId ns3::AmrrWifiManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2021,11 +1991,10 @@ def register_Ns3AmrrWifiManager_methods(root_module, cls): 'ns3::WifiRemoteStation *', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ArfWifiManager_methods(root_module, cls): - ## arf-wifi-manager.h: ns3::ArfWifiManager::ArfWifiManager(ns3::ArfWifiManager const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ArfWifiManager const &', 'arg0')]) ## arf-wifi-manager.h: static ns3::TypeId ns3::ArfWifiManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2038,11 +2007,10 @@ def register_Ns3ArfWifiManager_methods(root_module, cls): 'ns3::WifiRemoteStation *', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ConstantRateWifiManager_methods(root_module, cls): - ## constant-rate-wifi-manager.h: ns3::ConstantRateWifiManager::ConstantRateWifiManager(ns3::ConstantRateWifiManager const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ConstantRateWifiManager const &', 'arg0')]) ## constant-rate-wifi-manager.h: static ns3::TypeId ns3::ConstantRateWifiManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2065,11 +2033,10 @@ def register_Ns3ConstantRateWifiManager_methods(root_module, cls): 'ns3::WifiRemoteStation *', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3ConstantSpeedPropagationDelayModel_methods(root_module, cls): - ## propagation-delay-model.h: ns3::ConstantSpeedPropagationDelayModel::ConstantSpeedPropagationDelayModel(ns3::ConstantSpeedPropagationDelayModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ConstantSpeedPropagationDelayModel const &', 'arg0')]) ## propagation-delay-model.h: static ns3::TypeId ns3::ConstantSpeedPropagationDelayModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2091,13 +2058,10 @@ def register_Ns3ConstantSpeedPropagationDelayModel_methods(root_module, cls): 'double', [], is_const=True) + cls.add_copy_constructor() return def register_Ns3ErrorRateModel_methods(root_module, cls): - ## error-rate-model.h: ns3::ErrorRateModel::ErrorRateModel(ns3::ErrorRateModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::ErrorRateModel const &', 'arg0')]) - ## error-rate-model.h: ns3::ErrorRateModel::ErrorRateModel() [constructor] - cls.add_constructor([]) ## error-rate-model.h: static ns3::TypeId ns3::ErrorRateModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2113,6 +2077,8 @@ def register_Ns3ErrorRateModel_methods(root_module, cls): 'double', [param('ns3::WifiMode', 'mode'), param('double', 'snr'), param('uint32_t', 'nbits')], is_pure_virtual=True, is_const=True, is_virtual=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3FriisPropagationLossModel_methods(root_module, cls): @@ -2162,8 +2128,6 @@ def register_Ns3FriisPropagationLossModel_methods(root_module, cls): return def register_Ns3IdealWifiManager_methods(root_module, cls): - ## ideal-wifi-manager.h: ns3::IdealWifiManager::IdealWifiManager(ns3::IdealWifiManager const & arg0) [copy constructor] - cls.add_constructor([param('ns3::IdealWifiManager const &', 'arg0')]) ## ideal-wifi-manager.h: static ns3::TypeId ns3::IdealWifiManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2190,6 +2154,7 @@ def register_Ns3IdealWifiManager_methods(root_module, cls): 'ns3::WifiRemoteStation *', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3JakesPropagationLossModel_methods(root_module, cls): @@ -2553,8 +2518,6 @@ def register_Ns3NqstaWifiMac_methods(root_module, cls): return def register_Ns3OnoeWifiManager_methods(root_module, cls): - ## onoe-wifi-manager.h: ns3::OnoeWifiManager::OnoeWifiManager(ns3::OnoeWifiManager const & arg0) [copy constructor] - cls.add_constructor([param('ns3::OnoeWifiManager const &', 'arg0')]) ## onoe-wifi-manager.h: static ns3::TypeId ns3::OnoeWifiManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2567,11 +2530,10 @@ def register_Ns3OnoeWifiManager_methods(root_module, cls): 'ns3::WifiRemoteStation *', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3RraaWifiManager_methods(root_module, cls): - ## rraa-wifi-manager.h: ns3::RraaWifiManager::RraaWifiManager(ns3::RraaWifiManager const & arg0) [copy constructor] - cls.add_constructor([param('ns3::RraaWifiManager const &', 'arg0')]) ## rraa-wifi-manager.h: static ns3::TypeId ns3::RraaWifiManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2598,23 +2560,20 @@ def register_Ns3RraaWifiManager_methods(root_module, cls): 'ns3::WifiRemoteStation *', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3WifiChannel_methods(root_module, cls): - ## wifi-channel.h: ns3::WifiChannel::WifiChannel(ns3::WifiChannel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiChannel const &', 'arg0')]) - ## wifi-channel.h: ns3::WifiChannel::WifiChannel() [constructor] - cls.add_constructor([]) ## wifi-channel.h: static ns3::TypeId ns3::WifiChannel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', [], is_static=True) + cls.add_constructor([]) + cls.add_copy_constructor() return def register_Ns3WifiNetDevice_methods(root_module, cls): - ## wifi-net-device.h: ns3::WifiNetDevice::WifiNetDevice(ns3::WifiNetDevice const & arg0) [copy constructor] - cls.add_constructor([param('ns3::WifiNetDevice const &', 'arg0')]) ## wifi-net-device.h: static ns3::TypeId ns3::WifiNetDevice::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2779,11 +2738,10 @@ def register_Ns3WifiNetDevice_methods(root_module, cls): 'void', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_Ns3YansErrorRateModel_methods(root_module, cls): - ## yans-error-rate-model.h: ns3::YansErrorRateModel::YansErrorRateModel(ns3::YansErrorRateModel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::YansErrorRateModel const &', 'arg0')]) ## yans-error-rate-model.h: static ns3::TypeId ns3::YansErrorRateModel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2796,11 +2754,10 @@ def register_Ns3YansErrorRateModel_methods(root_module, cls): 'double', [param('ns3::WifiMode', 'mode'), param('double', 'snr'), param('uint32_t', 'nbits')], is_const=True, is_virtual=True) + cls.add_copy_constructor() return def register_Ns3YansWifiChannel_methods(root_module, cls): - ## yans-wifi-channel.h: ns3::YansWifiChannel::YansWifiChannel(ns3::YansWifiChannel const & arg0) [copy constructor] - cls.add_constructor([param('ns3::YansWifiChannel const &', 'arg0')]) ## yans-wifi-channel.h: static ns3::TypeId ns3::YansWifiChannel::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2835,11 +2792,10 @@ def register_Ns3YansWifiChannel_methods(root_module, cls): 'void', [param('ns3::Ptr< ns3::YansWifiPhy >', 'sender'), param('ns3::Ptr< ns3::Packet const >', 'packet'), param('double', 'txPowerDbm'), param('ns3::WifiMode', 'wifiMode'), param('ns3::WifiPreamble', 'preamble')], is_const=True) + cls.add_copy_constructor() return def register_Ns3AarfWifiManager_methods(root_module, cls): - ## aarf-wifi-manager.h: ns3::AarfWifiManager::AarfWifiManager(ns3::AarfWifiManager const & arg0) [copy constructor] - cls.add_constructor([param('ns3::AarfWifiManager const &', 'arg0')]) ## aarf-wifi-manager.h: static ns3::TypeId ns3::AarfWifiManager::GetTypeId() [member function] cls.add_method('GetTypeId', 'ns3::TypeId', @@ -2852,6 +2808,7 @@ def register_Ns3AarfWifiManager_methods(root_module, cls): 'ns3::WifiRemoteStation *', [], visibility='private', is_virtual=True) + cls.add_copy_constructor() return def register_functions(root_module): diff --git a/examples/csma-bridge-one-hop.cc b/examples/csma-bridge-one-hop.cc index e9876cffe..daa060f24 100644 --- a/examples/csma-bridge-one-hop.cc +++ b/examples/csma-bridge-one-hop.cc @@ -94,7 +94,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // // Allow the user to override any of the defaults and the above Bind() at diff --git a/examples/csma-bridge.cc b/examples/csma-bridge.cc index 4d99b4e24..38996aa83 100644 --- a/examples/csma-bridge.cc +++ b/examples/csma-bridge.cc @@ -56,7 +56,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // // Allow the user to override any of the defaults and the above Bind() at diff --git a/examples/csma-bridge.py b/examples/csma-bridge.py index 0c8e8e3aa..5536cd819 100644 --- a/examples/csma-bridge.py +++ b/examples/csma-bridge.py @@ -35,7 +35,8 @@ def main(argv): # # Make the random number generators generate reproducible results. # - ns3.RandomVariable.UseGlobalSeed(1, 1, 2, 3, 5, 8) + seed = array([1, 1, 2, 3, 5, 8]); + ns3.SeedManager.SetSeed(seed) # # Allow the user to override any of the defaults and the above Bind() at diff --git a/examples/csma-broadcast.cc b/examples/csma-broadcast.cc index 64c20645d..10ca74085 100644 --- a/examples/csma-broadcast.cc +++ b/examples/csma-broadcast.cc @@ -54,7 +54,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // Allow the user to override any of the defaults and the above // Bind()s at run-time, via command-line arguments diff --git a/examples/csma-multicast.cc b/examples/csma-multicast.cc index a50045b17..a75ab7442 100644 --- a/examples/csma-multicast.cc +++ b/examples/csma-multicast.cc @@ -53,8 +53,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); - + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // // Set up default values for the simulation. // diff --git a/examples/csma-one-subnet.cc b/examples/csma-one-subnet.cc index ea74763c8..da25aace4 100644 --- a/examples/csma-one-subnet.cc +++ b/examples/csma-one-subnet.cc @@ -50,7 +50,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // // Allow the user to override any of the defaults and the above Bind() at // run-time, via command-line arguments diff --git a/examples/csma-packet-socket.cc b/examples/csma-packet-socket.cc index cb63e9933..76e09042a 100644 --- a/examples/csma-packet-socket.cc +++ b/examples/csma-packet-socket.cc @@ -60,8 +60,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); - + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); CommandLine cmd; cmd.Parse (argc, argv); diff --git a/examples/csma-ping.cc b/examples/csma-ping.cc index ffddd9c6f..bb002ecd8 100644 --- a/examples/csma-ping.cc +++ b/examples/csma-ping.cc @@ -59,7 +59,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); CommandLine cmd; cmd.Parse (argc, argv); diff --git a/examples/csma-raw-ip-socket.cc b/examples/csma-raw-ip-socket.cc index 37f4dab51..acef42bea 100644 --- a/examples/csma-raw-ip-socket.cc +++ b/examples/csma-raw-ip-socket.cc @@ -57,7 +57,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); CommandLine cmd; cmd.Parse (argc, argv); diff --git a/examples/csma-star.cc b/examples/csma-star.cc index 210b478da..158699d6d 100644 --- a/examples/csma-star.cc +++ b/examples/csma-star.cc @@ -49,7 +49,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // // Set up some default values for the simulation. diff --git a/examples/first.cc b/examples/first.cc index a195d9ae7..95696583e 100644 --- a/examples/first.cc +++ b/examples/first.cc @@ -29,7 +29,8 @@ main (int argc, char *argv[]) LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); NodeContainer nodes; nodes.Create (2); diff --git a/examples/global-routing-slash32.cc b/examples/global-routing-slash32.cc index 793d2ac17..70e90dca0 100644 --- a/examples/global-routing-slash32.cc +++ b/examples/global-routing-slash32.cc @@ -40,7 +40,8 @@ main (int argc, char *argv[]) { // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // Allow the user to override any of the defaults and the above // DefaultValue::Bind ()s at run-time, via command-line arguments diff --git a/examples/realtime-udp-echo.cc b/examples/realtime-udp-echo.cc index 7018f4b36..524838e91 100644 --- a/examples/realtime-udp-echo.cc +++ b/examples/realtime-udp-echo.cc @@ -40,8 +40,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); - + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // // Allow the user to override any of the defaults and the above Bind() at // run-time, via command-line arguments diff --git a/examples/second.cc b/examples/second.cc index 7bfbea698..e603ffd50 100644 --- a/examples/second.cc +++ b/examples/second.cc @@ -39,7 +39,8 @@ main (int argc, char *argv[]) LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); uint32_t nCsma = 3; CommandLine cmd; diff --git a/examples/simple-alternate-routing.cc b/examples/simple-alternate-routing.cc index e8360e7ef..42b1d29f1 100644 --- a/examples/simple-alternate-routing.cc +++ b/examples/simple-alternate-routing.cc @@ -60,7 +60,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("300b/s")); diff --git a/examples/simple-error-model.cc b/examples/simple-error-model.cc index 10a48c05b..cb339a5a7 100644 --- a/examples/simple-error-model.cc +++ b/examples/simple-error-model.cc @@ -62,7 +62,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // Set a few attributes Config::SetDefault ("ns3::RateErrorModel::ErrorRate", DoubleValue (0.01)); diff --git a/examples/simple-global-routing.cc b/examples/simple-global-routing.cc index a0ddb0d7a..8c1fe135c 100644 --- a/examples/simple-global-routing.cc +++ b/examples/simple-global-routing.cc @@ -64,7 +64,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // Set up some default values for the simulation. Use the Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); diff --git a/examples/simple-point-to-point-olsr.cc b/examples/simple-point-to-point-olsr.cc index 5079706ed..d709a11e3 100644 --- a/examples/simple-point-to-point-olsr.cc +++ b/examples/simple-point-to-point-olsr.cc @@ -63,7 +63,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // Set up some default values for the simulation. Use the diff --git a/examples/star.cc b/examples/star.cc index 1cc58457d..fae0ddc52 100644 --- a/examples/star.cc +++ b/examples/star.cc @@ -43,7 +43,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // // Set up some default values for the simulation. diff --git a/examples/static-routing-slash32.cc b/examples/static-routing-slash32.cc index f5341a24a..d17b8aa50 100644 --- a/examples/static-routing-slash32.cc +++ b/examples/static-routing-slash32.cc @@ -39,7 +39,8 @@ main (int argc, char *argv[]) { // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // Allow the user to override any of the defaults and the above // DefaultValue::Bind ()s at run-time, via command-line arguments diff --git a/examples/tcp-large-transfer.cc b/examples/tcp-large-transfer.cc index 4a4d294f3..e704d0e1b 100644 --- a/examples/tcp-large-transfer.cc +++ b/examples/tcp-large-transfer.cc @@ -70,7 +70,8 @@ int main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // Allow the user to override any of the defaults and the above // Bind()s at run-time, via command-line arguments diff --git a/examples/tcp-nsc-lfn.cc b/examples/tcp-nsc-lfn.cc index a57e2b633..25e38a635 100644 --- a/examples/tcp-nsc-lfn.cc +++ b/examples/tcp-nsc-lfn.cc @@ -46,7 +46,8 @@ NS_LOG_COMPONENT_DEFINE ("TcpNscLfn"); int main (int argc, char *argv[]) { - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (4096)); Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("6Mbps")); diff --git a/examples/tcp-nsc-zoo.cc b/examples/tcp-nsc-zoo.cc index e02a5b1b1..71ed7c495 100644 --- a/examples/tcp-nsc-zoo.cc +++ b/examples/tcp-nsc-zoo.cc @@ -47,7 +47,8 @@ int main(int argc, char *argv[]) unsigned int MaxNodes = 4; unsigned int runtime = 3; - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (2048)); Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("8kbps")); diff --git a/examples/tcp-star-server.cc b/examples/tcp-star-server.cc index ca79d681e..70d0d91f7 100644 --- a/examples/tcp-star-server.cc +++ b/examples/tcp-star-server.cc @@ -71,7 +71,8 @@ main (int argc, char *argv[]) // // Make the random number generators generate reproducible results. // - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); // Set up some default values for the simulation. Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (250)); diff --git a/examples/third.cc b/examples/third.cc index dbf652f29..1333db022 100644 --- a/examples/third.cc +++ b/examples/third.cc @@ -43,7 +43,8 @@ main (int argc, char *argv[]) LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); uint32_t nCsma = 3; uint32_t nWifi = 3; diff --git a/examples/wifi-wired-bridging.cc b/examples/wifi-wired-bridging.cc index 9eacb9ca4..8f88da8c8 100644 --- a/examples/wifi-wired-bridging.cc +++ b/examples/wifi-wired-bridging.cc @@ -63,7 +63,8 @@ int main (int argc, char *argv[]) uint32_t nStas = 2; bool sendIp = true; - RandomVariable::UseGlobalSeed (1, 1, 2, 3, 5, 8); + uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; + SeedManager::SetSeed(seed); CommandLine cmd; cmd.AddValue ("nWifis", "Number of wifi networks", nWifis); diff --git a/src/core/random-variable.cc b/src/core/random-variable.cc index 86c7d5f5b..3395db8ed 100644 --- a/src/core/random-variable.cc +++ b/src/core/random-variable.cc @@ -16,6 +16,7 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Author: Rajib Bhattacharjea +// Author: Hadi Arbabi // #include @@ -40,6 +41,78 @@ using namespace std; namespace ns3{ +//----------------------------------------------------------------------------- +// Seed Manager +//----------------------------------------------------------------------------- + +uint32_t SeedManager::seed_[6]={1,2,3,4,5,6}; +bool SeedManager::seedSet=false; +uint32_t SeedManager::runNumber=0; + +void SeedManager::SetSeed(uint32_t seed[6]) +{ + if (SeedManager::seedSet) + { + cerr << "Seed Manager already set!" << endl; + cerr << "Call to SeedManager::SetSeed(...) ignored" << endl; + return; + } + SeedManager::seed_[0]=seed[0]; + SeedManager::seed_[1]=seed[1]; + SeedManager::seed_[2]=seed[2]; + SeedManager::seed_[3]=seed[3]; + SeedManager::seed_[4]=seed[4]; + SeedManager::seed_[5]=seed[5]; + if (!RngStream::CheckSeed(SeedManager::seed_)) + NS_FATAL_ERROR("Invalid seed"); + + SeedManager::seedSet = true; +} + +void SeedManager::GetSeed(uint32_t seed[6]) +{ + for (int i=0; i<6; i++) + { + seed[i] = seed_[i]; + } +} + +void SeedManager::SetSeed(uint32_t seed) +{ + uint32_t s[6]; + s[0]=s[1]=s[2]=s[3]=s[4]=s[5]=seed; + SetSeed(s); +} + +uint32_t SeedManager::GetSeed() +{ + uint32_t s[6]; + GetSeed(s); + return s[0]; +} + +void SeedManager::SetRun(uint32_t run) +{ + runNumber=run; +} + +uint32_t SeedManager::GetRun() +{ + return runNumber; +} + +bool SeedManager::CheckSeed (uint32_t seed) +{ + uint32_t s[6]; + s[0]=s[1]=s[2]=s[3]=s[4]=s[5]=seed; + return RngStream::CheckSeed(s); +} + +bool SeedManager::CheckSeed (uint32_t seed[6]) +{ + return RngStream::CheckSeed(seed); +} + //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // RandomVariableBase methods @@ -54,63 +127,24 @@ public: virtual double GetValue() = 0; virtual uint32_t GetInteger(); virtual RandomVariableBase* Copy(void) const = 0; - virtual void GetSeed(uint32_t seed[6]); - static void UseDevRandom(bool udr = true); - static void UseGlobalSeed(uint32_t s0, uint32_t s1, uint32_t s2, - uint32_t s3, uint32_t s4, uint32_t s5); - static void SetRunNumber(uint32_t n); -private: - static void GetRandomSeeds(uint32_t seeds[6]); -private: - static bool useDevRandom; // True if using /dev/random desired - static bool globalSeedSet; // True if global seed has been specified - static int devRandom; // File handle for /dev/random - static uint32_t globalSeed[6]; // The global seed to use - friend class RandomVariableInitializer; protected: - static unsigned long heuristic_sequence; - static RngStream* m_static_generator; - static uint32_t runNumber; static void Initialize(); // Initialize the RNG system static bool initialized; // True if package seed is set RngStream* m_generator; //underlying generator being wrapped }; - - bool RandomVariableBase::initialized = false; // True if RngStream seed set -bool RandomVariableBase::useDevRandom = false; // True if use /dev/random -bool RandomVariableBase::globalSeedSet = false; // True if GlobalSeed called -int RandomVariableBase::devRandom = -1; -uint32_t RandomVariableBase::globalSeed[6]; -unsigned long RandomVariableBase::heuristic_sequence; -RngStream* RandomVariableBase::m_static_generator = 0; -uint32_t RandomVariableBase::runNumber = 0; -//the static object random_variable_initializer initializes the static members -//of RandomVariable -static class RandomVariableInitializer -{ - public: - RandomVariableInitializer() - { -// RandomVariableBase::Initialize(); // sets the static package seed -// RandomVariableBase::m_static_generator = new RngStream(); -// RandomVariableBase::m_static_generator->InitializeStream(); - } - ~RandomVariableInitializer() - { - delete RandomVariableBase::m_static_generator; - } -} random_variable_initializer; RandomVariableBase::RandomVariableBase() : m_generator(NULL) { -// m_generator = new RngStream(); -// m_generator->InitializeStream(); -// m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + // it's better to be initialzed first and then set run number, + // it happens in GetValue() automatically + //m_generator = new RngStream(); + //m_generator->InitializeStream(); + //m_generator->ResetNthSubstream(SeedManager::GetRun()); } RandomVariableBase::RandomVariableBase(const RandomVariableBase& r) @@ -132,115 +166,16 @@ uint32_t RandomVariableBase::GetInteger() return (uint32_t)GetValue(); } -void RandomVariableBase::UseDevRandom(bool udr) -{ - RandomVariableBase::useDevRandom = udr; -} - -void RandomVariableBase::GetSeed(uint32_t seed[6]) -{ - if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); - } - m_generator->GetState(seed); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// RandomVariableBase static methods -void RandomVariableBase::UseGlobalSeed(uint32_t s0, uint32_t s1, uint32_t s2, - uint32_t s3, uint32_t s4, uint32_t s5) -{ - if (RandomVariableBase::globalSeedSet) - { - NS_FATAL_ERROR ("Random number generator already initialized! " - "Call to RandomVariableBase::UseGlobalSeed() ignored"); - } - RandomVariableBase::globalSeed[0] = s0; - RandomVariableBase::globalSeed[1] = s1; - RandomVariableBase::globalSeed[2] = s2; - RandomVariableBase::globalSeed[3] = s3; - RandomVariableBase::globalSeed[4] = s4; - RandomVariableBase::globalSeed[5] = s5; - if (!RngStream::CheckSeed(RandomVariableBase::globalSeed)) - NS_FATAL_ERROR("Invalid seed"); - - RandomVariableBase::globalSeedSet = true; -} - void RandomVariableBase::Initialize() { + uint32_t s[6]; if (RandomVariableBase::initialized) return; // Already initialized and seeded RandomVariableBase::initialized = true; - if (!RandomVariableBase::globalSeedSet) - { // No global seed, try a random one - GetRandomSeeds(globalSeed); - } - // Seed the RngStream package - RngStream::SetPackageSeed(globalSeed); + SeedManager::GetSeed(s); + RngStream::SetPackageSeed(s); } -void RandomVariableBase::GetRandomSeeds(uint32_t seeds[6]) -{ - // Check if /dev/random exists - if (RandomVariableBase::useDevRandom && RandomVariableBase::devRandom < 0) - { - RandomVariableBase::devRandom = open("/dev/random", O_RDONLY); - } - if (RandomVariableBase::devRandom > 0) - { // Use /dev/random - while(true) - { - for (int i = 0; i < 6; ++i) - { - ssize_t bytes_read = read (RandomVariableBase::devRandom, - &seeds[i], sizeof (seeds[i])); - if (bytes_read != sizeof (seeds[i])) - { - NS_FATAL_ERROR ("Read from /dev/random failed"); - } - } - if (RngStream::CheckSeed(seeds)) break; // Got a valid one - } - } - else - { // Seed from time of day (code borrowed from ns2 random seeding) - // Thanks to John Heidemann for this technique - while(true) - { - timeval tv; - gettimeofday(&tv, 0); - seeds[0] = (tv.tv_sec^tv.tv_usec^(++heuristic_sequence <<8)) - & 0x7fffffff; - gettimeofday(&tv, 0); - seeds[1] = (tv.tv_sec^tv.tv_usec^(++heuristic_sequence <<8)) - & 0x7fffffff; - gettimeofday(&tv, 0); - seeds[2] = (tv.tv_sec^tv.tv_usec^(++heuristic_sequence <<8)) - & 0x7fffffff; - gettimeofday(&tv, 0); - seeds[3] = (tv.tv_sec^tv.tv_usec^(++heuristic_sequence <<8)) - & 0x7fffffff; - gettimeofday(&tv, 0); - seeds[4] = (tv.tv_sec^tv.tv_usec^(++heuristic_sequence <<8)) - & 0x7fffffff; - gettimeofday(&tv, 0); - seeds[5] = (tv.tv_sec^tv.tv_usec^(++heuristic_sequence <<8)) - & 0x7fffffff; - if (RngStream::CheckSeed(seeds)) break; // Got a valid one - } - } -} - -void RandomVariableBase::SetRunNumber(uint32_t n) -{ - runNumber = n; -} - - +//------------------------------------------------------- RandomVariable::RandomVariable() : m_variable (0) @@ -277,33 +212,14 @@ RandomVariable::GetInteger (void) const { return m_variable->GetInteger (); } -void -RandomVariable::GetSeed(uint32_t seed[6]) const -{ - return m_variable->GetSeed (seed); -} -void -RandomVariable::UseDevRandom(bool udr) -{ - RandomVariableBase::UseDevRandom (udr); -} -void -RandomVariable::UseGlobalSeed(uint32_t s0, uint32_t s1, uint32_t s2, - uint32_t s3, uint32_t s4, uint32_t s5) -{ - RandomVariableBase::UseGlobalSeed (s0, s1, s2, s3, s4, s5); -} -void -RandomVariable::SetRunNumber(uint32_t n) -{ - RandomVariableBase::SetRunNumber (n); -} + RandomVariableBase * RandomVariable::Peek (void) const { return m_variable; } + ATTRIBUTE_VALUE_IMPLEMENT (RandomVariable); ATTRIBUTE_CHECKER_IMPLEMENT (RandomVariable); @@ -335,15 +251,14 @@ public: * \return A value between low and high values specified by the constructor */ virtual double GetValue(); + + /** + * \return A value between low and high values specified by parameters + */ + virtual double GetValue(double s, double l); + virtual RandomVariableBase* Copy(void) const; -public: - /** - * \param s Low end of the range - * \param l High end of the range - * \return A uniformly distributed random number between s and l - */ - static double GetSingleValue(double s, double l); private: double m_min; double m_max; @@ -380,37 +295,46 @@ double UniformVariableImpl::GetValue() { m_generator = new RngStream(); m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + m_generator->ResetNthSubstream(SeedManager::GetRun()); } return m_min + m_generator->RandU01() * (m_max - m_min); } +double UniformVariableImpl::GetValue(double s, double l) +{ + if(!RandomVariableBase::initialized) + { + RandomVariableBase::Initialize(); + } + if(!m_generator) + { + m_generator = new RngStream(); + m_generator->InitializeStream(); + m_generator->ResetNthSubstream(SeedManager::GetRun()); + } + return s + m_generator->RandU01() * (l-s); +} + RandomVariableBase* UniformVariableImpl::Copy() const { return new UniformVariableImpl(*this); } -double UniformVariableImpl::GetSingleValue(double s, double l) -{ - if(!RandomVariableBase::m_static_generator) - { - RandomVariableBase::Initialize(); // sets the static package seed - RandomVariableBase::m_static_generator = new RngStream(); - RandomVariableBase::m_static_generator->InitializeStream(); - } - return s + m_static_generator->RandU01() * (l - s);; -} - UniformVariable::UniformVariable() : RandomVariable (UniformVariableImpl ()) {} UniformVariable::UniformVariable(double s, double l) : RandomVariable (UniformVariableImpl (s, l)) {} -double -UniformVariable::GetSingleValue(double s, double l) + +double UniformVariable::GetValue() { - return UniformVariableImpl::GetSingleValue (s, l); + return Peek()->GetValue(); +} + +double UniformVariable::GetValue(double s, double l) +{ + return ((UniformVariableImpl*)Peek())->GetValue(s,l); } @@ -623,13 +547,7 @@ public: */ virtual double GetValue(); virtual RandomVariableBase* Copy(void) const; -public: - /** - * \param m The mean of the distribution from which the return value is drawn - * \param b The upper bound value desired, beyond which values get clipped - * \return A random number from an exponential distribution with mean m - */ - static double GetSingleValue(double m, double b=0); + private: double m_mean; // Mean value of RV double m_bound; // Upper bound on value (if non-zero) @@ -657,7 +575,7 @@ double ExponentialVariableImpl::GetValue() { m_generator = new RngStream(); m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + m_generator->ResetNthSubstream(SeedManager::GetRun()); } double r = -m_mean*log(m_generator->RandU01()); if (m_bound != 0 && r > m_bound) return m_bound; @@ -668,18 +586,6 @@ RandomVariableBase* ExponentialVariableImpl::Copy() const { return new ExponentialVariableImpl(*this); } -double ExponentialVariableImpl::GetSingleValue(double m, double b/*=0*/) -{ - if(!RandomVariableBase::m_static_generator) - { - RandomVariableBase::Initialize(); // sets the static package seed - RandomVariableBase::m_static_generator = new RngStream(); - RandomVariableBase::m_static_generator->InitializeStream(); - } - double r = -m*log(m_static_generator->RandU01()); - if (b != 0 && r > b) return b; - return r; -} ExponentialVariable::ExponentialVariable() : RandomVariable (ExponentialVariableImpl ()) @@ -690,11 +596,6 @@ ExponentialVariable::ExponentialVariable(double m) ExponentialVariable::ExponentialVariable(double m, double b) : RandomVariable (ExponentialVariableImpl (m, b)) {} -double -ExponentialVariable::GetSingleValue(double m, double b) -{ - return ExponentialVariableImpl::GetSingleValue (m, b); -} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -743,17 +644,7 @@ public: */ virtual double GetValue(); virtual RandomVariableBase* Copy() const; -public: - /** - * \param m The mean value of the distribution from which the return value - * is drawn. - * \param s The shape parameter of the distribution from which the return - * value is drawn. - * \param b The upper bound to which to restrict return values - * \return A random number from a Pareto distribution with mean m and shape - * parameter s. - */ - static double GetSingleValue(double m, double s, double b=0); + private: double m_mean; // Mean value of RV double m_shape; // Shape parameter @@ -786,7 +677,7 @@ double ParetoVariableImpl::GetValue() { m_generator = new RngStream(); m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + m_generator->ResetNthSubstream(SeedManager::GetRun()); } double scale = m_mean * ( m_shape - 1.0) / m_shape; double r = (scale * ( 1.0 / pow(m_generator->RandU01(), 1.0 / m_shape))); @@ -799,20 +690,6 @@ RandomVariableBase* ParetoVariableImpl::Copy() const return new ParetoVariableImpl(*this); } -double ParetoVariableImpl::GetSingleValue(double m, double s, double b/*=0*/) -{ - if(!RandomVariableBase::m_static_generator) - { - RandomVariableBase::Initialize(); // sets the static package seed - RandomVariableBase::m_static_generator = new RngStream(); - RandomVariableBase::m_static_generator->InitializeStream(); - } - double scale = m * ( s - 1.0) / s; - double r = (scale * ( 1.0 / pow(m_static_generator->RandU01(), 1.0 / s))); - if (b != 0 && r > b) return b; - return r; -} - ParetoVariable::ParetoVariable () : RandomVariable (ParetoVariableImpl ()) {} @@ -825,11 +702,6 @@ ParetoVariable::ParetoVariable(double m, double s) ParetoVariable::ParetoVariable(double m, double s, double b) : RandomVariable (ParetoVariableImpl (m, s, b)) {} -double -ParetoVariable::GetSingleValue(double m, double s, double b) -{ - return ParetoVariableImpl::GetSingleValue (m, s, b); -} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -879,14 +751,7 @@ public: */ virtual double GetValue(); virtual RandomVariableBase* Copy(void) const; -public: - /** - * \param m Mean value for the distribution. - * \param s Shape (alpha) parameter for the distribution. - * \param b Upper limit on returned values - * \return Random number from a distribution specified by m,s, and b - */ - static double GetSingleValue(double m, double s, double b=0); + private: double m_mean; // Mean value of RV double m_alpha; // Shape parameter @@ -914,7 +779,7 @@ double WeibullVariableImpl::GetValue() { m_generator = new RngStream(); m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + m_generator->ResetNthSubstream(SeedManager::GetRun()); } double exponent = 1.0 / m_alpha; double r = m_mean * pow( -log(m_generator->RandU01()), exponent); @@ -927,20 +792,6 @@ RandomVariableBase* WeibullVariableImpl::Copy() const return new WeibullVariableImpl(*this); } -double WeibullVariableImpl::GetSingleValue(double m, double s, double b/*=0*/) -{ - if(!RandomVariableBase::m_static_generator) - { - RandomVariableBase::Initialize(); // sets the static package seed - RandomVariableBase::m_static_generator = new RngStream(); - RandomVariableBase::m_static_generator->InitializeStream(); - } - double exponent = 1.0 / s; - double r = m * pow( -log(m_static_generator->RandU01()), exponent); - if (b != 0 && r > b) return b; - return r; -} - WeibullVariable::WeibullVariable() : RandomVariable (WeibullVariableImpl ()) {} @@ -953,11 +804,7 @@ WeibullVariable::WeibullVariable(double m, double s) WeibullVariable::WeibullVariable(double m, double s, double b) : RandomVariable (WeibullVariableImpl (m, s, b)) {} -double -WeibullVariable::GetSingleValue(double m, double s, double b) -{ - return WeibullVariableImpl::GetSingleValue (m, s, b); -} + //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // NormalVariableImpl methods @@ -987,14 +834,7 @@ public: */ virtual double GetValue(); virtual RandomVariableBase* Copy(void) const; -public: - /** - * \param m Mean value - * \param v Variance - * \param b Bound. The NormalVariableImpl is bounded within +-bound. - * \return A random number from a distribution specified by m,v, and b. - */ - static double GetSingleValue(double m, double v, double b = INFINITE_VALUE); + private: double m_mean; // Mean value of RV double m_variance; // Mean value of RV @@ -1017,7 +857,7 @@ NormalVariableImpl::NormalVariableImpl(double m, double v, double b/*=INFINITE_V NormalVariableImpl::NormalVariableImpl(const NormalVariableImpl& c) : RandomVariableBase(c), m_mean(c.m_mean), m_variance(c.m_variance), - m_bound(c.m_bound), m_nextValid(false) { } + m_bound(c.m_bound) { } double NormalVariableImpl::GetValue() { @@ -1029,7 +869,7 @@ double NormalVariableImpl::GetValue() { m_generator = new RngStream(); m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + m_generator->ResetNthSubstream(SeedManager::GetRun()); } if (m_nextValid) { // use previously generated @@ -1049,21 +889,11 @@ double NormalVariableImpl::GetValue() { // Got good pair double y = sqrt((-2 * log(w))/w); m_next = m_mean + v2 * y * sqrt(m_variance); - //if next is in bounds, it is valid - m_nextValid = fabs(m_next-m_mean) <= m_bound; + if (fabs(m_next) > m_bound) m_next = m_bound * (m_next)/fabs(m_next); + m_nextValid = true; double x1 = m_mean + v1 * y * sqrt(m_variance); - //if x1 is in bounds, return it - if (fabs(x1-m_mean) <= m_bound) - { - return x1; - } - //otherwise try and return m_next if it is valid - else if (m_nextValid) - { - m_nextValid = false; - return m_next; - } - //otherwise, just run this loop again + if (fabs(x1) > m_bound) x1 = m_bound * (x1)/fabs(x1); + return x1; } } } @@ -1073,71 +903,12 @@ RandomVariableBase* NormalVariableImpl::Copy() const return new NormalVariableImpl(*this); } -double NormalVariableImpl::GetSingleValue(double m, double v, double b) -{ - if(!RandomVariableBase::m_static_generator) - { - RandomVariableBase::Initialize(); // sets the static package seed - RandomVariableBase::m_static_generator = new RngStream(); - RandomVariableBase::m_static_generator->InitializeStream(); - } - if (m_static_nextValid) - { // use previously generated - m_static_nextValid = false; - return m_static_next; - } - while(1) - { // See Simulation Modeling and Analysis p. 466 (Averill Law) - // for algorithm; basically a Box-Muller transform: - // http://en.wikipedia.org/wiki/Box-Muller_transform - double u1 = m_static_generator->RandU01(); - double u2 = m_static_generator->RandU01();; - double v1 = 2 * u1 - 1; - double v2 = 2 * u2 - 1; - double w = v1 * v1 + v2 * v2; - if (w <= 1.0) - { // Got good pair - double y = sqrt((-2 * log(w))/w); - m_static_next = m + v2 * y * sqrt(v); - //if next is in bounds, it is valid - m_static_nextValid = fabs(m_static_next-m) <= b;; - double x1 = m + v1 * y * sqrt(v); - //if x1 is in bounds, return it - if (fabs(x1-m) <= b) - { - return x1; - } - //otherwise try and return m_next if it is valid - else if (m_static_nextValid) - { - m_static_nextValid = false; - return m_static_next; - } - //otherwise, just run this loop again - } - } -} - NormalVariable::NormalVariable() : RandomVariable (NormalVariableImpl ()) {} -NormalVariable::NormalVariable(double m, double v) - : RandomVariable (NormalVariableImpl (m, v)) -{} NormalVariable::NormalVariable(double m, double v, double b) : RandomVariable (NormalVariableImpl (m, v, b)) {} -double -NormalVariable::GetSingleValue(double m, double v) -{ - return NormalVariableImpl::GetSingleValue (m, v); -} -double -NormalVariable::GetSingleValue(double m, double v, double b) -{ - return NormalVariableImpl::GetSingleValue (m, v, b); -} - //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -1208,7 +979,7 @@ double EmpiricalVariableImpl::GetValue() { m_generator = new RngStream(); m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + m_generator->ResetNthSubstream(SeedManager::GetRun()); } if (emp.size() == 0) return 0.0; // HuH? No empirical data if (!validated) Validate(); // Insure in non-decreasing @@ -1395,13 +1166,7 @@ public: */ virtual double GetValue (); virtual RandomVariableBase* Copy(void) const; -public: - /** - * \param mu mu parameter of the underlying normal distribution - * \param sigma sigma parameter of the underlying normal distribution - * \return A random number from the distribution specified by mu and sigma - */ - static double GetSingleValue(double mu, double sigma); + private: double m_mu; double m_sigma; @@ -1455,7 +1220,7 @@ LogNormalVariableImpl::GetValue () { m_generator = new RngStream(); m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + m_generator->ResetNthSubstream(SeedManager::GetRun()); } double u, v, r2, normal, z; @@ -1478,42 +1243,9 @@ LogNormalVariableImpl::GetValue () return z; } -double LogNormalVariableImpl::GetSingleValue (double mu, double sigma) -{ - if(!RandomVariableBase::m_static_generator) - { - RandomVariableBase::Initialize(); // sets the static package seed - RandomVariableBase::m_static_generator = new RngStream(); - RandomVariableBase::m_static_generator->InitializeStream(); - } - double u, v, r2, normal, z; - do - { - /* choose x,y in uniform square (-1,-1) to (+1,+1) */ - u = -1 + 2 * m_static_generator->RandU01 (); - v = -1 + 2 * m_static_generator->RandU01 (); - - /* see if it is in the unit circle */ - r2 = u * u + v * v; - } - while (r2 > 1.0 || r2 == 0); - - normal = u * sqrt (-2.0 * log (r2) / r2); - - z = exp (sigma * normal + mu); - - return z; -} - LogNormalVariable::LogNormalVariable (double mu, double sigma) : RandomVariable (LogNormalVariableImpl (mu, sigma)) {} -double -LogNormalVariable::GetSingleValue(double mu, double sigma) -{ - return LogNormalVariableImpl::GetSingleValue (mu, sigma); -} - //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -1542,14 +1274,7 @@ public: */ virtual double GetValue(); virtual RandomVariableBase* Copy(void) const; -public: - /** - * \param s Low end of the range - * \param l High end of the range - * \param mean mean of the distribution - * \return A triangularly distributed random number between s and l - */ - static double GetSingleValue(double s, double l, double mean); + private: double m_min; double m_max; @@ -1576,7 +1301,7 @@ double TriangularVariableImpl::GetValue() { m_generator = new RngStream(); m_generator->InitializeStream(); - m_generator->ResetNthSubstream(RandomVariableBase::runNumber); + m_generator->ResetNthSubstream(SeedManager::GetRun()); } double u = m_generator->RandU01(); if(u <= (m_mode - m_min) / (m_max - m_min) ) @@ -1590,33 +1315,12 @@ RandomVariableBase* TriangularVariableImpl::Copy() const return new TriangularVariableImpl(*this); } -double TriangularVariableImpl::GetSingleValue(double s, double l, double mean) -{ - if(!RandomVariableBase::m_static_generator) - { - RandomVariableBase::Initialize(); // sets the static package seed - RandomVariableBase::m_static_generator = new RngStream(); - RandomVariableBase::m_static_generator->InitializeStream(); - } - double mode = 3.0*mean-s-l; - double u = m_static_generator->RandU01(); - if(u <= (mode - s) / (l - s) ) - return s + sqrt(u * (l - s) * (mode - s) ); - else - return l - sqrt( (1-u) * (l - s) * (l - mode) ); -} - TriangularVariable::TriangularVariable() : RandomVariable (TriangularVariableImpl ()) {} TriangularVariable::TriangularVariable(double s, double l, double mean) : RandomVariable (TriangularVariableImpl (s,l,mean)) {} -double -TriangularVariable::GetSingleValue(double s, double l, double mean) -{ - return TriangularVariableImpl::GetSingleValue (s,l,mean); -} std::ostream &operator << (std::ostream &os, const RandomVariable &var) @@ -1691,112 +1395,3 @@ std::istream &operator >> (std::istream &is, RandomVariable &var) }//namespace ns3 - -#ifdef RUN_SELF_TESTS -#include "test.h" -#include - -namespace ns3 { - - -class RandomVariableTest : public Test -{ -public: - RandomVariableTest () : Test ("RandomVariable") {} - virtual bool RunTests (void) - { - bool result = true; - const double desired_mean = 1.0; - const double desired_stddev = 1.0; - double tmp = log (1 + (desired_stddev/desired_mean)*(desired_stddev/desired_mean)); - double sigma = sqrt (tmp); - double mu = log (desired_mean) - 0.5*tmp; - - // Test a custom lognormal instance - { - LogNormalVariable lognormal (mu, sigma); - vector samples; - const int NSAMPLES = 10000; - double sum = 0; - for (int n = NSAMPLES; n; --n) - { - double value = lognormal.GetValue (); - sum += value; - samples.push_back (value); - } - double obtained_mean = sum / NSAMPLES; - sum = 0; - for (vector::iterator iter = samples.begin (); iter != samples.end (); iter++) - { - double tmp = (*iter - obtained_mean); - sum += tmp*tmp; - } - double obtained_stddev = sqrt (sum / (NSAMPLES - 1)); - - if (not (obtained_mean/desired_mean > 0.90 and obtained_mean/desired_mean < 1.10)) - { - result = false; - Failure () << "Obtained lognormal mean value " << obtained_mean << ", expected " << desired_mean << std::endl; - } - - if (not (obtained_stddev/desired_stddev > 0.90 and obtained_stddev/desired_stddev < 1.10)) - { - result = false; - Failure () << "Obtained lognormal stddev value " << obtained_stddev << - ", expected " << desired_stddev << std::endl; - } - } - - // Test GetSingleValue - { - vector samples; - const int NSAMPLES = 10000; - double sum = 0; - for (int n = NSAMPLES; n; --n) - { - double value = LogNormalVariable::GetSingleValue (mu, sigma); - sum += value; - samples.push_back (value); - } - double obtained_mean = sum / NSAMPLES; - sum = 0; - for (vector::iterator iter = samples.begin (); iter != samples.end (); iter++) - { - double tmp = (*iter - obtained_mean); - sum += tmp*tmp; - } - double obtained_stddev = sqrt (sum / (NSAMPLES - 1)); - - if (not (obtained_mean/desired_mean > 0.90 and obtained_mean/desired_mean < 1.10)) - { - result = false; - Failure () << "Obtained LogNormalVariable::GetSingleValue mean value " << obtained_mean - << ", expected " << desired_mean << std::endl; - } - - if (not (obtained_stddev/desired_stddev > 0.90 and obtained_stddev/desired_stddev < 1.10)) - { - result = false; - Failure () << "Obtained LogNormalVariable::GetSingleValue stddev value " << obtained_stddev << - ", expected " << desired_stddev << std::endl; - } - } - - // Test attribute serialization - { - RandomVariableValue val; - val.DeserializeFromString ("Uniform:0.1:0.2", MakeRandomVariableChecker ()); - RandomVariable rng = val.Get (); - NS_TEST_ASSERT_EQUAL (val.SerializeToString (MakeRandomVariableChecker ()), "Uniform:0.1:0.2"); - } - - return result; - } -}; - - -static RandomVariableTest g_random_variable_tests; - -}//namespace ns3 - -#endif /* RUN_SELF_TESTS */ diff --git a/src/core/random-variable.h b/src/core/random-variable.h index a311a2bbc..5b5b557c4 100644 --- a/src/core/random-variable.h +++ b/src/core/random-variable.h @@ -16,10 +16,11 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Author: Rajib Bhattacharjea +// Author: Hadi Arbabi // -#ifndef __random_variable_h__ -#define __random_variable_h__ +#ifndef __random_variable_h +#define __random_variable_h #include #include @@ -39,6 +40,94 @@ namespace ns3{ class RandomVariableBase; +class SeedManager +{ +private: + static uint32_t runNumber; + static bool seedSet; + static uint32_t seed_[6]; + +public: + + /** + * \brief set the seed + * it will duplicate the seed value 6 times + * \code + * SeedManger::SetSeed(15); + * UniformVariable x(2,3); //these will give the same output everytime + * ExponentialVariable y(120); //as long as the seed stays the same + * \endcode + * \param seed + */ + static void SetSeed (uint32_t seed); + + /** + * \brief Get the seed value + * \return seed value + */ + static uint32_t GetSeed (); + + /** + * \brief set the seed + * \code + * uint32_t seed[6]={10,5,2,3,5,11}; + * SeedManger::SetSeed(seed); + * UniformVariable x(2,3); //these will give the same output everytime + * ExponentialVariable y(120); //as long as the seed stays the same + * \endcode + * \param seed + */ + static void SetSeed (uint32_t seed[6]); + + /** + * \brief Get the seed value + * \param array of size 6 which will hold returned seed values + */ + static void GetSeed (uint32_t seed[6]); + + /** + * \brief Set the run number of simulation + * + * \code + * SeedManager::SetSeed(12); + * int N = atol(argv[1]); //read in run number from command line + * SeedManager::SetRun(N); + * UniformVariable x(0,10); + * ExponentialVariable y(2902); + * \endcode + * In this example, N could successivly be equal to 1,2,3, etc. and the user + * would continue to get independent runs out of the single simulation. For + * this simple example, the following might work: + * \code + * ./simulation 0 + * ...Results for run 0:... + * + * ./simulation 1 + * ...Results for run 1:... + * \endcode + */ + static void SetRun (uint32_t run); + + /** + * \brief Get the run number + * \return run number + */ + static uint32_t GetRun (); + + /** + * \brief Check if seed value is valid if wanted to be used as seed + * \return true if valid and false if invalid + */ + static bool CheckSeed (uint32_t seed); + + /** + * \brief Checks if seed array has valid values if wanted to be used as further seed + * \return true if valid and false if invalid + */ + static bool CheckSeed (uint32_t seed[6]); +}; + + /** * \brief The basic RNG for NS-3. * \ingroup randomvariable @@ -73,95 +162,6 @@ public: * \return Integer cast of ::GetValue() */ uint32_t GetInteger (void) const; - - /** - * \brief Get the internal state of the RNG - * - * This function is for power users who understand the inner workings - * of the underlying RngStream method used. It returns the internal - * state of the RNG via the input parameter. - * \param seed Output parameter; gets overwritten with the internal state of - * of the RNG. - */ - void GetSeed(uint32_t seed[6]) const; - - /** - * \brief Set seeding behavior - * - * Specify whether the POSIX device /dev/random is to - * be used for seeding. When this is used, the underlying - * generator is seeded with data from /dev/random instead of - * being seeded based upon the time of day. For this to be effective, - * it must be called before the creation of the first instance of a - * RandomVariable or subclass. Example: - * \code - * RandomVariable::UseDevRandom(); - * UniformVariable x(2,3); //these are seeded randomly - * ExponentialVariable y(120); //etc - * \endcode - * \param udr True if /dev/random desired. - */ - static void UseDevRandom(bool udr = true); - - /** - * \brief Use the global seed to force precisely reproducible results. - * - * It is often desirable to create a simulation that uses random - * numbers, while at the same time is completely reproducible. - * Specifying this set of six random seeds initializes the - * random number generator with the specified seed. - * Once this is set, all generators will produce fixed output - * from run to run. This is because each time a new generator is created, - * the underlying RngStream deterministically creates a new seed based upon - * the old one, hence a "stream" of RNGs. Example: - * \code - * RandomVariable::UseGlobalSeed(...); - * UniformVariable x(2,3); //these will give the same output everytime - * ExponentialVariable y(120); //as long as the seed stays the same - * \endcode - * \param s0 - * \param s1 - * \param s2 - * \param s3 - * \param s4 - * \param s5 - * \return True if seed is valid. - */ - static void UseGlobalSeed(uint32_t s0, uint32_t s1, uint32_t s2, - uint32_t s3, uint32_t s4, uint32_t s5); - - /** - * \brief Set the run number of this simulation - * - * These RNGs have the ability to give independent sets of trials for a fixed - * global seed. For example, suppose one sets up a simulation with - * RandomVariables with a given global seed. Suppose the user wanted to - * retry the same simulation with different random values for validity, - * statistical rigor, etc. The user could either change the global seed and - * re-run the simulation, or could use this facility to increment all of the - * RNGs to a next substream state. This predictably advances the internal - * state of all RandomVariables n steps. This should be called immediately - * after the global seed is set, and before the creation of any - * RandomVariables. For example: - * \code - * RandomVariable::UseGlobalSeed(1,2,3,4,5,6); - * int N = atol(argv[1]); //read in run number from command line - * RandomVariable::SetRunNumber(N); - * UniformVariable x(0,10); - * ExponentialVariable y(2902); - * \endcode - * In this example, N could successivly be equal to 1,2,3, etc. and the user - * would continue to get independent runs out of the single simulation. For - * this simple example, the following might work: - * \code - * ./simulation 0 - * ...Results for run 0:... - * - * ./simulation 1 - * ...Results for run 1:... - * \endcode - */ - static void SetRunNumber(uint32_t n); private: friend std::ostream &operator << (std::ostream &os, const RandomVariable &var); @@ -204,13 +204,21 @@ public: * \param l High end of the range */ UniformVariable(double s, double l); -public: + /** - * \param s Low end of the range - * \param l High end of the range - * \return A uniformly distributed random number between s and l - */ - static double GetSingleValue(double s, double l); + * \brief Returns a random double with the specified range given by constructor + * \return A floating point random value + */ + double GetValue(); + + /** + * \brief Returns a random double with the specified range + * \param s Low end of the range + * \param l High end of the range + * \return A floating point random value + */ + double GetValue(double s, double l); + }; /** @@ -334,12 +342,6 @@ public: */ ExponentialVariable(double m, double b); - /** - * \param m The mean of the distribution from which the return value is drawn - * \param b The upper bound value desired, beyond which values get clipped - * \return A random number from an exponential distribution with mean m - */ - static double GetSingleValue(double m, double b=0); }; /** @@ -402,16 +404,6 @@ public: */ ParetoVariable(double m, double s, double b); - /** - * \param m The mean value of the distribution from which the return value - * is drawn. - * \param s The shape parameter of the distribution from which the return - * value is drawn. - * \param b The upper bound to which to restrict return values - * \return A random number from a Pareto distribution with mean m and shape - * parameter s. - */ - static double GetSingleValue(double m, double s, double b=0); }; /** @@ -464,13 +456,7 @@ public: * \param b Upper limit on returned values */ WeibullVariable(double m, double s, double b); - /** - * \param m Mean value for the distribution. - * \param s Shape (alpha) parameter for the distribution. - * \param b Upper limit on returned values - * \return Random number from a distribution specified by m,s, and b - */ - static double GetSingleValue(double m, double s, double b=0); + }; /** @@ -490,43 +476,20 @@ public: class NormalVariable : public RandomVariable { public: + static const double INFINITE_VALUE; /** * Constructs an normal random variable with a mean * value of 0 and variance of 1. */ NormalVariable(); - /** - * \brief Construct a normal random variable with specified mean and variance. - * \param m Mean value - * \param v Variance - */ - NormalVariable(double m, double v); - /** * \brief Construct a normal random variable with specified mean and variance * \param m Mean value * \param v Variance - * \param b Bound. The NormalVariable is bounded symetrically about the mean - * [mean-bound,mean+bound] + * \param b Bound. The NormalVariable is bounded within +-bound. */ - NormalVariable(double m, double v, double b); - - /** - * \param m Mean value - * \param v Variance - * \return A random number from a distribution specified by m, and v. - */ - static double GetSingleValue(double m, double v); - - /** - * \param m Mean value - * \param v Variance - * \param b Bound. The NormalVariable is bounded symetrically about the mean - * [mean-bound,mean+bound] - * \return A random number from a distribution specified by m,v, and b. - */ - static double GetSingleValue(double m, double v, double b); + NormalVariable(double m, double v, double b = INFINITE_VALUE); }; /** @@ -633,13 +596,6 @@ public: * \param sigma sigma parameter of the lognormal distribution */ LogNormalVariable (double mu, double sigma); - - /** - * \param mu mu parameter of the underlying normal distribution - * \param sigma sigma parameter of the underlying normal distribution - * \return A random number from the distribution specified by mu and sigma - */ - static double GetSingleValue(double mu, double sigma); }; /** @@ -666,13 +622,7 @@ public: * \param mean mean of the distribution */ TriangularVariable(double s, double l, double mean); - /** - * \param s Low end of the range - * \param l High end of the range - * \param mean mean of the distribution - * \return A triangularly distributed random number between s and l - */ - static double GetSingleValue(double s, double l, double mean); + }; std::ostream &operator << (std::ostream &os, const RandomVariable &var); diff --git a/src/devices/csma/backoff.cc b/src/devices/csma/backoff.cc index e249104fa..d76654320 100644 --- a/src/devices/csma/backoff.cc +++ b/src/devices/csma/backoff.cc @@ -64,7 +64,8 @@ Backoff::GetBackoffTime (void) maxSlot = m_maxSlots; } - uint32_t backoffSlots = (uint32_t)UniformVariable::GetSingleValue(minSlot, maxSlot); + UniformVariable rng; + uint32_t backoffSlots = (uint32_t)rng.GetValue(minSlot, maxSlot); backoff = Scalar(backoffSlots) * m_slotTime; return (backoff); diff --git a/src/mobility/random-direction-2d-mobility-model.cc b/src/mobility/random-direction-2d-mobility-model.cc index 221118cf7..83ed2bbf4 100644 --- a/src/mobility/random-direction-2d-mobility-model.cc +++ b/src/mobility/random-direction-2d-mobility-model.cc @@ -69,7 +69,7 @@ RandomDirection2dMobilityModel::DoDispose (void) void RandomDirection2dMobilityModel::Start (void) { - double direction = UniformVariable::GetSingleValue (0, 2 * PI); + double direction = UniformVariable().GetValue (0, 2 * PI); SetDirectionAndSpeed (direction); } @@ -104,7 +104,7 @@ RandomDirection2dMobilityModel::SetDirectionAndSpeed (double direction) void RandomDirection2dMobilityModel::ResetDirectionAndSpeed (void) { - double direction = UniformVariable::GetSingleValue (0, PI); + double direction = UniformVariable().GetValue (0, PI); m_helper.UpdateWithBounds (m_bounds); Vector position = m_helper.GetCurrentPosition (); diff --git a/src/routing/olsr/olsr-agent-impl.cc b/src/routing/olsr/olsr-agent-impl.cc index e79f76c9d..6252f984d 100644 --- a/src/routing/olsr/olsr-agent-impl.cc +++ b/src/routing/olsr/olsr-agent-impl.cc @@ -120,7 +120,7 @@ /// Maximum allowed sequence number. #define OLSR_MAX_SEQ_NUM 65535 /// Random number between [0-OLSR_MAXJITTER] used to jitter OLSR packet transmission. -#define JITTER (Seconds (UniformVariable::GetSingleValue (0, OLSR_MAXJITTER))) +#define JITTER (Seconds (UniformVariable().GetValue (0, OLSR_MAXJITTER))) #define OLSR_PORT_NUMBER 698 diff --git a/utils/run-tests.cc b/utils/run-tests.cc index 150e73c31..2e7fd3321 100644 --- a/utils/run-tests.cc +++ b/utils/run-tests.cc @@ -26,7 +26,8 @@ int main (int argc, char *argv[]) { #ifdef RUN_SELF_TESTS - ns3::RandomVariable::UseGlobalSeed(1,2,3,4,5,6); + uint32_t rngSeed[6] = {1,2,3,4,5,6}; + ns3::SeedManager::SetSeed(rngSeed); ns3::PacketMetadata::Enable (); ns3::TestManager::EnableVerbose (); bool success = ns3::TestManager::RunTests (); From cdde8636421c91d53c7132dbf8ec2d9756ce564c Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Tue, 20 Jan 2009 14:00:05 -0500 Subject: [PATCH 02/13] Expose RNG seed/run # to attributes; bindings update --- bindings/python/ns3_module_simulator.py | 41 +++++++++++++++ src/core/rng-stream.cc | 68 ++++++++++++++++++++++++- src/core/rng-stream.h | 1 + 3 files changed, 108 insertions(+), 2 deletions(-) diff --git a/bindings/python/ns3_module_simulator.py b/bindings/python/ns3_module_simulator.py index 143cc4215..34875eb85 100644 --- a/bindings/python/ns3_module_simulator.py +++ b/bindings/python/ns3_module_simulator.py @@ -55,6 +55,8 @@ def register_types(module): module.add_class('ListScheduler', parent=root_module['ns3::Scheduler']) ## map-scheduler.h: ns3::MapScheduler [class] module.add_class('MapScheduler', parent=root_module['ns3::Scheduler']) + ## ns2-calendar-scheduler.h: ns3::Ns2CalendarScheduler [class] + module.add_class('Ns2CalendarScheduler', parent=root_module['ns3::Scheduler']) ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl [class] module.add_class('RealtimeSimulatorImpl', parent=root_module['ns3::SimulatorImpl']) ## realtime-simulator-impl.h: ns3::RealtimeSimulatorImpl::SynchronizationMode [enumeration] @@ -127,6 +129,7 @@ def register_methods(root_module): register_Ns3HeapScheduler_methods(root_module, root_module['ns3::HeapScheduler']) register_Ns3ListScheduler_methods(root_module, root_module['ns3::ListScheduler']) register_Ns3MapScheduler_methods(root_module, root_module['ns3::MapScheduler']) + register_Ns3Ns2CalendarScheduler_methods(root_module, root_module['ns3::Ns2CalendarScheduler']) register_Ns3RealtimeSimulatorImpl_methods(root_module, root_module['ns3::RealtimeSimulatorImpl']) return @@ -718,7 +721,9 @@ def register_Ns3SchedulerEvent_methods(root_module, cls): return def register_Ns3SchedulerEventKey_methods(root_module, cls): + cls.add_binary_comparison_operator('!=') cls.add_binary_comparison_operator('<') + cls.add_binary_comparison_operator('>') ## scheduler.h: ns3::Scheduler::EventKey::EventKey() [constructor] cls.add_constructor([]) ## scheduler.h: ns3::Scheduler::EventKey::EventKey(ns3::Scheduler::EventKey const & arg0) [copy constructor] @@ -1289,6 +1294,42 @@ def register_Ns3MapScheduler_methods(root_module, cls): cls.add_copy_constructor() return +def register_Ns3Ns2CalendarScheduler_methods(root_module, cls): + ## ns2-calendar-scheduler.h: static ns3::TypeId ns3::Ns2CalendarScheduler::GetTypeId() [member function] + cls.add_method('GetTypeId', + 'ns3::TypeId', + [], + is_static=True) + ## ns2-calendar-scheduler.h: ns3::Ns2CalendarScheduler::Ns2CalendarScheduler() [constructor] + cls.add_constructor([]) + ## ns2-calendar-scheduler.h: void ns3::Ns2CalendarScheduler::Insert(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Insert', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + ## ns2-calendar-scheduler.h: bool ns3::Ns2CalendarScheduler::IsEmpty() const [member function] + cls.add_method('IsEmpty', + 'bool', + [], + is_const=True, is_virtual=True) + ## ns2-calendar-scheduler.h: ns3::Scheduler::Event ns3::Ns2CalendarScheduler::PeekNext() const [member function] + cls.add_method('PeekNext', + 'ns3::Scheduler::Event', + [], + is_const=True, is_virtual=True) + ## ns2-calendar-scheduler.h: ns3::Scheduler::Event ns3::Ns2CalendarScheduler::RemoveNext() [member function] + cls.add_method('RemoveNext', + 'ns3::Scheduler::Event', + [], + is_virtual=True) + ## ns2-calendar-scheduler.h: void ns3::Ns2CalendarScheduler::Remove(ns3::Scheduler::Event const & ev) [member function] + cls.add_method('Remove', + 'void', + [param('ns3::Scheduler::Event const &', 'ev')], + is_virtual=True) + cls.add_copy_constructor() + return + def register_Ns3RealtimeSimulatorImpl_methods(root_module, cls): ## realtime-simulator-impl.h: static ns3::TypeId ns3::RealtimeSimulatorImpl::GetTypeId() [member function] cls.add_method('GetTypeId', diff --git a/src/core/rng-stream.cc b/src/core/rng-stream.cc index e24ab052c..682225d6f 100644 --- a/src/core/rng-stream.cc +++ b/src/core/rng-stream.cc @@ -21,6 +21,8 @@ #include #include #include "rng-stream.h" +#include "global-value.h" +#include "integer.h" using namespace std; namespace @@ -199,7 +201,14 @@ void MatPowModM (const double A[3][3], double B[3][3], double m, int32_t n) } } - +static ns3::GlobalValue g_rngSeed ("RngSeed", + "The global seed of all rng streams", + ns3::IntegerValue (1), + ns3::MakeIntegerChecker ()); +static ns3::GlobalValue g_rngRun ("RngRun", + "The run number used to modify the global seed", + ns3::IntegerValue (1), + ns3::MakeIntegerChecker ()); } // end of anonymous namespace @@ -291,7 +300,61 @@ bool RngStream::CheckSeed (const uint32_t seed[6]) return true; } - +void +RngStream::EnsureGlobalInitialized (void) +{ + static bool initialized = false; + if (!initialized) + { + initialized = true; + uint32_t seed; + uint32_t run; + // First, initialize ourselves from the global value. + { + IntegerValue value; + g_rngSeed.GetValue (value); + seed = value.Get (); + g_rngRun.GetValue (value); + run = value.Get (); + } + // then, in case we have NS_RNG set, override the global + // value from the env var. + char *tmp = getenv ("NS_RNG"); + if (tmp != 0) + { + std::string var = std::string (getenv ("NS_RNG")); + std::string::size_type colon = var.find (":"); + if (colon != std::string::npos) + { + { + std::string seedString = var.substr (0, colon); + std::istringstream iss; + iss.str (seedString); + iss >> seed; + } + { + std::string runString = var.substr (colon+1,var.size ()-colon-1); + std::istringstream iss; + iss.str (runString); + iss >> run; + } + } + else + { + { + std::istringstream iss; + iss.str (var); + iss >> seed; + } + } + } + // finally, actually use these values to do something. + uint32_t seedArray [] = {seed, seed, seed, seed, seed, seed}; + SetPackageSeed (seedArray); + // set to the chosen substream (run) + ResetNthSubstream (run); + } +} //************************************************************************* // Public members of the class start here @@ -311,6 +374,7 @@ double RngStream::nextSeed[6] = // RngStream::RngStream () { + EnsureGlobalInitialized (); anti = false; incPrec = false; // Stream initialization moved to separate method. diff --git a/src/core/rng-stream.h b/src/core/rng-stream.h index 2b1e8e225..5f6a59d9e 100644 --- a/src/core/rng-stream.h +++ b/src/core/rng-stream.h @@ -60,6 +60,7 @@ private: //members bool anti, incPrec; double U01 (); double U01d (); + static void EnsureGlobalInitialized (void); private: //static data static double nextSeed[6]; }; From be2da95507985224abaf34e15fe9a030049bc290 Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Tue, 20 Jan 2009 14:43:52 -0500 Subject: [PATCH 03/13] Undo a change which does not compile --- src/core/rng-stream.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/rng-stream.cc b/src/core/rng-stream.cc index 682225d6f..bf815dc37 100644 --- a/src/core/rng-stream.cc +++ b/src/core/rng-stream.cc @@ -351,8 +351,7 @@ RngStream::EnsureGlobalInitialized (void) // finally, actually use these values to do something. uint32_t seedArray [] = {seed, seed, seed, seed, seed, seed}; SetPackageSeed (seedArray); - // set to the chosen substream (run) - ResetNthSubstream (run); + //XXX set the run number } } From 5d667957a7ee595b728e5f72f48596479b18e537 Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Tue, 20 Jan 2009 16:36:08 -0500 Subject: [PATCH 04/13] Fix old code that crept in --- bindings/python/ns3_module_core.py | 8 ++++---- src/core/random-variable.cc | 3 +++ src/core/random-variable.h | 13 ++++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py index b680c1766..e584ab37f 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -1424,12 +1424,12 @@ def register_Ns3LogNormalVariable_methods(root_module, cls): return def register_Ns3NormalVariable_methods(root_module, cls): - ## random-variable.h: ns3::NormalVariable::INFINITE_VALUE [variable] - cls.add_static_attribute('INFINITE_VALUE', 'double const', is_const=True) ## random-variable.h: ns3::NormalVariable::NormalVariable() [constructor] cls.add_constructor([]) - ## random-variable.h: ns3::NormalVariable::NormalVariable(double m, double v, double b=ns3::NormalVariable::INFINITE_VALUE) [constructor] - cls.add_constructor([param('double', 'm'), param('double', 'v'), param('double', 'b', default_value='ns3::NormalVariable::INFINITE_VALUE')]) + ## random-variable.h: ns3::NormalVariable::NormalVariable(double m, double v) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 'v')]) + ## random-variable.h: ns3::NormalVariable::NormalVariable(double m, double v, double b) [constructor] + cls.add_constructor([param('double', 'm'), param('double', 'v'), param('double', 'b')]) cls.add_copy_constructor() return diff --git a/src/core/random-variable.cc b/src/core/random-variable.cc index 3395db8ed..44a921348 100644 --- a/src/core/random-variable.cc +++ b/src/core/random-variable.cc @@ -906,6 +906,9 @@ RandomVariableBase* NormalVariableImpl::Copy() const NormalVariable::NormalVariable() : RandomVariable (NormalVariableImpl ()) {} +NormalVariable::NormalVariable(double m, double v) + : RandomVariable (NormalVariableImpl (m, v)) +{} NormalVariable::NormalVariable(double m, double v, double b) : RandomVariable (NormalVariableImpl (m, v, b)) {} diff --git a/src/core/random-variable.h b/src/core/random-variable.h index 5b5b557c4..ba811ea0f 100644 --- a/src/core/random-variable.h +++ b/src/core/random-variable.h @@ -476,20 +476,27 @@ public: class NormalVariable : public RandomVariable { public: - static const double INFINITE_VALUE; /** * Constructs an normal random variable with a mean * value of 0 and variance of 1. */ NormalVariable(); + /** + * \brief Construct a normal random variable with specified mean and variance. + * \param m Mean value + * \param v Variance + */ + NormalVariable(double m, double v); + /** * \brief Construct a normal random variable with specified mean and variance * \param m Mean value * \param v Variance - * \param b Bound. The NormalVariable is bounded within +-bound. + * \param b Bound. The NormalVariable is bounded symetrically about the mean + * [mean-bound,mean+bound] */ - NormalVariable(double m, double v, double b = INFINITE_VALUE); + NormalVariable(double m, double v, double b); }; /** From ac192394c38e5113a8057f73bf7b1365edb7f5fb Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Thu, 22 Jan 2009 14:10:40 -0500 Subject: [PATCH 05/13] Commit Mathieu's coding style cleanup of random-variable --- src/core/random-variable.cc | 256 +++++++++++++----------------------- src/core/random-variable.h | 108 +++++++-------- src/core/rng-stream.cc | 130 +++++++++++------- src/core/rng-stream.h | 7 +- 4 files changed, 237 insertions(+), 264 deletions(-) diff --git a/src/core/random-variable.cc b/src/core/random-variable.cc index 44a921348..9775be908 100644 --- a/src/core/random-variable.cc +++ b/src/core/random-variable.cc @@ -45,72 +45,39 @@ namespace ns3{ // Seed Manager //----------------------------------------------------------------------------- -uint32_t SeedManager::seed_[6]={1,2,3,4,5,6}; -bool SeedManager::seedSet=false; -uint32_t SeedManager::runNumber=0; - void SeedManager::SetSeed(uint32_t seed[6]) { - if (SeedManager::seedSet) - { - cerr << "Seed Manager already set!" << endl; - cerr << "Call to SeedManager::SetSeed(...) ignored" << endl; - return; - } - SeedManager::seed_[0]=seed[0]; - SeedManager::seed_[1]=seed[1]; - SeedManager::seed_[2]=seed[2]; - SeedManager::seed_[3]=seed[3]; - SeedManager::seed_[4]=seed[4]; - SeedManager::seed_[5]=seed[5]; - if (!RngStream::CheckSeed(SeedManager::seed_)) - NS_FATAL_ERROR("Invalid seed"); - - SeedManager::seedSet = true; + RngStream::SetPackageSeed (seed); } void SeedManager::GetSeed(uint32_t seed[6]) { - for (int i=0; i<6; i++) - { - seed[i] = seed_[i]; - } + RngStream::GetPackageSeed (seed); } void SeedManager::SetSeed(uint32_t seed) { - uint32_t s[6]; - s[0]=s[1]=s[2]=s[3]=s[4]=s[5]=seed; - SetSeed(s); -} - -uint32_t SeedManager::GetSeed() -{ - uint32_t s[6]; - GetSeed(s); - return s[0]; + RngStream::SetPackageSeed (seed); } void SeedManager::SetRun(uint32_t run) { - runNumber=run; + RngStream::SetPackageRun (run); } uint32_t SeedManager::GetRun() { - return runNumber; + return RngStream::GetPackageRun (); } bool SeedManager::CheckSeed (uint32_t seed) { - uint32_t s[6]; - s[0]=s[1]=s[2]=s[3]=s[4]=s[5]=seed; - return RngStream::CheckSeed(s); + return RngStream::CheckSeed(seed); } bool SeedManager::CheckSeed (uint32_t seed[6]) { - return RngStream::CheckSeed(seed); + return RngStream::CheckSeed(seed); } //----------------------------------------------------------------------------- @@ -129,31 +96,21 @@ public: virtual RandomVariableBase* Copy(void) const = 0; protected: - static void Initialize(); // Initialize the RNG system - static bool initialized; // True if package seed is set RngStream* m_generator; //underlying generator being wrapped }; -bool RandomVariableBase::initialized = false; // True if RngStream seed set - - RandomVariableBase::RandomVariableBase() : m_generator(NULL) { - // it's better to be initialzed first and then set run number, - // it happens in GetValue() automatically - //m_generator = new RngStream(); - //m_generator->InitializeStream(); - //m_generator->ResetNthSubstream(SeedManager::GetRun()); } RandomVariableBase::RandomVariableBase(const RandomVariableBase& r) :m_generator(0) { - if(r.m_generator) - { - m_generator = new RngStream(*r.m_generator); - } + if (r.m_generator) + { + m_generator = new RngStream(*r.m_generator); + } } RandomVariableBase::~RandomVariableBase() @@ -166,15 +123,6 @@ uint32_t RandomVariableBase::GetInteger() return (uint32_t)GetValue(); } -void RandomVariableBase::Initialize() -{ - uint32_t s[6]; - if (RandomVariableBase::initialized) return; // Already initialized and seeded - RandomVariableBase::initialized = true; - SeedManager::GetSeed(s); - RngStream::SetPackageSeed(s); -} - //------------------------------------------------------- RandomVariable::RandomVariable() @@ -287,32 +235,20 @@ UniformVariableImpl::GetMax (void) const double UniformVariableImpl::GetValue() { - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } + { + m_generator = new RngStream(); + } return m_min + m_generator->RandU01() * (m_max - m_min); } double UniformVariableImpl::GetValue(double s, double l) { - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } - if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } - return s + m_generator->RandU01() * (l-s); + if(!m_generator) + { + m_generator = new RngStream(); + } + return s + m_generator->RandU01() * (l-s); } RandomVariableBase* UniformVariableImpl::Copy() const @@ -329,7 +265,7 @@ UniformVariable::UniformVariable(double s, double l) double UniformVariable::GetValue() { - return Peek()->GetValue(); + return Peek()->GetValue(); } double UniformVariable::GetValue(double s, double l) @@ -567,18 +503,15 @@ ExponentialVariableImpl::ExponentialVariableImpl(const ExponentialVariableImpl& double ExponentialVariableImpl::GetValue() { - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } + { + m_generator = new RngStream(); + } double r = -m_mean*log(m_generator->RandU01()); - if (m_bound != 0 && r > m_bound) return m_bound; + if (m_bound != 0 && r > m_bound) + { + return m_bound; + } return r; } @@ -669,19 +602,16 @@ ParetoVariableImpl::ParetoVariableImpl(const ParetoVariableImpl& c) double ParetoVariableImpl::GetValue() { - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } + { + m_generator = new RngStream(); + } double scale = m_mean * ( m_shape - 1.0) / m_shape; double r = (scale * ( 1.0 / pow(m_generator->RandU01(), 1.0 / m_shape))); - if (m_bound != 0 && r > m_bound) return m_bound; + if (m_bound != 0 && r > m_bound) + { + return m_bound; + } return r; } @@ -771,19 +701,16 @@ WeibullVariableImpl::WeibullVariableImpl(const WeibullVariableImpl& c) double WeibullVariableImpl::GetValue() { - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } + { + m_generator = new RngStream(); + } double exponent = 1.0 / m_alpha; double r = m_mean * pow( -log(m_generator->RandU01()), exponent); - if (m_bound != 0 && r > m_bound) return m_bound; + if (m_bound != 0 && r > m_bound) + { + return m_bound; + } return r; } @@ -861,16 +788,10 @@ NormalVariableImpl::NormalVariableImpl(const NormalVariableImpl& c) double NormalVariableImpl::GetValue() { - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } + { + m_generator = new RngStream(); + } if (m_nextValid) { // use previously generated m_nextValid = false; @@ -889,10 +810,16 @@ double NormalVariableImpl::GetValue() { // Got good pair double y = sqrt((-2 * log(w))/w); m_next = m_mean + v2 * y * sqrt(m_variance); - if (fabs(m_next) > m_bound) m_next = m_bound * (m_next)/fabs(m_next); + if (fabs(m_next) > m_bound) + { + m_next = m_bound * (m_next)/fabs(m_next); + } m_nextValid = true; double x1 = m_mean + v1 * y * sqrt(m_variance); - if (fabs(x1) > m_bound) x1 = m_bound * (x1)/fabs(x1); + if (fabs(x1) > m_bound) + { + x1 = m_bound * (x1)/fabs(x1); + } return x1; } } @@ -974,21 +901,27 @@ EmpiricalVariableImpl::~EmpiricalVariableImpl() { } double EmpiricalVariableImpl::GetValue() { // Return a value from the empirical distribution // This code based (loosely) on code by Bruce Mah (Thanks Bruce!) - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } - if (emp.size() == 0) return 0.0; // HuH? No empirical data - if (!validated) Validate(); // Insure in non-decreasing + { + m_generator = new RngStream(); + } + if (emp.size() == 0) + { + return 0.0; // HuH? No empirical data + } + if (!validated) + { + Validate(); // Insure in non-decreasing + } double r = m_generator->RandU01(); - if (r <= emp.front().cdf)return emp.front().value; // Less than first - if (r >= emp.back().cdf) return emp.back().value; // Greater than last + if (r <= emp.front().cdf) + { + return emp.front().value; // Less than first + } + if (r >= emp.back().cdf) + { + return emp.back().value; // Greater than last + } // Binary search std::vector::size_type bottom = 0; std::vector::size_type top = emp.size() - 1; @@ -1002,8 +935,14 @@ double EmpiricalVariableImpl::GetValue() r); } // Not here, adjust bounds - if (r < emp[c].cdf) top = c - 1; - else bottom = c + 1; + if (r < emp[c].cdf) + { + top = c - 1; + } + else + { + bottom = c + 1; + } } } @@ -1140,7 +1079,10 @@ DeterministicVariableImpl::~DeterministicVariableImpl() { } double DeterministicVariableImpl::GetValue() { - if (next == count) next = 0; + if (next == count) + { + next = 0; + } return data[next++]; } @@ -1215,16 +1157,10 @@ LogNormalVariableImpl::LogNormalVariableImpl (double mu, double sigma) double LogNormalVariableImpl::GetValue () { - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } + { + m_generator = new RngStream(); + } double u, v, r2, normal, z; do @@ -1296,21 +1232,19 @@ TriangularVariableImpl::TriangularVariableImpl(const TriangularVariableImpl& c) double TriangularVariableImpl::GetValue() { - if(!RandomVariableBase::initialized) - { - RandomVariableBase::Initialize(); - } if(!m_generator) - { - m_generator = new RngStream(); - m_generator->InitializeStream(); - m_generator->ResetNthSubstream(SeedManager::GetRun()); - } + { + m_generator = new RngStream(); + } double u = m_generator->RandU01(); if(u <= (m_mode - m_min) / (m_max - m_min) ) - return m_min + sqrt(u * (m_max - m_min) * (m_mode - m_min) ); + { + return m_min + sqrt(u * (m_max - m_min) * (m_mode - m_min) ); + } else - return m_max - sqrt( (1-u) * (m_max - m_min) * (m_max - m_mode) ); + { + return m_max - sqrt( (1-u) * (m_max - m_min) * (m_max - m_mode) ); + } } RandomVariableBase* TriangularVariableImpl::Copy() const diff --git a/src/core/random-variable.h b/src/core/random-variable.h index ba811ea0f..8e5057cfc 100644 --- a/src/core/random-variable.h +++ b/src/core/random-variable.h @@ -42,50 +42,45 @@ class RandomVariableBase; class SeedManager { -private: - static uint32_t runNumber; - static bool seedSet; - static uint32_t seed_[6]; - public: - /** - * \brief set the seed - * it will duplicate the seed value 6 times - * \code - * SeedManger::SetSeed(15); - * UniformVariable x(2,3); //these will give the same output everytime - * ExponentialVariable y(120); //as long as the seed stays the same - * \endcode - * \param seed - */ - static void SetSeed (uint32_t seed); + /** + * \brief set the seed + * it will duplicate the seed value 6 times + * \code + * SeedManger::SetSeed(15); + * UniformVariable x(2,3); //these will give the same output everytime + * ExponentialVariable y(120); //as long as the seed stays the same + * \endcode + * \param seed + */ + static void SetSeed (uint32_t seed); - /** - * \brief Get the seed value - * \return seed value - */ - static uint32_t GetSeed (); + /** + * \brief Get the seed value + * \return seed value + */ + static uint32_t GetSeed (); - /** - * \brief set the seed - * \code - * uint32_t seed[6]={10,5,2,3,5,11}; - * SeedManger::SetSeed(seed); - * UniformVariable x(2,3); //these will give the same output everytime - * ExponentialVariable y(120); //as long as the seed stays the same - * \endcode - * \param seed - */ - static void SetSeed (uint32_t seed[6]); + /** + * \brief set the seed + * \code + * uint32_t seed[6]={10,5,2,3,5,11}; + * SeedManger::SetSeed(seed); + * UniformVariable x(2,3); //these will give the same output everytime + * ExponentialVariable y(120); //as long as the seed stays the same + * \endcode + * \param seed + */ + static void SetSeed (uint32_t seed[6]); - /** - * \brief Get the seed value - * \param array of size 6 which will hold returned seed values - */ - static void GetSeed (uint32_t seed[6]); + /** + * \brief Get the seed value + * \param array of size 6 which will hold returned seed values + */ + static void GetSeed (uint32_t seed[6]); - /** + /** * \brief Set the run number of simulation * * \code @@ -106,25 +101,24 @@ public: * ...Results for run 1:... * \endcode */ - static void SetRun (uint32_t run); - - /** - * \brief Get the run number - * \return run number - */ - static uint32_t GetRun (); - - /** - * \brief Check if seed value is valid if wanted to be used as seed - * \return true if valid and false if invalid - */ - static bool CheckSeed (uint32_t seed); - - /** - * \brief Checks if seed array has valid values if wanted to be used as further seed - * \return true if valid and false if invalid - */ - static bool CheckSeed (uint32_t seed[6]); + static void SetRun (uint32_t run); + /** + * \returns the current run number + * @sa SetRun + */ + static uint32_t GetRun (void); + + /** + * \brief Check if seed value is valid if wanted to be used as seed + * \return true if valid and false if invalid + */ + static bool CheckSeed (uint32_t seed); + + /** + * \brief Checks if seed array has valid values if wanted to be used as further seed + * \return true if valid and false if invalid + */ + static bool CheckSeed (uint32_t seed[6]); }; diff --git a/src/core/rng-stream.cc b/src/core/rng-stream.cc index bf815dc37..89b76ad94 100644 --- a/src/core/rng-stream.cc +++ b/src/core/rng-stream.cc @@ -300,15 +300,15 @@ bool RngStream::CheckSeed (const uint32_t seed[6]) return true; } -void +uint32_t RngStream::EnsureGlobalInitialized (void) { static bool initialized = false; + static uint32_t run = 0; if (!initialized) { initialized = true; uint32_t seed; - uint32_t run; // First, initialize ourselves from the global value. { IntegerValue value; @@ -351,8 +351,8 @@ RngStream::EnsureGlobalInitialized (void) // finally, actually use these values to do something. uint32_t seedArray [] = {seed, seed, seed, seed, seed, seed}; SetPackageSeed (seedArray); - //XXX set the run number } + return run; } //************************************************************************* @@ -365,7 +365,7 @@ RngStream::EnsureGlobalInitialized (void) // double RngStream::nextSeed[6] = { - 12345.0, 12345.0, 12345.0, 12345.0, 12345.0, 12345.0 + 12345.0, 12345.0, 12345.0, 12345.0, 12345.0, 12345.0 }; //------------------------------------------------------------------------- @@ -373,21 +373,23 @@ double RngStream::nextSeed[6] = // RngStream::RngStream () { - EnsureGlobalInitialized (); - anti = false; - incPrec = false; - // Stream initialization moved to separate method. + uint32_t run = EnsureGlobalInitialized (); + anti = false; + incPrec = false; + // Stream initialization moved to separate method. + InitializeStream (); + ResetNthSubstream (run); } RngStream::RngStream(const RngStream& r) { - anti = r.anti; - incPrec = r.incPrec; - for (int i = 0; i < 6; ++i) { - Cg[i] = r.Cg[i]; - Bg[i] = r.Bg[i]; - Ig[i] = r.Ig[i]; - } + anti = r.anti; + incPrec = r.incPrec; + for (int i = 0; i < 6; ++i) { + Cg[i] = r.Cg[i]; + Bg[i] = r.Bg[i]; + Ig[i] = r.Ig[i]; + } } @@ -395,19 +397,19 @@ void RngStream::InitializeStream() { // Moved from the RngStream constructor above to allow seeding // AFTER the global package seed has been set in the Random // object constructor. - /* Information on a stream. The arrays {Cg, Bg, Ig} contain the current - state of the stream, the starting state of the current SubStream, and the - starting state of the stream. This stream generates antithetic variates - if anti = true. It also generates numbers with extended precision (53 - bits if machine follows IEEE 754 standard) if incPrec = true. nextSeed - will be the seed of the next declared RngStream. */ + /* Information on a stream. The arrays {Cg, Bg, Ig} contain the current + state of the stream, the starting state of the current SubStream, and the + starting state of the stream. This stream generates antithetic variates + if anti = true. It also generates numbers with extended precision (53 + bits if machine follows IEEE 754 standard) if incPrec = true. nextSeed + will be the seed of the next declared RngStream. */ - for (int i = 0; i < 6; ++i) { - Bg[i] = Cg[i] = Ig[i] = nextSeed[i]; - } + for (int i = 0; i < 6; ++i) { + Bg[i] = Cg[i] = Ig[i] = nextSeed[i]; + } - MatVecModM (A1p127, nextSeed, nextSeed, m1); - MatVecModM (A2p127, &nextSeed[3], &nextSeed[3], m2); + MatVecModM (A1p127, nextSeed, nextSeed, m1); + MatVecModM (A2p127, &nextSeed[3], &nextSeed[3], m2); } //------------------------------------------------------------------------- @@ -415,8 +417,8 @@ void RngStream::InitializeStream() // void RngStream::ResetStartStream () { - for (int i = 0; i < 6; ++i) - Cg[i] = Bg[i] = Ig[i]; + for (int i = 0; i < 6; ++i) + Cg[i] = Bg[i] = Ig[i]; } @@ -425,8 +427,8 @@ void RngStream::ResetStartStream () // void RngStream::ResetStartSubstream () { - for (int i = 0; i < 6; ++i) - Cg[i] = Bg[i]; + for (int i = 0; i < 6; ++i) + Cg[i] = Bg[i]; } @@ -435,10 +437,10 @@ void RngStream::ResetStartSubstream () // void RngStream::ResetNextSubstream () { - MatVecModM(A1p76, Bg, Bg, m1); - MatVecModM(A2p76, &Bg[3], &Bg[3], m2); - for (int i = 0; i < 6; ++i) - Cg[i] = Bg[i]; + MatVecModM(A1p76, Bg, Bg, m1); + MatVecModM(A2p76, &Bg[3], &Bg[3], m2); + for (int i = 0; i < 6; ++i) + Cg[i] = Bg[i]; } //------------------------------------------------------------------------- @@ -446,32 +448,70 @@ void RngStream::ResetNextSubstream () // void RngStream::ResetNthSubstream (uint32_t N) { - if(N==0) return; - for(uint32_t i=0;i Date: Thu, 22 Jan 2009 14:11:09 -0500 Subject: [PATCH 06/13] Apply Mathieu's change: remove all calls to SetSeed --- examples/csma-bridge-one-hop.cc | 6 ------ examples/csma-bridge.cc | 6 ------ examples/csma-bridge.py | 5 ----- examples/csma-broadcast.cc | 6 ------ examples/csma-multicast.cc | 5 ----- examples/csma-one-subnet.cc | 5 ----- examples/csma-packet-socket.cc | 5 ----- examples/csma-ping.cc | 5 ----- examples/csma-raw-ip-socket.cc | 6 ------ examples/csma-star.cc | 5 ----- examples/first.cc | 3 --- examples/global-routing-slash32.cc | 4 ---- examples/realtime-udp-echo.cc | 5 ----- examples/second.cc | 3 --- examples/simple-alternate-routing.cc | 5 ----- examples/simple-error-model.cc | 5 ----- examples/simple-global-routing.cc | 6 ------ examples/simple-point-to-point-olsr.cc | 6 ------ examples/star.cc | 5 ----- examples/static-routing-slash32.cc | 4 ---- examples/tcp-large-transfer.cc | 5 ----- examples/tcp-nsc-lfn.cc | 2 -- examples/tcp-nsc-zoo.cc | 3 --- examples/tcp-star-server.cc | 5 ----- examples/third.cc | 3 --- examples/wifi-wired-bridging.cc | 3 --- 26 files changed, 121 deletions(-) diff --git a/examples/csma-bridge-one-hop.cc b/examples/csma-bridge-one-hop.cc index daa060f24..ad7f74691 100644 --- a/examples/csma-bridge-one-hop.cc +++ b/examples/csma-bridge-one-hop.cc @@ -91,12 +91,6 @@ main (int argc, char *argv[]) LogComponentEnable ("CsmaBridgeOneHopExample", LOG_LEVEL_INFO); #endif - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - // // Allow the user to override any of the defaults and the above Bind() at // run-time, via command-line arguments diff --git a/examples/csma-bridge.cc b/examples/csma-bridge.cc index 38996aa83..b996ff604 100644 --- a/examples/csma-bridge.cc +++ b/examples/csma-bridge.cc @@ -53,12 +53,6 @@ main (int argc, char *argv[]) LogComponentEnable ("CsmaBridgeExample", LOG_LEVEL_INFO); #endif - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - // // Allow the user to override any of the defaults and the above Bind() at // run-time, via command-line arguments diff --git a/examples/csma-bridge.py b/examples/csma-bridge.py index 5536cd819..f1f5cd130 100644 --- a/examples/csma-bridge.py +++ b/examples/csma-bridge.py @@ -32,11 +32,6 @@ import ns3 def main(argv): - # - # Make the random number generators generate reproducible results. - # - seed = array([1, 1, 2, 3, 5, 8]); - ns3.SeedManager.SetSeed(seed) # # Allow the user to override any of the defaults and the above Bind() at diff --git a/examples/csma-broadcast.cc b/examples/csma-broadcast.cc index 10ca74085..e93a17be1 100644 --- a/examples/csma-broadcast.cc +++ b/examples/csma-broadcast.cc @@ -51,12 +51,6 @@ main (int argc, char *argv[]) #endif LogComponentEnable ("CsmaBroadcastExample", LOG_PREFIX_TIME); - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - // Allow the user to override any of the defaults and the above // Bind()s at run-time, via command-line arguments CommandLine cmd; diff --git a/examples/csma-multicast.cc b/examples/csma-multicast.cc index a75ab7442..0c969d652 100644 --- a/examples/csma-multicast.cc +++ b/examples/csma-multicast.cc @@ -50,11 +50,6 @@ main (int argc, char *argv[]) // // LogComponentEnable ("CsmaMulticastExample", LOG_LEVEL_INFO); - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // // Set up default values for the simulation. // diff --git a/examples/csma-one-subnet.cc b/examples/csma-one-subnet.cc index da25aace4..75a552955 100644 --- a/examples/csma-one-subnet.cc +++ b/examples/csma-one-subnet.cc @@ -48,11 +48,6 @@ main (int argc, char *argv[]) LogComponentEnable ("CsmaOneSubnetExample", LOG_LEVEL_INFO); #endif // -// Make the random number generators generate reproducible results. -// - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); -// // Allow the user to override any of the defaults and the above Bind() at // run-time, via command-line arguments // diff --git a/examples/csma-packet-socket.cc b/examples/csma-packet-socket.cc index 76e09042a..3a6a7e4be 100644 --- a/examples/csma-packet-socket.cc +++ b/examples/csma-packet-socket.cc @@ -57,11 +57,6 @@ main (int argc, char *argv[]) LogComponentEnable ("CsmaPacketSocketExample", LOG_LEVEL_INFO); #endif - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); CommandLine cmd; cmd.Parse (argc, argv); diff --git a/examples/csma-ping.cc b/examples/csma-ping.cc index bb002ecd8..3595b16a5 100644 --- a/examples/csma-ping.cc +++ b/examples/csma-ping.cc @@ -56,11 +56,6 @@ static void PingRtt (std::string context, Time rtt) int main (int argc, char *argv[]) { - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); CommandLine cmd; cmd.Parse (argc, argv); diff --git a/examples/csma-raw-ip-socket.cc b/examples/csma-raw-ip-socket.cc index acef42bea..4ccad6a10 100644 --- a/examples/csma-raw-ip-socket.cc +++ b/examples/csma-raw-ip-socket.cc @@ -54,12 +54,6 @@ main (int argc, char *argv[]) LogComponentEnable ("CsmaPacketSocketExample", LOG_LEVEL_INFO); #endif - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - CommandLine cmd; cmd.Parse (argc, argv); diff --git a/examples/csma-star.cc b/examples/csma-star.cc index 158699d6d..e267c5fb3 100644 --- a/examples/csma-star.cc +++ b/examples/csma-star.cc @@ -46,11 +46,6 @@ NS_LOG_COMPONENT_DEFINE ("CsmaStar"); int main (int argc, char *argv[]) { - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // // Set up some default values for the simulation. diff --git a/examples/first.cc b/examples/first.cc index 95696583e..0461d4cc9 100644 --- a/examples/first.cc +++ b/examples/first.cc @@ -29,9 +29,6 @@ main (int argc, char *argv[]) LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - NodeContainer nodes; nodes.Create (2); diff --git a/examples/global-routing-slash32.cc b/examples/global-routing-slash32.cc index 70e90dca0..06dfed1b8 100644 --- a/examples/global-routing-slash32.cc +++ b/examples/global-routing-slash32.cc @@ -38,10 +38,6 @@ NS_LOG_COMPONENT_DEFINE ("GlobalRouterSlash32Test"); int main (int argc, char *argv[]) { - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // Allow the user to override any of the defaults and the above // DefaultValue::Bind ()s at run-time, via command-line arguments diff --git a/examples/realtime-udp-echo.cc b/examples/realtime-udp-echo.cc index 524838e91..b275f7e0c 100644 --- a/examples/realtime-udp-echo.cc +++ b/examples/realtime-udp-echo.cc @@ -37,11 +37,6 @@ NS_LOG_COMPONENT_DEFINE ("RealtimeUdpEchoExample"); int main (int argc, char *argv[]) { - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // // Allow the user to override any of the defaults and the above Bind() at // run-time, via command-line arguments diff --git a/examples/second.cc b/examples/second.cc index e603ffd50..a568a999f 100644 --- a/examples/second.cc +++ b/examples/second.cc @@ -39,9 +39,6 @@ main (int argc, char *argv[]) LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - uint32_t nCsma = 3; CommandLine cmd; cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma); diff --git a/examples/simple-alternate-routing.cc b/examples/simple-alternate-routing.cc index 42b1d29f1..8c3dcca2d 100644 --- a/examples/simple-alternate-routing.cc +++ b/examples/simple-alternate-routing.cc @@ -57,11 +57,6 @@ main (int argc, char *argv[]) LogComponentEnable("GlobalRouter", LOG_LOGIC); #endif - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("300b/s")); diff --git a/examples/simple-error-model.cc b/examples/simple-error-model.cc index cb339a5a7..c43664dbd 100644 --- a/examples/simple-error-model.cc +++ b/examples/simple-error-model.cc @@ -59,11 +59,6 @@ main (int argc, char *argv[]) LogComponentEnable ("SimplePointToPointExample", LOG_LEVEL_INFO); #endif - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // Set a few attributes Config::SetDefault ("ns3::RateErrorModel::ErrorRate", DoubleValue (0.01)); diff --git a/examples/simple-global-routing.cc b/examples/simple-global-routing.cc index 8c1fe135c..01323cc9f 100644 --- a/examples/simple-global-routing.cc +++ b/examples/simple-global-routing.cc @@ -61,12 +61,6 @@ main (int argc, char *argv[]) LogComponentEnable ("SimpleGlobalRoutingExample", LOG_LEVEL_INFO); #endif - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - // Set up some default values for the simulation. Use the Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s")); diff --git a/examples/simple-point-to-point-olsr.cc b/examples/simple-point-to-point-olsr.cc index d709a11e3..e534cf608 100644 --- a/examples/simple-point-to-point-olsr.cc +++ b/examples/simple-point-to-point-olsr.cc @@ -60,12 +60,6 @@ main (int argc, char *argv[]) LogComponentEnable ("SimpleGlobalRoutingExample", LOG_LEVEL_INFO); #endif - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - // Set up some default values for the simulation. Use the Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); diff --git a/examples/star.cc b/examples/star.cc index fae0ddc52..76ba92601 100644 --- a/examples/star.cc +++ b/examples/star.cc @@ -40,11 +40,6 @@ NS_LOG_COMPONENT_DEFINE ("Star"); int main (int argc, char *argv[]) { - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // // Set up some default values for the simulation. diff --git a/examples/static-routing-slash32.cc b/examples/static-routing-slash32.cc index d17b8aa50..e535a29f3 100644 --- a/examples/static-routing-slash32.cc +++ b/examples/static-routing-slash32.cc @@ -37,10 +37,6 @@ NS_LOG_COMPONENT_DEFINE ("StaticRoutingSlash32Test"); int main (int argc, char *argv[]) { - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // Allow the user to override any of the defaults and the above // DefaultValue::Bind ()s at run-time, via command-line arguments diff --git a/examples/tcp-large-transfer.cc b/examples/tcp-large-transfer.cc index e704d0e1b..f1cc6624f 100644 --- a/examples/tcp-large-transfer.cc +++ b/examples/tcp-large-transfer.cc @@ -67,11 +67,6 @@ int main (int argc, char *argv[]) // LogComponentEnable("PacketSink", LOG_LEVEL_ALL); // LogComponentEnable("TcpLargeTransfer", LOG_LEVEL_ALL); - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // Allow the user to override any of the defaults and the above // Bind()s at run-time, via command-line arguments diff --git a/examples/tcp-nsc-lfn.cc b/examples/tcp-nsc-lfn.cc index 25e38a635..4976e636e 100644 --- a/examples/tcp-nsc-lfn.cc +++ b/examples/tcp-nsc-lfn.cc @@ -46,8 +46,6 @@ NS_LOG_COMPONENT_DEFINE ("TcpNscLfn"); int main (int argc, char *argv[]) { - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (4096)); Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("6Mbps")); diff --git a/examples/tcp-nsc-zoo.cc b/examples/tcp-nsc-zoo.cc index 71ed7c495..c9d68c296 100644 --- a/examples/tcp-nsc-zoo.cc +++ b/examples/tcp-nsc-zoo.cc @@ -47,9 +47,6 @@ int main(int argc, char *argv[]) unsigned int MaxNodes = 4; unsigned int runtime = 3; - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (2048)); Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("8kbps")); CommandLine cmd; diff --git a/examples/tcp-star-server.cc b/examples/tcp-star-server.cc index 70d0d91f7..685b8b516 100644 --- a/examples/tcp-star-server.cc +++ b/examples/tcp-star-server.cc @@ -68,11 +68,6 @@ main (int argc, char *argv[]) //LogComponentEnable ("TcpL4Protocol", LOG_LEVEL_ALL); //LogComponentEnable ("TcpSocketImpl", LOG_LEVEL_ALL); //LogComponentEnable ("PacketSink", LOG_LEVEL_ALL); - // - // Make the random number generators generate reproducible results. - // - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); // Set up some default values for the simulation. Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (250)); diff --git a/examples/third.cc b/examples/third.cc index 1333db022..e98c15f83 100644 --- a/examples/third.cc +++ b/examples/third.cc @@ -43,9 +43,6 @@ main (int argc, char *argv[]) LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - uint32_t nCsma = 3; uint32_t nWifi = 3; CommandLine cmd; diff --git a/examples/wifi-wired-bridging.cc b/examples/wifi-wired-bridging.cc index 8f88da8c8..7b11cf085 100644 --- a/examples/wifi-wired-bridging.cc +++ b/examples/wifi-wired-bridging.cc @@ -63,9 +63,6 @@ int main (int argc, char *argv[]) uint32_t nStas = 2; bool sendIp = true; - uint32_t seed[6] = {1, 1, 2, 3, 5, 8}; - SeedManager::SetSeed(seed); - CommandLine cmd; cmd.AddValue ("nWifis", "Number of wifi networks", nWifis); cmd.AddValue ("nStas", "Number of stations per wifi network", nStas); From eb416a364b2b602a2aebfb0694815eb0496e278b Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Thu, 22 Jan 2009 14:12:56 -0500 Subject: [PATCH 07/13] Mathieu's patch: update users of GetSingleValue --- src/devices/csma/backoff.cc | 4 ++-- src/devices/csma/backoff.h | 3 ++- src/devices/wifi/random-stream.cc | 8 +++----- src/devices/wifi/random-stream.h | 4 ++-- src/mobility/random-direction-2d-mobility-model.cc | 4 ++-- src/mobility/random-direction-2d-mobility-model.h | 1 + 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/devices/csma/backoff.cc b/src/devices/csma/backoff.cc index d76654320..08c4cd13e 100644 --- a/src/devices/csma/backoff.cc +++ b/src/devices/csma/backoff.cc @@ -40,6 +40,7 @@ Backoff::Backoff(Time slotTime, uint32_t minSlots, uint32_t maxSlots, uint32_t c m_maxSlots = maxSlots; m_ceiling = ceiling; m_maxRetries = maxRetries; + m_rng = UniformVariable (); } Time @@ -64,8 +65,7 @@ Backoff::GetBackoffTime (void) maxSlot = m_maxSlots; } - UniformVariable rng; - uint32_t backoffSlots = (uint32_t)rng.GetValue(minSlot, maxSlot); + uint32_t backoffSlots = (uint32_t)m_rng.GetValue(minSlot, maxSlot); backoff = Scalar(backoffSlots) * m_slotTime; return (backoff); diff --git a/src/devices/csma/backoff.h b/src/devices/csma/backoff.h index d15de4452..ad78cc7e9 100644 --- a/src/devices/csma/backoff.h +++ b/src/devices/csma/backoff.h @@ -93,9 +93,10 @@ private: * Number of times that the transmitter has tried to unsuccessfully transmit the current packet. */ uint32_t m_numBackoffRetries; + UniformVariable m_rng; }; -}; // namespace ns3 +} // namespace ns3 #endif // BACKOFF_H diff --git a/src/devices/wifi/random-stream.cc b/src/devices/wifi/random-stream.cc index c498302c6..1a4229d88 100644 --- a/src/devices/wifi/random-stream.cc +++ b/src/devices/wifi/random-stream.cc @@ -18,7 +18,6 @@ * Author: Mathieu Lacage */ #include "random-stream.h" -#include "ns3/rng-stream.h" #include "ns3/assert.h" namespace ns3 { @@ -28,13 +27,12 @@ RandomStream::~RandomStream () RealRandomStream::RealRandomStream () -{ - m_stream.InitializeStream(); -} + : m_stream (UniformVariable ()) +{} uint32_t RealRandomStream::GetNext (uint32_t min, uint32_t max) { - return m_stream.RandInt (min, max); + return m_stream.GetValue (min, max); } diff --git a/src/devices/wifi/random-stream.h b/src/devices/wifi/random-stream.h index eae2a6d79..2a3335485 100644 --- a/src/devices/wifi/random-stream.h +++ b/src/devices/wifi/random-stream.h @@ -22,7 +22,7 @@ #include #include -#include "ns3/rng-stream.h" +#include "ns3/random-variable.h" namespace ns3 { @@ -43,7 +43,7 @@ public: RealRandomStream (); virtual uint32_t GetNext (uint32_t min, uint32_t max); private: - RngStream m_stream; + UniformVariable m_stream; }; class TestRandomStream : public RandomStream diff --git a/src/mobility/random-direction-2d-mobility-model.cc b/src/mobility/random-direction-2d-mobility-model.cc index 83ed2bbf4..d11312cc6 100644 --- a/src/mobility/random-direction-2d-mobility-model.cc +++ b/src/mobility/random-direction-2d-mobility-model.cc @@ -69,7 +69,7 @@ RandomDirection2dMobilityModel::DoDispose (void) void RandomDirection2dMobilityModel::Start (void) { - double direction = UniformVariable().GetValue (0, 2 * PI); + double direction = m_direction.GetValue (0, 2 * PI); SetDirectionAndSpeed (direction); } @@ -104,7 +104,7 @@ RandomDirection2dMobilityModel::SetDirectionAndSpeed (double direction) void RandomDirection2dMobilityModel::ResetDirectionAndSpeed (void) { - double direction = UniformVariable().GetValue (0, PI); + double direction = m_direction.GetValue (0, PI); m_helper.UpdateWithBounds (m_bounds); Vector position = m_helper.GetCurrentPosition (); diff --git a/src/mobility/random-direction-2d-mobility-model.h b/src/mobility/random-direction-2d-mobility-model.h index 8c8621ace..68d6ab8b0 100644 --- a/src/mobility/random-direction-2d-mobility-model.h +++ b/src/mobility/random-direction-2d-mobility-model.h @@ -58,6 +58,7 @@ class RandomDirection2dMobilityModel : public MobilityModel virtual Vector DoGetVelocity (void) const; static const double PI; + UniformVariable m_direction; Rectangle m_bounds; RandomVariable m_speed; RandomVariable m_pause; From bf33a71945ef67aa3aa4f6250ab262a3ce4f50d8 Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Thu, 22 Jan 2009 14:42:18 -0500 Subject: [PATCH 08/13] Michelle's bounds patch --- src/core/random-variable.cc | 48 ++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/core/random-variable.cc b/src/core/random-variable.cc index 9775be908..f7b27a4df 100644 --- a/src/core/random-variable.cc +++ b/src/core/random-variable.cc @@ -507,12 +507,12 @@ double ExponentialVariableImpl::GetValue() { m_generator = new RngStream(); } - double r = -m_mean*log(m_generator->RandU01()); - if (m_bound != 0 && r > m_bound) + while(1) { - return m_bound; + double r = -m_mean*log(m_generator->RandU01()); + if (m_bound == 0 || r <= m_bound) return r; + //otherwise, try again } - return r; } RandomVariableBase* ExponentialVariableImpl::Copy() const @@ -607,12 +607,12 @@ double ParetoVariableImpl::GetValue() m_generator = new RngStream(); } double scale = m_mean * ( m_shape - 1.0) / m_shape; - double r = (scale * ( 1.0 / pow(m_generator->RandU01(), 1.0 / m_shape))); - if (m_bound != 0 && r > m_bound) + while(1) { - return m_bound; + double r = (scale * ( 1.0 / pow(m_generator->RandU01(), 1.0 / m_shape))); + if (m_bound == 0 || r <= m_bound) return r; + //otherwise, try again } - return r; } RandomVariableBase* ParetoVariableImpl::Copy() const @@ -706,12 +706,12 @@ double WeibullVariableImpl::GetValue() m_generator = new RngStream(); } double exponent = 1.0 / m_alpha; - double r = m_mean * pow( -log(m_generator->RandU01()), exponent); - if (m_bound != 0 && r > m_bound) + while(1) { - return m_bound; + double r = m_mean * pow( -log(m_generator->RandU01()), exponent); + if (m_bound == 0 || r <= m_bound) return r; + //otherwise, try again } - return r; } RandomVariableBase* WeibullVariableImpl::Copy() const @@ -750,7 +750,7 @@ public: * \brief Construct a normal random variable with specified mean and variance * \param m Mean value * \param v Variance - * \param b Bound. The NormalVariableImpl is bounded within +-bound. + * \param b Bound. The NormalVariableImpl is bounded within +-bound of the mean. */ NormalVariableImpl(double m, double v, double b = INFINITE_VALUE); @@ -765,7 +765,7 @@ public: private: double m_mean; // Mean value of RV double m_variance; // Mean value of RV - double m_bound; // Bound on value (absolute value) + double m_bound; // Bound on value's difference from the mean (absolute value) bool m_nextValid; // True if next valid double m_next; // The algorithm produces two values at a time static bool m_static_nextValid; @@ -810,17 +810,21 @@ double NormalVariableImpl::GetValue() { // Got good pair double y = sqrt((-2 * log(w))/w); m_next = m_mean + v2 * y * sqrt(m_variance); - if (fabs(m_next) > m_bound) - { - m_next = m_bound * (m_next)/fabs(m_next); - } - m_nextValid = true; + //if next is in bounds, it is valid + m_nextValid = fabs(m_next-m_mean) <= m_bound; double x1 = m_mean + v1 * y * sqrt(m_variance); - if (fabs(x1) > m_bound) + //if x1 is in bounds, return it + if (fabs(x1-m_mean) <= m_bound) { - x1 = m_bound * (x1)/fabs(x1); + return x1; } - return x1; + //otherwise try and return m_next if it is valid + else if (m_nextValid) + { + m_nextValid = false; + return m_next; + } + //otherwise, just run this loop again } } } From 1858b93cfa1a2d75e0fba08e0b2c8b6423893891 Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Thu, 22 Jan 2009 15:13:47 -0500 Subject: [PATCH 09/13] Update the bindings --- bindings/python/ns3_module_core.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py index e584ab37f..4190a7369 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -624,16 +624,41 @@ def register_Ns3RngStream_methods(root_module, cls): cls.add_method('RandInt', 'int32_t', [param('int32_t', 'i'), param('int32_t', 'j')]) + ## rng-stream.h: static bool ns3::RngStream::SetPackageSeed(uint32_t seed) [member function] + cls.add_method('SetPackageSeed', + 'bool', + [param('uint32_t', 'seed')], + is_static=True) ## rng-stream.h: static bool ns3::RngStream::SetPackageSeed(uint32_t const * seed) [member function] cls.add_method('SetPackageSeed', 'bool', [param('uint32_t const *', 'seed')], is_static=True) + ## rng-stream.h: static void ns3::RngStream::GetPackageSeed(uint32_t * seed) [member function] + cls.add_method('GetPackageSeed', + 'void', + [param('uint32_t *', 'seed')], + is_static=True) + ## rng-stream.h: static void ns3::RngStream::SetPackageRun(uint32_t run) [member function] + cls.add_method('SetPackageRun', + 'void', + [param('uint32_t', 'run')], + is_static=True) + ## rng-stream.h: static uint32_t ns3::RngStream::GetPackageRun() [member function] + cls.add_method('GetPackageRun', + 'uint32_t', + [], + is_static=True) ## rng-stream.h: static bool ns3::RngStream::CheckSeed(uint32_t const * seed) [member function] cls.add_method('CheckSeed', 'bool', [param('uint32_t const *', 'seed')], is_static=True) + ## rng-stream.h: static bool ns3::RngStream::CheckSeed(uint32_t seed) [member function] + cls.add_method('CheckSeed', + 'bool', + [param('uint32_t', 'seed')], + is_static=True) return def register_Ns3SeedManager_methods(root_module, cls): From 63b331ecd21bdaa64dfd4d1ba02099261a5a6c01 Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Thu, 22 Jan 2009 15:59:50 -0500 Subject: [PATCH 10/13] Remove the nonsensical GetSeed --- src/core/random-variable.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/core/random-variable.h b/src/core/random-variable.h index 8e5057cfc..ec0681792 100644 --- a/src/core/random-variable.h +++ b/src/core/random-variable.h @@ -55,13 +55,7 @@ public: * \param seed */ static void SetSeed (uint32_t seed); - - /** - * \brief Get the seed value - * \return seed value - */ - static uint32_t GetSeed (); - + /** * \brief set the seed * \code From 8d45909678e09fd0f54e97d131f09b1af7fc136e Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Wed, 28 Jan 2009 13:35:47 -0500 Subject: [PATCH 11/13] Update the bindings for GetSeed change --- bindings/python/ns3_module_core.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bindings/python/ns3_module_core.py b/bindings/python/ns3_module_core.py index 4190a7369..489d0424d 100644 --- a/bindings/python/ns3_module_core.py +++ b/bindings/python/ns3_module_core.py @@ -667,11 +667,6 @@ def register_Ns3SeedManager_methods(root_module, cls): 'void', [param('uint32_t', 'seed')], is_static=True) - ## random-variable.h: static uint32_t ns3::SeedManager::GetSeed() [member function] - cls.add_method('GetSeed', - 'uint32_t', - [], - is_static=True) ## random-variable.h: static void ns3::SeedManager::SetSeed(uint32_t * seed) [member function] cls.add_method('SetSeed', 'void', From 8c1b14ba994cbfd3fc87e164792774e5c0f53cb3 Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Wed, 28 Jan 2009 15:04:28 -0500 Subject: [PATCH 12/13] Get/Set the package seed in a static variable --- src/core/rng-stream.cc | 8 ++++++-- src/core/rng-stream.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/rng-stream.cc b/src/core/rng-stream.cc index 89b76ad94..6980e2e80 100644 --- a/src/core/rng-stream.cc +++ b/src/core/rng-stream.cc @@ -367,6 +367,10 @@ double RngStream::nextSeed[6] = { 12345.0, 12345.0, 12345.0, 12345.0, 12345.0, 12345.0 }; +double RngStream::packageSeed[6] = +{ + 12345.0, 12345.0, 12345.0, 12345.0, 12345.0, 12345.0 +}; //------------------------------------------------------------------------- // constructor @@ -466,7 +470,7 @@ bool RngStream::SetPackageSeed (const uint32_t seed[6]) return false; } for (int i = 0; i < 6; ++i) - nextSeed[i] = seed[i]; + packageSeed[i] = nextSeed[i] = seed[i]; return true; } bool @@ -481,7 +485,7 @@ RngStream::GetPackageSeed (uint32_t seed[6]) EnsureGlobalInitialized (); for (int i = 0; i < 6; i++) { - seed[i] = nextSeed[i]; + seed[i] = static_cast (packageSeed[i]); } } void diff --git a/src/core/rng-stream.h b/src/core/rng-stream.h index 19f6a787f..55649a770 100644 --- a/src/core/rng-stream.h +++ b/src/core/rng-stream.h @@ -67,6 +67,7 @@ private: //members double U01d (); static uint32_t EnsureGlobalInitialized (void); private: //static data + static double packageSeed[6]; static double nextSeed[6]; }; From 20ddca38d68092689fcd70365239b490581805cb Mon Sep 17 00:00:00 2001 From: Raj Bhattacharjea Date: Thu, 29 Jan 2009 12:25:25 -0500 Subject: [PATCH 13/13] Explicit cast and correction in wifi/RandomStream --- src/devices/wifi/random-stream.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/wifi/random-stream.cc b/src/devices/wifi/random-stream.cc index 1a4229d88..0b086442f 100644 --- a/src/devices/wifi/random-stream.cc +++ b/src/devices/wifi/random-stream.cc @@ -20,6 +20,8 @@ #include "random-stream.h" #include "ns3/assert.h" +#include + namespace ns3 { RandomStream::~RandomStream () @@ -32,7 +34,7 @@ RealRandomStream::RealRandomStream () uint32_t RealRandomStream::GetNext (uint32_t min, uint32_t max) { - return m_stream.GetValue (min, max); + return static_cast (round (m_stream.GetValue (min, max))); }