jaga.pj.circuits.fpgaft
Class SingleRandomFaultModel

java.lang.Object
  |
  +--jaga.pj.circuits.fpgaft.SingleRandomFaultModel
All Implemented Interfaces:
java.util.Enumeration, FaultModel, java.io.Serializable, SingleFaultModel

public class SingleRandomFaultModel
extends java.lang.Object
implements SingleFaultModel

A fault model where a single element will fail at any time, but this element will be chosen randomly from a range of values. The number of elements chose in this series of fautls is also random.

To have different random series the randomizer seed must be changed by calling nextRandomSeries().

See Also:
Serialized Form

Constructor Summary
SingleRandomFaultModel(int proofPos)
          Creates new SingleRandomFaultModel.
SingleRandomFaultModel(int proofPos, int phowMany)
          Creates new SingleRandomFaultModel
SingleRandomFaultModel(int pfloorPos, int proofPos, int phowMany, int ftypes)
          Creates new SingleRandomFaultModel
 
Method Summary
 boolean hasMoreElements()
           
 java.lang.Object nextElement()
           
 void nextRandomSeries()
           
 void reset()
          Resets the sequence of faults
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleRandomFaultModel

public SingleRandomFaultModel(int proofPos)
Creates new SingleRandomFaultModel.
Parameters:
proofPos - position of (EXCLUSIVE) highest element number to randomly pick from. Note this value will never be picked.

SingleRandomFaultModel

public SingleRandomFaultModel(int proofPos,
                              int phowMany)
Creates new SingleRandomFaultModel
Parameters:
proofPos - position of highest element number to randomly pick from.
phowMany - how many random elements to pick to make sequence.

SingleRandomFaultModel

public SingleRandomFaultModel(int pfloorPos,
                              int proofPos,
                              int phowMany,
                              int ftypes)
Creates new SingleRandomFaultModel
Parameters:
proofPos - position of lowest element number to randomly pick from.
proofPos - position of highest element number to randomly pick from.
phowMany - how many random elements to pick to make sequence.
ftypes - number of fault types to generate. These are as defined in FTLib.
Method Detail

reset

public void reset()
Resets the sequence of faults
Specified by:
reset in interface FaultModel

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration

nextElement

public java.lang.Object nextElement()
Specified by:
nextElement in interface java.util.Enumeration

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

nextRandomSeries

public void nextRandomSeries()