- s4u::Engine::on_platform_created.connect(on_platform_created);
- s4u::Host::on_creation.connect(on_host_creation);
- s4u::Host::on_speed_change.connect(on_host_speed_change);
- s4u::Link::on_creation.connect(on_link_creation);
- s4u::Link::on_bandwidth_change.connect(on_link_bandwidth_change);
- s4u::NetZone::on_seal.connect([](s4u::NetZone const& /*netzone*/) { currentContainer.pop_back(); });
- kernel::routing::NetPoint::on_creation.connect(on_netpoint_creation);
+ s4u::Engine::on_platform_created_cb(on_platform_created);
+ s4u::Host::on_creation_cb(on_host_creation);
+ s4u::Host::on_speed_change_cb([](s4u::Host const& host) {
+ Container::by_name(host.get_name())
+ ->get_variable("speed")
+ ->set_event(simgrid_get_clock(), host.get_core_count() * host.get_available_speed());
+ });
+ s4u::Link::on_creation_cb(on_link_creation);
+ s4u::Link::on_bandwidth_change_cb([](s4u::Link const& link) {
+ Container::by_name(link.get_name())
+ ->get_variable("bandwidth")
+ ->set_event(simgrid_get_clock(), sg_bandwidth_factor * link.get_bandwidth());
+ });
+ s4u::NetZone::on_seal_cb([](s4u::NetZone const& /*netzone*/) { currentContainer.pop_back(); });
+ kernel::routing::NetPoint::on_creation.connect([](kernel::routing::NetPoint const& netpoint) {
+ if (netpoint.is_router())
+ new RouterContainer(netpoint.get_name(), currentContainer.back());
+ });