atropos.lp
Class PredMeasure

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--atropos.lp.PredMeasure
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class PredMeasure
extends java.util.Vector
implements java.io.Serializable

This class calculates a prediction accuracy measure over a given time interval. For the AVNMP system, there would be many of these objects; each object's time interval set from the current time to the end of the sliding window lookahead time.

This research is funded by DARPA/ITO Contract Number: F30602-98-C-0230 supported by the Air Force Research Laboratory/IF.

Version:
$Revision: 1.1.1.1 $ $State: Exp $
Author:
Steve Bush
See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PredMeasure(long start_time, long end_time)
          The sample interval.
 
Method Summary
 void addSample(AvnmpStateQueue sq, long lvt, long t, AvnmpLP mylp)
          Add a sample from the state queue over the sample interval of interest.
 double calcAcc(long lvt, long t, AvnmpLP mylp)
          Compute the prediction accuracy measure.
 long endTime()
          Return the sample interval end time.
 java.lang.String toPredString()
          Display the state of this object by printing it's unique sample interval and current sample values.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

PredMeasure

public PredMeasure(long start_time,
                   long end_time)
The sample interval. Note that a sample must have both real and predicted values to be useful, so choosing an interval which is too short is of no use. Also, the prediction accuracy measure is an average over the interval, thus choosing intervals which are too large will result in lost information.
Parameters:
start_time - Interval start time (simulation time).
end_time - Interval end time (simulation time). This is usually the start_time plus the sliding window lookahead time.
Method Detail

addSample

public void addSample(AvnmpStateQueue sq,
                      long lvt,
                      long t,
                      AvnmpLP mylp)
Add a sample from the state queue over the sample interval of interest. The sample may either predicted or real. This is determined by comparing the sample time (t) and local virtual time (lvt) with the sample intervals. All predicted samples, included predictions later rolled back, are stored. The predicted
Parameters:
sq - The state queue.
lvt - The local virtual time.
t - The current real time.
mylp - The current logical process in which this object resides.

calcAcc

public double calcAcc(long lvt,
                      long t,
                      AvnmpLP mylp)
               throws NoRealException,
                      NoPredictedException
Compute the prediction accuracy measure. This is only done if actual values have been recorded, that is, real time has passed the sample interval end time. Also, real and predicted samples must have been added. The prediction measure is the sum of the absolute values of the predicted values minus the real values over the sample interval width.
Parameters:
lvt - The local virtual time.
t - The real time.
mylp - The current logical process in which this object resides.
Returns:
A measure of the prediction accuracy of all the samples given multiple rollbacks may have occured.

toPredString

public java.lang.String toPredString()
Display the state of this object by printing it's unique sample interval and current sample values.
Returns:
A string value of the above.

endTime

public long endTime()
Return the sample interval end time.
Returns:
A long value of the above.


Copyright © 2002 GE Corporate Research and Development. All Rights Reserved.