Commit d23e915b authored by Nils Richerzhagen's avatar Nils Richerzhagen
Browse files

Energy Analyzer

parent d995e93c
......@@ -21,6 +21,7 @@
package de.tud.kom.p2psim.api.analyzer;
import de.tud.kom.p2psim.api.common.SimHost;
import de.tud.kom.p2psim.api.energy.EnergyComponent;
import de.tudarmstadt.maki.simonstrator.api.component.core.MonitorComponent.Analyzer;
/**
......@@ -42,7 +43,7 @@ public interface EnergyAnalyzer extends Analyzer {
* @param consumer
* The consumer, which consumed this amount of energy
*/
public void consumeEnergy(SimHost host, double energy, String consumer);
public void consumeEnergy(SimHost host, double energy, EnergyComponent consumer);
/**
* Informs about an empty battery.
......@@ -66,7 +67,7 @@ public interface EnergyAnalyzer extends Analyzer {
* mode.
*/
public void highPowerMode(SimHost host, long time, double consumedEnergy,
String component);
EnergyComponent component);
/**
* Gets the time, how long the component was in low power mode
......@@ -82,7 +83,7 @@ public interface EnergyAnalyzer extends Analyzer {
* mode.
*/
public void lowPowerMode(SimHost host, long time, double consumedEnergy,
String component);
EnergyComponent component);
/**
* Gets the time, how long the component was in tail mode
......@@ -98,7 +99,7 @@ public interface EnergyAnalyzer extends Analyzer {
* mode.
*/
public void tailMode(SimHost host, long time, double consumedEnergy,
String component);
EnergyComponent component);
/**
*
......@@ -108,5 +109,5 @@ public interface EnergyAnalyzer extends Analyzer {
* @param component
*/
public void offMode(SimHost host, long time, double consumedEnergy,
String component);
EnergyComponent component);
}
\ No newline at end of file
......@@ -137,7 +137,7 @@ public class ModularEnergyModel implements EnergyModel, EnergyEventListener,
*/
try {
Monitor.get(EnergyAnalyzer.class).consumeEnergy(getHost(),
consumedEnergy, component.toString());
consumedEnergy, component);
} catch (AnalyzerNotAvailableException e1) {
//
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment