de.cau.cs.kieler.krep.evalbench.trace
Class Tick

java.lang.Object
  extended by de.cau.cs.kieler.krep.evalbench.trace.Tick

public class Tick
extends Object

One tick in a trace. Contains input and output signals with their values, as well as output signals that were saved at a given time.

Rating proposed yellow
(2010-01-28) ctr

Constructor Summary
Tick()
          generate empty tick.
Tick(LinkedList<Signal> ins, LinkedList<Signal> outs)
          Generate tick.
Tick(Tick t)
          copy tick contents.
 
Method Summary
 void add(IO io, Signal s)
          Add additional signal to a tick.
 void clearOutput()
          restores the initial state by removing all output signals.
 LinkedList<Signal> getInputs()
           
 LinkedList<Signal> getOutputs()
           
 int getRT()
           
 void setOutput(Tick t)
          copy all outputs from Tick t.
 void setRT(int reactionTime)
          set the reaction time to compute this tick.
 void snapshot()
          save the current status of all outputs.
 String toString(IO io)
          print part of the tick.
 boolean validate(Tick tick)
          Test whether the current output is equal to the last snapshot of tick t.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tick

public Tick()
generate empty tick.


Tick

public Tick(Tick t)
copy tick contents.

Parameters:
t - tick to copy

Tick

public Tick(LinkedList<Signal> ins,
            LinkedList<Signal> outs)
Generate tick.

Parameters:
ins - list of input signals with their values
outs - list of output signals with their values
Method Detail

add

public void add(IO io,
                Signal s)
Add additional signal to a tick.

Parameters:
io - indicates what kind of signal this is
s - the signal

toString

public String toString(IO io)
print part of the tick.

Parameters:
io - indicate whether input, output or reference outputs are printed
Returns:
String representation

getInputs

public LinkedList<Signal> getInputs()
Returns:
input signals

getOutputs

public LinkedList<Signal> getOutputs()
Returns:
output signals

snapshot

public void snapshot()
save the current status of all outputs.


validate

public boolean validate(Tick tick)
Test whether the current output is equal to the last snapshot of tick t.

Parameters:
tick - tick that contains the snapshot
Returns:
true when they are the same

setOutput

public void setOutput(Tick t)
copy all outputs from Tick t.

Parameters:
t - the tick that defines the outputs

setRT

public void setRT(int reactionTime)
set the reaction time to compute this tick.

Parameters:
reactionTime - reaction time

getRT

public int getRT()
Returns:
reaction time to compute the tick

clearOutput

public void clearOutput()
restores the initial state by removing all output signals.