Class PetriNetActor

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class PetriNetActor
    extends TypedCompositeActor
    A Petri net Actor

    As defined in the, a PetriNetActor is a directed and weighted graph G = (V, E) containing three kinds of nodes: Places p_i, Transitions t_i, and PetriNetActors PA_i, i.e., V = {p_i} union {t_i} union {PA_i} , where each PA_i itself is again defined as a PetriNetActor. Each node of V is called a component of the PetriNetActor G. A PetriNetActor is implemented as an extension of TypedCompositeActor. The current file contains two main methods: fire() and prefire(). More details of PetriNetActor can be found in

    Ptolemy II 2.0
    Yuke Wang
    Red (cxh)
    Red (cxh)
    • Constructor Detail

      • PetriNetActor

        public PetriNetActor()
        Construct a PetriNetActor in the default workspace with an empty string as its name. Add the actor to the workspace directory. Increment the version number of the workspace.
      • PetriNetActor

        public PetriNetActor​(Workspace workspace)
        Construct a PetriNetActor in the specified workspace with an empty string as its name. You can then change the name with setName(). If the workspace argument is null, then use the default workspace. Add the actor to the workspace directory. Increment the version number of the workspace.
        workspace - The workspace that will list the actor.
      • PetriNetActor

        public PetriNetActor​(CompositeEntity container,
                             java.lang.String name)
                      throws IllegalActionException,
        Create a PetriNetActor in the specified container with the specified name. The name must be unique within the container or an exception is thrown. The container argument must not be null, or a NullPointerException will be thrown.
        container - The container.
        name - The name of this actor within the container.
        IllegalActionException - If the entity cannot be contained by the proposed container.
        NameDuplicationException - If the name coincides with an entity already in the container.
    • Method Detail

      • prefire

        public boolean prefire()
                        throws IllegalActionException
        This method tests whether the PetriNetActor or its component contains any enabled Transitions or not. If any of the components is enabled, the method returns true, otherwise returns false.
        Specified by:
        prefire in interface Executable
        prefire in class CompositeActor
        true or false, a PetriNetActor is ready to fire or not.
        IllegalActionException - If testReadyTransition throws exception.