pipe.io
Class TransitionRecord

java.lang.Object
  extended by pipe.io.TransitionRecord

public class TransitionRecord
extends java.lang.Object


Constructor Summary
TransitionRecord()
           
TransitionRecord(int from, int to, double r)
           
TransitionRecord(int from, int to, double r, int t)
           
TransitionRecord(Marking from, Marking to, double r)
          Sets up the record ready for writing to a file.
 
Method Summary
 boolean equals(TransitionRecord test)
          equals() Overrides the Object.equals method.
 int getFromState()
           
 double getRate()
           
 int getRecordSize()
           
 int getToState()
           
 int getTransitionNo()
           
 boolean read(java.io.RandomAccessFile inputfile)
          read() Reads a TransitionRecord from the specified input file.
 boolean read1(java.io.RandomAccessFile inputfile)
           
 void updateRate(double r)
          updateRate() When recording a transition from one state to another, it is possible that there will be multiple paths between them through vanishing states.
 void write(java.io.RandomAccessFile outputfile)
           
 void write1(java.io.RandomAccessFile outputfile)
          write() Writes a TransitionRecord to the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransitionRecord

public TransitionRecord(Marking from,
                        Marking to,
                        double r)
Sets up the record ready for writing to a file.


TransitionRecord

public TransitionRecord(int from,
                        int to,
                        double r)

TransitionRecord

public TransitionRecord(int from,
                        int to,
                        double r,
                        int t)

TransitionRecord

public TransitionRecord()
Method Detail

write1

public void write1(java.io.RandomAccessFile outputfile)
            throws java.io.IOException
write() Writes a TransitionRecord to the specified file.

Parameters:
outputfile - The file to write data to
Throws:
java.io.IOException

write

public void write(java.io.RandomAccessFile outputfile)
           throws java.io.IOException
Throws:
java.io.IOException

read

public boolean read(java.io.RandomAccessFile inputfile)
             throws java.io.IOException
read() Reads a TransitionRecord from the specified input file.

Parameters:
inputfile - The file to read data from
ss - A number indicating how many elements there are in a state array
Throws:
java.io.IOException

read1

public boolean read1(java.io.RandomAccessFile inputfile)
              throws java.io.IOException
Throws:
java.io.IOException

updateRate

public void updateRate(double r)
updateRate() When recording a transition from one state to another, it is possible that there will be multiple paths between them through vanishing states. If this happens, the rates of transition between all those paths should just be combined into one effective rate by multiplying the rates.

Parameters:
r -

getFromState

public int getFromState()

getTransitionNo

public int getTransitionNo()

getToState

public int getToState()

getRate

public double getRate()

getRecordSize

public int getRecordSize()

equals

public boolean equals(TransitionRecord test)
equals() Overrides the Object.equals method. Returns true if and only if both records have identical elements in their fromstatearrays and also in their twostatearrays.

Parameters:
test - The record to be compared with
Returns: