double angle = 0;
auto nb_stations = static_cast<double>(wifizone->get_all_hosts().size() - 1);
double step = 2 * M_PI / nb_stations;
- for (auto station_host : wifizone->get_all_hosts()) {
+ for (const auto* station_host : wifizone->get_all_hosts()) {
station_netpoint_ns3 = station_host->get_netpoint()->extension<NetPointNs3>();
if (station_netpoint_ns3 == access_point_netpoint_ns3)
continue;
});
namespace simgrid {
-namespace kernel {
-namespace resource {
+namespace kernel::resource {
NetworkNS3Model::NetworkNS3Model(const std::string& name) : NetworkModel(name)
{
ns3::Config::SetDefault("ns3::TcpSocket::DelAckCount", ns3::UintegerValue(1));
ns3::Config::SetDefault("ns3::TcpSocketBase::Timestamp", ns3::BooleanValue(false));
- auto const& TcpProtocol = ns3_tcp_model.get();
- if (TcpProtocol == "default") {
+ if (auto const& TcpProtocol = ns3_tcp_model.get(); TcpProtocol == "default") {
/* nothing to do */
} else if (TcpProtocol == "Reno" || TcpProtocol == "NewReno" || TcpProtocol == "Tahoe") {
return link;
}
-Action* NetworkNS3Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
+Action* NetworkNS3Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate, bool /*streamed*/)
{
xbt_assert(rate == -1,
"Communication over ns-3 links cannot specify a specific rate. Please use -1 as a value instead of %f.",
// ns-3 fails when src = dst, so avoid the problem by considering that communications are infinitely fast on the
// loopback that does not exists
if (src == dst) {
- static bool warned = false;
- if (not warned) {
+ if (static bool warned = false; not warned) {
XBT_WARN("Sending from a host %s to itself is not supported by ns-3. Every such communication finishes "
"immediately upon startup.",
src->get_cname());
THROW_IMPOSSIBLE;
}
-} // namespace resource
-} // namespace kernel
+} // namespace kernel::resource
ns3::Ptr<ns3::Node> get_ns3node_from_sghost(const simgrid::s4u::Host* host)
{