-/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <lauxlib.h>
-XBT_LOG_NEW_DEFAULT_CATEGORY(lua_platf, "Lua bindings (platform module)");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_platf, lua, "Lua bindings (platform module)");
constexpr char PLATF_MODULE_NAME[] = "simgrid.engine";
constexpr char AS_FIELDNAME[] = "__simgrid_as";
int console_open(lua_State*)
{
sg_platf_init();
- simgrid::s4u::on_platform_creation();
+ simgrid::s4u::Engine::on_platform_creation();
return 0;
}
int console_close(lua_State*)
{
- simgrid::s4u::on_platform_created();
+ simgrid::s4u::Engine::on_platform_created();
sg_platf_exit();
return 0;
}
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");
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