Class ModularSDFCodeGenerator.SimulationJunction
- java.lang.Object
 - 
- ptolemy.cg.kernel.generic.program.procedural.java.modular.ModularSDFCodeGenerator.SimulationJunction
 
 
- 
- Enclosing class:
 - ModularSDFCodeGenerator
 
public static class ModularSDFCodeGenerator.SimulationJunction extends java.lang.ObjectJunction for simulation.- Author:
 - dai
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description intcounterThe current number of tokens in a junction. 
- 
Constructor Summary
Constructors Constructor Description SimulationJunction(IOPort inputPort, IOPort outputPort, int numInitialTokens)Constructor for simulation junction. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IOPortgetInputPort()intgetNumInitialTokens()Return the number of initial tokens in a junction.IOPortgetOutputPort()booleanisInInitialState()test if the junction has the same number of tokens as its initial state.voidreset()Reset the number of tokens to the junction's initial state. 
 - 
 
- 
- 
Constructor Detail
- 
SimulationJunction
public SimulationJunction(IOPort inputPort, IOPort outputPort, int numInitialTokens)
Constructor for simulation junction.- Parameters:
 inputPort- The input port of the junction.outputPort- The output port of the junction.numInitialTokens- The number of initial tokens in the junction.
 
 - 
 
- 
Method Detail
- 
getNumInitialTokens
public int getNumInitialTokens()
Return the number of initial tokens in a junction.- Returns:
 - The number of initial tokens.
 
 
- 
getInputPort
public IOPort getInputPort()
- Returns:
 - The output port of the junction.
 
 
- 
getOutputPort
public IOPort getOutputPort()
- Returns:
 - The input port of the junction.
 
 
- 
isInInitialState
public boolean isInInitialState()
test if the junction has the same number of tokens as its initial state.- Returns:
 - true if currently the junction has the same number of tokens as its initial state.
 
 
- 
reset
public void reset()
Reset the number of tokens to the junction's initial state. 
 - 
 
 -