Class ModularSDFCodeGenerator.SimulationJunction

  • Enclosing class:
    ModularSDFCodeGenerator

    public static class ModularSDFCodeGenerator.SimulationJunction
    extends java.lang.Object
    Junction for simulation.
    Author:
    dai
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int counter
      The current number of tokens in a junction.
    • Constructor Summary

      Constructors 
      Constructor Description
      SimulationJunction​(IOPort inputPort, IOPort outputPort, int numInitialTokens)
      Constructor for simulation junction.
    • Field Detail

      • counter

        public int counter
        The current number of tokens in a junction.
    • 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.