// get Id Value
lua_pushstring(L, "id");
lua_gettable(L, -2);
- host.V_host_id = lua_tostring(L, -1);
+ host.id = lua_tostring(L, -1);
lua_pop(L, 1);
// get power value
lua_pushstring(L, "power");
lua_gettable(L, -2);
- host.V_host_power_peak = lua_tonumber(L, -1);
+ host.power_peak = lua_tonumber(L, -1);
lua_pop(L, 1);
//get power_scale
lua_pushstring(L, "power_scale");
lua_gettable(L, -2);
- host.V_host_power_scale = lua_tonumber(L, -1);
+ host.power_scale = lua_tonumber(L, -1);
lua_pop(L, 1);
//get power_trace
lua_pushstring(L, "power_trace");
lua_gettable(L, -2);
- host.V_host_power_trace = tmgr_trace_new(lua_tostring(L, -1));
+ host.power_trace = tmgr_trace_new(lua_tostring(L, -1));
lua_pop(L, 1);
lua_pushstring(L, "core");
lua_gettable(L, -2);
- host.V_host_core = lua_tonumber(L, -1);
- if (host.V_host_core == 0)
- host.V_host_core = 1;
+ host.core_amount = lua_tonumber(L, -1);
+ if (host.core_amount == 0)
+ host.core_amount = 1;
lua_pop(L, 1);
//get state initial
state = lua_tonumber(L, -1);
lua_pop(L, 1);
if (state)
- host.V_host_state_initial = SURF_RESOURCE_ON;
+ host.initial_state = SURF_RESOURCE_ON;
else
- host.V_host_state_initial = SURF_RESOURCE_OFF;
+ host.initial_state = SURF_RESOURCE_OFF;
//get trace state
lua_pushstring(L, "state_trace");
lua_gettable(L, -2);
- host.V_host_state_trace = tmgr_trace_new(lua_tostring(L, -1));
+ host.state_trace = tmgr_trace_new(lua_tostring(L, -1));
lua_pop(L, 1);
sg_platf_new_host(&host);
// get Id Value
lua_pushstring(L, "id");
lua_gettable(L, -2);
- link.V_link_id = lua_tostring(L, -1);
+ link.id = lua_tostring(L, -1);
lua_pop(L, 1);
// get bandwidth value
lua_pushstring(L, "bandwidth");
lua_gettable(L, -2);
- link.V_link_bandwidth = lua_tonumber(L, -1);
+ link.bandwidth = lua_tonumber(L, -1);
lua_pop(L, 1);
//get latency value
lua_pushstring(L, "latency");
lua_gettable(L, -2);
- link.V_link_latency = lua_tonumber(L, -1);
+ link.latency = lua_tonumber(L, -1);
lua_pop(L, 1);
/*Optional Arguments */
//get bandwidth_trace value
lua_pushstring(L, "bandwidth_trace");
lua_gettable(L, -2);
- link.V_link_bandwidth_file = tmgr_trace_new(lua_tostring(L, -1));
+ link.bandwidth_trace = tmgr_trace_new(lua_tostring(L, -1));
lua_pop(L, 1);
//get latency_trace value
lua_pushstring(L, "latency_trace");
lua_gettable(L, -2);
- link.V_link_latency_file = tmgr_trace_new(lua_tostring(L, -1));
+ link.latency_trace = tmgr_trace_new(lua_tostring(L, -1));
lua_pop(L, 1);
//get state_trace value
lua_pushstring(L, "state_trace");
lua_gettable(L, -2);
- link.V_link_state_file = tmgr_trace_new(lua_tostring(L, -1));
+ link.state_trace = tmgr_trace_new(lua_tostring(L, -1));
lua_pop(L, 1);
//get state_initial value
lua_pushstring(L, "state_initial");
lua_gettable(L, -2);
if (lua_tonumber(L, -1))
- link.V_link_state = SURF_RESOURCE_ON;
+ link.state = SURF_RESOURCE_ON;
else
- link.V_link_state = SURF_RESOURCE_OFF;
+ link.state = SURF_RESOURCE_OFF;
lua_pop(L, 1);
//get policy value
policy = lua_tostring(L, -1);
lua_pop(L, 1);
if (policy && !strcmp(policy,"FULLDUPLEX")) {
- link.V_link_sharing_policy = SURF_LINK_FULLDUPLEX;
+ link.policy = SURF_LINK_FULLDUPLEX;
} else if (policy && !strcmp(policy,"FATPIPE")) {
- link.V_link_sharing_policy = SURF_LINK_FATPIPE;
+ link.policy = SURF_LINK_FATPIPE;
} else {
- link.V_link_sharing_policy = SURF_LINK_SHARED;
+ link.policy = SURF_LINK_SHARED;
}
sg_platf_new_link(&link);
lua_pushstring(L, "id");
lua_gettable(L, -2);
- router.V_router_id = lua_tostring(L, -1);
+ router.id = lua_tostring(L, -1);
lua_pop(L,1);
lua_pushstring(L,"coord");
lua_gettable(L,-2);
- router.V_router_coord = lua_tostring(L, -1);
+ router.coord = lua_tostring(L, -1);
lua_pop(L,1);
sg_platf_new_router(&router);