X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b024b9e443552c94609fc56a240cdb199a329853..6499d175675a0a61acc5b9132ed1d54ed194a1ae:/src/bindings/lua/lua_platf.cpp diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 905776d163..eba4663362 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -7,21 +7,23 @@ #include "lua_private.hpp" #include "simgrid/kernel/routing/NetPoint.hpp" +#include "src/kernel/resource/profile/Profile.hpp" #include "src/surf/network_interface.hpp" +#include "src/surf/surf_private.hpp" #include "src/surf/xml/platf_private.hpp" -#include -#include -#include - -#include "src/surf/surf_private.hpp" #include #include #include #include + +#include +#include #include #include +#include + XBT_LOG_NEW_DEFAULT_CATEGORY(lua_platf, "Lua bindings (platform module)"); constexpr char PLATF_MODULE_NAME[] = "simgrid.engine"; @@ -92,7 +94,7 @@ int console_add_backbone(lua_State *L) { type = lua_gettable(L, -2); lua_ensure(type == LUA_TSTRING || type == LUA_TNUMBER, "Attribute 'bandwidth' must be specified for backbone and must either be a string (in the right format; see docs) or a number."); - link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of backbone", link.id.c_str()); + link.bandwidths.push_back(surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of backbone", link.id.c_str())); lua_pop(L, 1); lua_pushstring(L, "lat"); @@ -226,9 +228,9 @@ int console_add_link(lua_State *L) { lua_ensure(type == LUA_TSTRING || type == LUA_TNUMBER, "Attribute 'bandwidth' must be specified for any link and must either be either a string (in the right format; see docs) or a number."); if (type == LUA_TNUMBER) - link.bandwidth = lua_tonumber(L, -1); + link.bandwidths.push_back(lua_tonumber(L, -1)); else // LUA_TSTRING - link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of link", link.id.c_str()); + link.bandwidths.push_back(surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of link", link.id.c_str())); lua_pop(L, 1); //get latency value