- int index = luaL_checkinteger(L, 1);
- xbt_dynar_t hosts = sg_hosts_as_dynar();
- sg_host_t host = xbt_dynar_get_as(hosts,index - 1,sg_host_t);// lua indexing start by 1 (lua[1] <=> C[0])
+ lua_Integer index = luaL_checkinteger(L, 1);
+ std::vector<sg_host_t> hosts = simgrid::s4u::Engine::get_instance()->get_all_hosts();
+ sg_host_t host = hosts[index - 1]; // lua indexing start by 1 (lua[1] <=> C[0])