shady.common
Class ShadyAccountingInfo

java.lang.Object
  extended by shady.common.ShadyAccountingInfo
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ShadyAccountingInfo
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A representation of the accounting info for the mechanism.

Target: 1.1 JVM.

Shady implementations are supposed to keep track of this info, and provide it to high-level code via ShadyCommonAPI.getAccountingInfo().

High-level code can use the info to make decisions.

It is intended that this info be relatively easy for the low-level implementation to maintain while still being useful to the high-level algorithms.

Copyright (C) 2006 Marsette A. Vona, III

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Author:
Marsette (Marty) A. Vona, III
See Also:
Serialized Form

Field Summary
 double currentBatteryEnergy
          The system's best estimate of the total remaining battery capacity, in Joules.
private static java.lang.String cvsid
          CVS id.
static int GRIPPER_CLOSE
          Identifies a gripper close operation.
static int GRIPPER_OPEN
          Identifies a gripper open operation.
 int[] numEnergyTalliedGrips
          The total number of gripper close/open operations (both successful and otherwise), since reboot or since the last ShadyCommonAPI.resetAccounting(), for which totalGripEnergy was updated.
 int numEnergyTalliedRotations
          The total number of rotation operations executed (or attempted) since reboot or since the last ShadyCommonAPI.resetAccounting() for which totalRotationEnergy was updated.
 int numFaults
          The total number of faults since reboot or since the last ShadyCommonAPI.resetAccounting().
 int[] numGrips
          The total number of gripper close/open operations (both successful and otherwise), since reboot or since the last ShadyCommonAPI.resetAccounting().
 int numRotations
          The total number of rotation operations executed (or attempted) since reboot or since the last ShadyCommonAPI.resetAccounting().
 int[] numSuccessfulGrips
          The total number of successful gripper close/open operations since reboot or since the last ShadyCommonAPI.resetAccounting().
 int numSuccessfulRotations
          The total number of successful rotation operations executed (or attempted) since reboot or since the last ShadyCommonAPI.resetAccounting().
 double totalAccountingTime
          The total duration, in seconds, since reboot or since the last ShadyCommonAPI.resetAccounting().
 double totalBatteryEnergy
          The system's best estimate of the total battery capacity (i.e., when fully charged), in Joules.
 double totalEnergyConsumed
          The total system energy consumption, in Joules, since reboot or since the last ShadyCommonAPI.resetAccounting().
 double[] totalGripEnergy
          The total amount of energy spent closing/opening grippers (or attempting to), in Joules, since reboot or since the last ShadyCommonAPI.resetAccounting().
 double[] totalGripTime
          The total duration spent closing/opening grippers (or attempting to), in seconds, since reboot or since the last ShadyCommonAPI.resetAccounting().
 double totalRotationAngle
          The total degrees rotated (or attempted) since reboot or since the last ShadyCommonAPI.resetAccounting().
 double totalRotationEnergy
          The total amount of energy spent rotating barrels (or attempting to), in Joules, since reboot or since the last ShadyCommonAPI.resetAccounting().
 double totalRotationTime
          The total duration spent rotating barrels (or attempting to), in seconds, since reboot or since the last ShadyCommonAPI.resetAccounting().
 
Constructor Summary
ShadyAccountingInfo()
           
 
Method Summary
 ShadyAccountingInfo copy()
          Return a clone().
 ShadyAccountingInfo copyInto(ShadyAccountingInfo dest)
          Copy into dest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvsid

private static final java.lang.String cvsid

CVS id.

See Also:
Constant Field Values

GRIPPER_CLOSE

public static final int GRIPPER_CLOSE

Identifies a gripper close operation.

See Also:
Constant Field Values

GRIPPER_OPEN

public static final int GRIPPER_OPEN

Identifies a gripper open operation.

See Also:
Constant Field Values

totalAccountingTime

public double totalAccountingTime

The total duration, in seconds, since reboot or since the last ShadyCommonAPI.resetAccounting().


numFaults

public int numFaults

The total number of faults since reboot or since the last ShadyCommonAPI.resetAccounting().


totalBatteryEnergy

public double totalBatteryEnergy

The system's best estimate of the total battery capacity (i.e., when fully charged), in Joules.

Some implementations may incrementally refine this estimate. Such refinement processes should be reset when ShadyCommonAPI.resetAccounting() is called.


currentBatteryEnergy

public double currentBatteryEnergy

The system's best estimate of the total remaining battery capacity, in Joules.


totalEnergyConsumed

public double totalEnergyConsumed

The total system energy consumption, in Joules, since reboot or since the last ShadyCommonAPI.resetAccounting().


totalRotationTime

public double totalRotationTime

The total duration spent rotating barrels (or attempting to), in seconds, since reboot or since the last ShadyCommonAPI.resetAccounting().


totalRotationEnergy

public double totalRotationEnergy

The total amount of energy spent rotating barrels (or attempting to), in Joules, since reboot or since the last ShadyCommonAPI.resetAccounting().

Only counts numEnergyTalliedRotations rotations.


numEnergyTalliedRotations

public int numEnergyTalliedRotations

The total number of rotation operations executed (or attempted) since reboot or since the last ShadyCommonAPI.resetAccounting() for which totalRotationEnergy was updated.


numRotations

public int numRotations

The total number of rotation operations executed (or attempted) since reboot or since the last ShadyCommonAPI.resetAccounting().


numSuccessfulRotations

public int numSuccessfulRotations

The total number of successful rotation operations executed (or attempted) since reboot or since the last ShadyCommonAPI.resetAccounting().


totalRotationAngle

public double totalRotationAngle

The total degrees rotated (or attempted) since reboot or since the last ShadyCommonAPI.resetAccounting().


totalGripTime

public double[] totalGripTime

The total duration spent closing/opening grippers (or attempting to), in seconds, since reboot or since the last ShadyCommonAPI.resetAccounting().


totalGripEnergy

public double[] totalGripEnergy

The total amount of energy spent closing/opening grippers (or attempting to), in Joules, since reboot or since the last ShadyCommonAPI.resetAccounting().

Only counts numEnergyTalliedGrips grips.


numEnergyTalliedGrips

public int[] numEnergyTalliedGrips

The total number of gripper close/open operations (both successful and otherwise), since reboot or since the last ShadyCommonAPI.resetAccounting(), for which totalGripEnergy was updated.


numGrips

public int[] numGrips

The total number of gripper close/open operations (both successful and otherwise), since reboot or since the last ShadyCommonAPI.resetAccounting().


numSuccessfulGrips

public int[] numSuccessfulGrips

The total number of successful gripper close/open operations since reboot or since the last ShadyCommonAPI.resetAccounting().

Constructor Detail

ShadyAccountingInfo

public ShadyAccountingInfo()
Method Detail

copy

public ShadyAccountingInfo copy()

Return a clone().

Returns:
a clone

copyInto

public ShadyAccountingInfo copyInto(ShadyAccountingInfo dest)

Copy into dest.

Parameters:
dest - the destination of the copy, or null to cons a new one
Returns:
the copy