+ // Add a new host programatically, and attach a state profile to it
+ auto* root = e.get_netzone_root();
+ auto* lilibeth = root->create_host("Lilibeth", 1e15);
+ sg4::LinkInRoute link = sg4::LinkInRoute(e.link_by_name("10"));
+ root->add_route(e.host_by_name("Tremblay")->get_netpoint(), lilibeth->get_netpoint(), nullptr, nullptr, {link}, true);
+ lilibeth->set_state_profile(simgrid::kernel::profile::ProfileBuilder::from_string("lilibeth_profile", R"(
+4 0
+5 1
+)",
+ 10));
+ lilibeth->seal();
+
+ // Create an actor on that new host, to monitor its own state
+ auto actor = sg4::Actor::create("sleeper", lilibeth, []() {
+ XBT_INFO("Start sleeping...");
+ sg4::this_actor::sleep_for(1);
+ XBT_INFO("done sleeping.");
+ });
+ actor->set_auto_restart(true);
+