-void surf_workstation_set_power_peak_at(surf_resource_t resource, int pstate_index){
- return get_casted_workstation(resource)->setPowerPeakAt(pstate_index);
+int surf_host_get_nb_pstates(sg_host_t host){
+ return host->p_cpu->getNbPStates();
+}
+
+void surf_host_set_pstate(sg_host_t host, int pstate_index){
+ host->p_cpu->setPState(pstate_index);
+}
+int surf_host_get_pstate(sg_host_t host){
+ return host->p_cpu->getPState();
+}
+
+using simgrid::energy::HostEnergy;
+using simgrid::energy::surf_energy;
+
+double surf_host_get_wattmin_at(sg_host_t resource, int pstate){
+ xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
+ std::map<simgrid::surf::Host*, HostEnergy*>::iterator hostIt = surf_energy->find(get_casted_host(resource));
+ return hostIt->second->getWattMinAt(pstate);
+}
+double surf_host_get_wattmax_at(sg_host_t resource, int pstate){
+ xbt_assert(surf_energy!=NULL, "The Energy plugin is not active. Please call sg_energy_plugin_init() during initialization.");
+ std::map<simgrid::surf::Host*, HostEnergy*>::iterator hostIt = surf_energy->find(get_casted_host(resource));
+ return hostIt->second->getWattMaxAt(pstate);