+#include <simgrid/kernel/routing/NetPoint.hpp>
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Host.hpp>
+#include <simgrid/s4u/VirtualMachine.hpp>
+
+#include "src/kernel/EngineImpl.hpp"
+#include "src/kernel/resource/CpuImpl.hpp"
+#include "src/kernel/resource/DiskImpl.hpp"
+#include "src/kernel/resource/HostImpl.hpp"
+#include "src/kernel/resource/NetworkModel.hpp"
+#include "src/kernel/resource/SplitDuplexLinkImpl.hpp"
+#include "src/kernel/resource/StandardLinkImpl.hpp"
+#include "src/kernel/resource/VirtualMachineImpl.hpp"
+#include "src/simgrid/module.hpp"
+#include "src/simgrid/sg_config.hpp"
+#include "xbt/asserts.hpp"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_platform, kernel, "Kernel platform-related information");
+
+namespace simgrid::kernel::routing {
+
+xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
+ kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
+ std::vector<kernel::resource::StandardLinkImpl*> const& link_list)>
+ NetZoneImpl::on_route_creation;
+
+NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name)
+{
+ auto* engine = s4u::Engine::get_instance();
+ /* workaroud: first netzoneImpl will be the root netzone.
+ * Without globals and with current model description init functions (see module.hpp), we need
+ * the root netzone to exist when creating the models.
+ * This is usually done at sg_platf.cpp, during XML parsing */
+ if (not engine->get_netzone_root()) {
+ engine->set_netzone_root(&piface_);
+ /* root netzone set, initialize models */
+ simgrid::s4u::Engine::on_platform_creation();
+
+ /* Initialize the models. That must be done after we got all config, and before we need the models.
+ * That is, after the last <config> tag, if any, and before the first of cluster|peer|zone|trace|trace_cb
+ *
+ * I'm not sure for <trace> and <trace_cb>, there may be a bug here
+ * (FIXME: check it out by creating a file beginning with one of these tags)
+ * but cluster and peer come down to zone creations, so putting this verification here is correct.
+ */
+ simgrid_host_models().init_from_flag_value();
+ simgrid_vm_model_init_HL13();
+ }