if (action->model_type == surf_network_model)
surf_network_model->action_cancel(action);
else if (action->model_type == surf_cpu_model)
- surf_cpu_model->action_cancel(action);
+ action->model_type->action_cancel(action);
else if (action->model_type == surf_workstation_model)
ws_parallel_action_cancel(action);
else
if (action->model_type == surf_network_model)
surf_network_model->action_state_set(action, state);
else if (action->model_type == surf_cpu_model)
- surf_cpu_model->action_state_set(action, state);
+ action->model_type->action_state_set(action, state);
else if (action->model_type == surf_workstation_model)
surf_action_state_set(action, state);
else
if (action->model_type == surf_network_model)
surf_network_model->suspend(action);
else if (action->model_type == surf_cpu_model)
- surf_cpu_model->suspend(action);
+ action->model_type->suspend(action);
else
DIE_IMPOSSIBLE;
}
if (action->model_type == surf_network_model)
surf_network_model->resume(action);
else if (action->model_type == surf_cpu_model)
- surf_cpu_model->resume(action);
+ action->model_type->resume(action);
else
DIE_IMPOSSIBLE;
}
if (action->model_type == surf_network_model)
return surf_network_model->is_suspended(action);
if (action->model_type == surf_cpu_model)
- return surf_cpu_model->is_suspended(action);
+ return action->model_type->is_suspended(action);
DIE_IMPOSSIBLE;
return -1;
}
if (action->model_type == surf_network_model)
surf_network_model->set_max_duration(action, duration);
else if (action->model_type == surf_cpu_model)
- surf_cpu_model->set_max_duration(action, duration);
+ action->model_type->set_max_duration(action, duration);
else
DIE_IMPOSSIBLE;
}
if (action->model_type == surf_network_model)
surf_network_model->set_priority(action, priority);
else if (action->model_type == surf_cpu_model)
- surf_cpu_model->set_priority(action, priority);
+ action->model_type->set_priority(action, priority);
else
DIE_IMPOSSIBLE;
}
if (action->model_type == surf_network_model)
surf_network_model->set_category(action, category);
else if (action->model_type == surf_cpu_model)
- surf_cpu_model->set_category(action, category);
+ action->model_type->set_category(action, category);
else
DIE_IMPOSSIBLE;
}
if (action->model_type == surf_network_model)
return surf_network_model->get_remains(action);
if (action->model_type == surf_cpu_model)
- return surf_cpu_model->get_remains(action);
+ return action->model_type->get_remains(action);
DIE_IMPOSSIBLE;
return -1.0;
}
static e_surf_resource_state_t ws_get_state(void *workstation)
{
- return surf_cpu_model->extension.cpu.
- get_state(workstation);
+ surf_resource_t cpu = ((surf_resource_t) surf_cpu_resource_priv(workstation));
+ return cpu->model->extension.cpu.get_state(workstation);
}
static double ws_get_speed(void *workstation, double load)
{
- return surf_cpu_model->extension.cpu.
- get_speed(workstation, load);
+ surf_resource_t cpu = ((surf_resource_t) surf_cpu_resource_priv(workstation));
+ return cpu->model->extension.cpu.get_speed(workstation, load);
}
static double ws_get_available_speed(void *workstation)
{
- return surf_cpu_model->extension.cpu.
- get_available_speed(workstation);
+ surf_resource_t cpu = ((surf_resource_t) surf_cpu_resource_priv(workstation));
+ return cpu->model->extension.cpu.get_available_speed(workstation);
}
static surf_action_t ws_execute_parallel_task(int workstation_nb,