Class Pnml


  • public class Pnml
    extends PnmlElement
    Basic (E)PNML object. Allows import, export, and conversion to a Petri net.
    Author:
    hverbeek
    • Constructor Detail

      • Pnml

        public Pnml​(Pnml.PnmlType type)
        Creates a fresh PNML object, given the type.
        Parameters:
        type - Either PNML or EPNML.
      • Pnml

        public Pnml()
        Creates a fresh default PNML object, that is, a PNML object of type PNML.
    • Method Detail

      • hasModule

        public boolean hasModule()
      • getLog

        public org.deckfour.xes.model.XLog getLog()
      • log

        public void log​(java.lang.String context,
                        int lineNumber,
                        java.lang.String message)
        Adds a log event to the current trace in the log.
        Parameters:
        context - Context of the message, typically the current PNML tag.
        lineNumber - Current line number.
        message - Error message.
      • logNet

        public void logNet​(java.lang.String name)
        Adds a new trace with the given name to the log. This trace is now current.
        Parameters:
        name - The give name.
      • hasErrors

        public boolean hasErrors()
      • setType

        public void setType​(Pnml.PnmlType type)
        Set the type of this PNML object.
        Parameters:
        type - Either PNML or EPNML.
      • getType

        public Pnml.PnmlType getType()
        Gets the type.
        Returns:
        Either PNML or EPNML.
      • importElements

        protected boolean importElements​(org.xmlpull.v1.XmlPullParser xpp,
                                         Pnml pnml)
        Checks whether the current start tag is known. If known, it imports the corresponding child element and returns true. Otherwise, it returns false.
        Overrides:
        importElements in class PnmlElement
        Returns:
        Whether the start tag was known.
      • exportElements

        protected java.lang.String exportElements​(Pnml pnml)
        Exports the child elements to String.
        Overrides:
        exportElements in class PnmlElement
        Returns:
      • convertToNet

        public void convertToNet​(PetrinetGraph net,
                                 Marking marking,
                                 org.processmining.models.connections.GraphLayoutConnection layout)
        Converts the PNML object to a Petri net and initial marking.
        Parameters:
        net - Where to store the Petri net in (should be a fresh net).
        marking - Where to store the initial marking in (should be a fresh marking).
      • convertToNet

        public void convertToNet​(PetrinetGraph net,
                                 Marking marking,
                                 java.util.Collection<Marking> finalMarkings,
                                 org.processmining.models.connections.GraphLayoutConnection layout)
      • setLayout

        public void setLayout​(PetrinetGraph net,
                              org.processmining.models.connections.GraphLayoutConnection layout)
      • getLabel

        public java.lang.String getLabel()
      • convertFromNet

        public Pnml convertFromNet​(java.util.Map<PetrinetGraph,​Marking> markedNets,
                                   org.processmining.models.connections.GraphLayoutConnection layout)
      • convertFromNet

        public Pnml convertFromNet​(java.util.Map<PetrinetGraph,​Marking> markedNets,
                                   java.util.Map<PetrinetGraph,​java.util.Collection<Marking>> finalMarkedNets,
                                   org.processmining.models.connections.GraphLayoutConnection layout)
      • convertFromNet

        public Pnml convertFromNet​(PetrinetGraph net,
                                   Marking marking,
                                   org.processmining.models.connections.GraphLayoutConnection layout)
      • convertFromNet

        public Pnml convertFromNet​(PetrinetGraph net,
                                   Marking marking,
                                   java.util.Collection<Marking> finalMarkings,
                                   org.processmining.models.connections.GraphLayoutConnection layout)
      • convertFromNet

        public Pnml convertFromNet​(PetrinetGraph net,
                                   Marking marking,
                                   java.util.Map<java.lang.String,​org.processmining.models.graphbased.AbstractGraphElement> idMap,
                                   org.processmining.models.connections.GraphLayoutConnection layout)
      • convertFromNet

        public Pnml convertFromNet​(PetrinetGraph net,
                                   Marking marking,
                                   java.util.Collection<Marking> finalMarkings,
                                   java.util.Map<java.lang.String,​org.processmining.models.graphbased.AbstractGraphElement> idMap,
                                   org.processmining.models.connections.GraphLayoutConnection layout)
      • setName

        public void setName​(java.lang.String name)