Constructors (All) Constructors: set the UID number EnergyMonitor() - create a module with the default name “MyEnergyMonitor” EnergyMonitor(String name) - create a module with the specified name Queries: String getName() - get name of the file boolean isOn() - returns true/false power is flowing double getPower() - get average power over last 10 seconds (as a simplication, assume this method is called every 10 seconds). Assume that the method is called at the end of a 10 second boundary. This should be the only place where power is computed so that sampling of power every 10 seconds is preserved for purposes of computing energy and whether or not there is a load attached. double getEnergy() - get the watt hours delivered to the load since creation or last reset (considering all energy until the last getEnergy() invocation) long getUID() - get the UID of this object String toString() - returns a string " with UID : Watts, Watt Hours" perhaps something like "MyEnergyMonitor with UID 1000: 10.20 Watts, 100 Watt Hours" Commands: setLoad(double resistance) - set the load on the energy monitor (in ohms), negative values mean no load setName(String newName) - set a new name for the energy monitor, object no longer backed up if name changed reset() - reset the energy accumulation Like all other modeling objects, the EnergyMonitor should not not contain I/O.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
Get Free Quote!
369 Experts Online