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

Energy Analyzer

parent d995e93c
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
package de.tud.kom.p2psim.api.analyzer; package de.tud.kom.p2psim.api.analyzer;
import de.tud.kom.p2psim.api.common.SimHost; 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; import de.tudarmstadt.maki.simonstrator.api.component.core.MonitorComponent.Analyzer;
/** /**
...@@ -42,7 +43,7 @@ public interface EnergyAnalyzer extends Analyzer { ...@@ -42,7 +43,7 @@ public interface EnergyAnalyzer extends Analyzer {
* @param consumer * @param consumer
* The consumer, which consumed this amount of energy * 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. * Informs about an empty battery.
...@@ -66,7 +67,7 @@ public interface EnergyAnalyzer extends Analyzer { ...@@ -66,7 +67,7 @@ public interface EnergyAnalyzer extends Analyzer {
* mode. * mode.
*/ */
public void highPowerMode(SimHost host, long time, double consumedEnergy, 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 * Gets the time, how long the component was in low power mode
...@@ -82,7 +83,7 @@ public interface EnergyAnalyzer extends Analyzer { ...@@ -82,7 +83,7 @@ public interface EnergyAnalyzer extends Analyzer {
* mode. * mode.
*/ */
public void lowPowerMode(SimHost host, long time, double consumedEnergy, public void lowPowerMode(SimHost host, long time, double consumedEnergy,
String component); EnergyComponent component);
/** /**
* Gets the time, how long the component was in tail mode * Gets the time, how long the component was in tail mode
...@@ -98,7 +99,7 @@ public interface EnergyAnalyzer extends Analyzer { ...@@ -98,7 +99,7 @@ public interface EnergyAnalyzer extends Analyzer {
* mode. * mode.
*/ */
public void tailMode(SimHost host, long time, double consumedEnergy, public void tailMode(SimHost host, long time, double consumedEnergy,
String component); EnergyComponent component);
/** /**
* *
...@@ -108,5 +109,5 @@ public interface EnergyAnalyzer extends Analyzer { ...@@ -108,5 +109,5 @@ public interface EnergyAnalyzer extends Analyzer {
* @param component * @param component
*/ */
public void offMode(SimHost host, long time, double consumedEnergy, 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, ...@@ -137,7 +137,7 @@ public class ModularEnergyModel implements EnergyModel, EnergyEventListener,
*/ */
try { try {
Monitor.get(EnergyAnalyzer.class).consumeEnergy(getHost(), Monitor.get(EnergyAnalyzer.class).consumeEnergy(getHost(),
consumedEnergy, component.toString()); consumedEnergy, component);
} catch (AnalyzerNotAvailableException e1) { } 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