jaga.pj.circuits
Class SimulatorDelayLE

java.lang.Object
  |
  +--jaga.pj.circuits.SimulatorLogicElement
        |
        +--jaga.pj.circuits.SimulatorDelayLE
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
SimulatorFaultyDelayLE

public class SimulatorDelayLE
extends SimulatorLogicElement

A LogicElement has one output and any number of inputs. It also has a configurable output delay in simulator clock ticks.

See Also:
Serialized Form

Field Summary
 int delay
           
 int delayLeft
           
 boolean nextOutput
           
 
Fields inherited from class jaga.pj.circuits.SimulatorLogicElement
currentOutput
 
Constructor Summary
SimulatorDelayLE(int delay)
          Creates new SimulatorLogicElement
 
Method Summary
 void connect(SimulatorLogicElement[] connections)
           
 SimulatorLogicElement getInput(int which)
          for testing
 SimulatorLogicElement[] getInputs()
          Should return the inputs of this LE
 boolean getNow()
           
 void randomReset()
          Any state within the element is restored to a random value.
 void refreshOutput()
           
 void reset()
          Any state within the element is restored to its startup default.
 void sampleInputs()
           
 void setNow(boolean v)
          Sets the current value to 'v', the future behaviour of the Variable is not affected, so if it was going to change in time 't' it still will.
 java.lang.String toString()
           
 
Methods inherited from class jaga.pj.circuits.SimulatorLogicElement
getClone, setRandomSeed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delay

public int delay

delayLeft

public int delayLeft

nextOutput

public boolean nextOutput
Constructor Detail

SimulatorDelayLE

public SimulatorDelayLE(int delay)
Creates new SimulatorLogicElement
Method Detail

setNow

public void setNow(boolean v)
Sets the current value to 'v', the future behaviour of the Variable is not affected, so if it was going to change in time 't' it still will.
Overrides:
setNow in class SimulatorLogicElement

getNow

public boolean getNow()
Overrides:
getNow in class SimulatorLogicElement

connect

public void connect(SimulatorLogicElement[] connections)
Overrides:
connect in class SimulatorLogicElement

sampleInputs

public void sampleInputs()
Overrides:
sampleInputs in class SimulatorLogicElement

refreshOutput

public final void refreshOutput()
Overrides:
refreshOutput in class SimulatorLogicElement

getInput

public SimulatorLogicElement getInput(int which)
for testing

reset

public void reset()
Any state within the element is restored to its startup default.
Overrides:
reset in class SimulatorLogicElement

getInputs

public SimulatorLogicElement[] getInputs()
Should return the inputs of this LE
Overrides:
getInputs in class SimulatorLogicElement

randomReset

public void randomReset()
Any state within the element is restored to a random value.
Overrides:
randomReset in class SimulatorLogicElement

toString

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