|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.sim.Energy
Class for energy modeling. All consumers create an instance of this class and keep it updated with all state changes concerning power consumption. This class keeps track of all these state changes and cycles spend in each state. The state changes are propagated to monitors based on a subscription system. This enables logging of power consumption.
Constructor Summary | |
Energy(java.lang.String deviceName,
double[] modeAmphere,
java.lang.String[] modeName,
int cpuFreq,
int startMode,
EnergyControl ec,
State st)
create new energy class, to enable energy modelling |
Method Summary | |
double |
getConsumedEnergy(int mode)
get the power consumption of a state |
double |
getCurrentAmphere()
get the current draw |
int |
getCurrentMode()
get the current state or mode of the device |
long |
getCycles(int mode)
get the cycles spend in a device state |
double |
getModeAmphere(int mode)
get the current draw of a mode |
java.lang.String |
getModeName(int mode)
get the name of a mode |
java.lang.String[] |
getModeNames()
get the names of all modes |
int |
getModeNumber()
get the number of modes of this device |
java.lang.String |
getName()
get the device name |
double |
getOldAmphere()
get the current draw of the old mode |
int |
getOldMode()
get old mode |
double |
getTotalConsumedEnergy()
get the power consumption of this device |
void |
setMode(int mode)
set the current mode or state of the device |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Energy(java.lang.String deviceName, double[] modeAmphere, java.lang.String[] modeName, int cpuFreq, int startMode, EnergyControl ec, State st)
deviceName
- name of the device to modelmodeAmphere
- array of current draw for each device state (in Amphere)modeName
- array of the names of each device statecpuFreq
- cpu frequencystartMode
- mode or state of the device at startup and resetec
- the simulator energy controlst
- the simulator stateMethod Detail |
public void setMode(int mode)
mode
- mode numer to setpublic double getTotalConsumedEnergy()
public double getConsumedEnergy(int mode)
mode
- the mode or state
public int getModeNumber()
public int getCurrentMode()
public java.lang.String getModeName(int mode)
mode
- mode number
public double getModeAmphere(int mode)
mode
- mode number
public long getCycles(int mode)
mode
- mode number
public java.lang.String getName()
public java.lang.String[] getModeNames()
public int getOldMode()
public double getCurrentAmphere()
public double getOldAmphere()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |