/* added to manage the communication action's heap */
static void net_action_update_index_heap(void *action, int i)
{
/* added to manage the communication action's heap */
static void net_action_update_index_heap(void *action, int i)
{
static void heap_insert(surf_action_network_CM02_t action, double key,
enum heap_action_type hat)
{
static void heap_insert(surf_action_network_CM02_t action, double key,
enum heap_action_type hat)
{
xbt_heap_push(net_action_heap, action, key);
}
static void heap_remove(surf_action_network_CM02_t action)
{
xbt_heap_push(net_action_heap, action, key);
}
static void heap_remove(surf_action_network_CM02_t action)
{
- action->hat = NOTSET;
- if (((surf_action_network_CM02_t) action)->index_heap >= 0) {
- xbt_heap_remove(net_action_heap, action->index_heap);
+ GENERIC_LMM_ACTION(action).hat = NOTSET;
+ if (GENERIC_LMM_ACTION(action).index_heap >= 0) {
+ xbt_heap_remove(net_action_heap, GENERIC_LMM_ACTION(action).index_heap);
double_update(&(((surf_action_t)action)->remains),
lmm_variable_getvalue(((surf_action_lmm_t) action)->variable) * delta);
double_update(&(((surf_action_t)action)->remains),
lmm_variable_getvalue(((surf_action_lmm_t) action)->variable) * delta);
// no need to communicate anymore
// assume that flows that reached max_duration have remaining of 0
GENERIC_ACTION(action).remains = 0;
// no need to communicate anymore
// assume that flows that reached max_duration have remaining of 0
GENERIC_ACTION(action).remains = 0;
xbt_swag_insert(action, ((surf_action_t)action)->state_set);
action->rate = rate;
if (network_update_mechanism == UM_LAZY) {
xbt_swag_insert(action, ((surf_action_t)action)->state_set);
action->rate = rate;
if (network_update_mechanism == UM_LAZY) {
if (network_update_mechanism == UM_LAZY) {
// add to the heap the event when the latency is payed
XBT_DEBUG("Added action (%p) one latency event at date %f", action,
if (network_update_mechanism == UM_LAZY) {
// add to the heap the event when the latency is payed
XBT_DEBUG("Added action (%p) one latency event at date %f", action,
- action->latency + action->last_update);
- heap_insert(action, action->latency + action->last_update,
+ action->latency + GENERIC_LMM_ACTION(action).last_update);
+ heap_insert(action, action->latency + GENERIC_LMM_ACTION(action).last_update,
xbt_heap_set_update_callback(net_action_heap,
net_action_update_index_heap);
net_modified_set =
xbt_heap_set_update_callback(net_action_heap,
net_action_update_index_heap);
net_modified_set =