Class DotProtocol

  • All Implemented Interfaces:
    Protocol

    public class DotProtocol
    extends java.lang.Object
    implements Protocol
    This class implements the interface 'protocol'
    • Constructor Detail

      • DotProtocol

        public DotProtocol​(java.io.InputStream in,
                           java.io.OutputStream out)
        Constructor
        Parameters:
        in - - The input stream
        out - - The output stream
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: Protocol
        Disconnect from the server.
        Specified by:
        close in interface Protocol
        Throws:
        java.io.IOException - engine crash or problem in communication.
      • getOptionsInfo

        public java.lang.String getOptionsInfo()
                                        throws EngineException,
                                               java.io.IOException
        Description copied from interface: Protocol
        Returns information about available options. The information is returned as an XML document. The stub must be connected.
        Specified by:
        getOptionsInfo in interface Protocol
        Returns:
        The options information
        Throws:
        EngineException - problem in the Uppaal engine.
        java.io.IOException - engine crash or problem in communication.
      • getTransitions

        public java.util.ArrayList<SymbolicTransition> getTransitions​(UppaalSystem system,
                                                                      SymbolicState state)
                                                               throws EngineException,
                                                                      java.io.IOException,
                                                                      CannotEvaluateException
        Description copied from interface: Protocol
        Returns the list of outgoing transitions for the state. The stub must be connected, the state must belong to the system, and the system must be the last one uploaded to the server.
        Specified by:
        getTransitions in interface Protocol
        Parameters:
        system - - The uppaal system
        state - - The symbolic state of the system
        Returns:
        The array list of the symbolic transition
        Throws:
        EngineException - error in the server protocol.
        java.io.IOException - I/O communication error.
        CannotEvaluateException - some expression could not be evaluated.
      • getVersion

        public java.lang.String getVersion()
                                    throws java.io.IOException,
                                           EngineException
        Description copied from interface: Protocol
        Returns the version string of the server. The stub must be connected.
        Specified by:
        getVersion in interface Protocol
        Returns:
        The version
        Throws:
        java.io.IOException - engine crash or problem in communication.
        EngineException - problem in the Uppaal engine.
      • query

        public QueryResult query​(UppaalSystem system,
                                 Query query,
                                 QueryFeedback f)
                          throws EngineException,
                                 java.io.IOException
        Write the query data to the server
        Specified by:
        query in interface Protocol
        Parameters:
        system - - The Uppaal system
        query - - The query string
        f - - The feedback char: 'T'/'M'/'E'
        Returns:
        The query result object: .result - 'T' if the query is satisfied, 'F' if the query is not satisfied, 'M' if the query is maybe satisfied and 'E' in case of errors. .exception - CannotEvaluateException
        Throws:
        EngineException - problem in Uppaal engine.
        java.io.IOException - engine crash or problem in communication.
      • unquote

        protected static java.lang.String unquote​(java.lang.String s)
        Get the unquote string
        Parameters:
        s - - The quote string
        Returns:
        The result string
      • parseResults

        protected java.lang.String parseResults​(java.lang.String results,
                                                QueryResult result)
        Parses the feedback block which may consist of the following items: popup message (starts with M) verbose result for display in the property list (starts with R) a data for plot (starts with P).See server.cpp for details.
        Parameters:
        result - - The encoded results string
        Returns:
        Message - the parsed message
      • setOptions

        public void setOptions​(java.lang.String options)
                        throws EngineException,
                               java.io.IOException
        Description copied from interface: Protocol
        Sets server options used for verification. The stub must be connected. TODO: Document format.
        Specified by:
        setOptions in interface Protocol
        Parameters:
        options - - The options string
        Throws:
        EngineException - problem in the Uppaal engine.
        java.io.IOException - engine crash or problem in communication.
      • upload

        public UppaalSystem upload​(Document document,
                                   java.util.ArrayList<Problem> problems)
                            throws EngineException,
                                   java.io.IOException
        Description copied from interface: Protocol
        Upload the document to the server. If no errors occurred, the instantiated system is returned. Otherwise, null is returned and error reports are stored in the problems vector. Even if no errors occurred, warnings may have been added to the problems vector. The stub must be connected.
        Specified by:
        upload in interface Protocol
        Parameters:
        document - - The system document
        problems - - The problem array list
        Returns:
        the compiled system representation
        Throws:
        EngineException - error in the server protocol.
        java.io.IOException - I/O communication error.
      • upload

        public UppaalSystem upload​(Document document)
                            throws EngineException,
                                   java.io.IOException
        Description copied from interface: Protocol
        Upload the document to the server. If no errors occurred, the instantiated system is returned. Otherwise, null is returned. The stub must be connected.
        Specified by:
        upload in interface Protocol
        Parameters:
        document - - The system document
        Returns:
        The Uppaal system
        Throws:
        EngineException - error in the server protocol.
        java.io.IOException - I/O communication error.
      • write

        protected void write​(java.lang.String s)
                      throws java.io.IOException
        Writes the string to the output stream following by a newline.
        Parameters:
        s - - The input string
        Throws:
        java.io.IOException - engine crash or problem in communication.
      • write

        protected void write​(java.lang.Object o)
                      throws java.io.IOException
        Writes the object to the output stream following by a newline.
        Parameters:
        o - - The object
        Throws:
        java.io.IOException - engine crash or problem in communication.
      • write

        protected void write​(java.math.BigDecimal value)
                      throws java.io.IOException
        Writes the value to the output stream following by a new line
        Parameters:
        value - - The value
        Throws:
        java.io.IOException - engine crash or problem in communication.
      • write

        protected void write​(ConcreteState state,
                             java.math.BigDecimal delay)
                      throws java.io.IOException
        Writes the concrete state in the system to the output stream.
        Parameters:
        state - - The concrete state in the system
        delay - - The delay time
        Throws:
        java.io.IOException - engine crash or problem in communication.
      • write

        protected void write​(SystemEdge[] edges)
                      throws java.io.IOException
        Writes the list of the edges to the output stream
        Parameters:
        edges - - The list of the edges
        Throws:
        java.io.IOException - engine crash or problem in communication.
      • write

        protected void write​(SystemEdgeSelect[] edges)
                      throws java.io.IOException
        Writes the list of the selected edges to the output stream
        Parameters:
        edges - - The list of the selected edges
        Throws:
        java.io.IOException - engine crash or problem in communication.
      • flush

        protected void flush()
                      throws java.io.IOException
        Flushes the output stream.
        Throws:
        java.io.IOException - engine crash or problem in communication.
      • getGanttChart

        public GanttChart getGanttChart​(UppaalSystem system,
                                        java.math.BigDecimal globalTime)
                                 throws EngineException,
                                        java.io.IOException
        Description copied from interface: Protocol
        Get the gantt chart
        Specified by:
        getGanttChart in interface Protocol
        Parameters:
        system - - The uppaal system
        globalTime - - The global time
        Returns:
        The gantt chart object
        Throws:
        EngineException - error in the server protocol.
        java.io.IOException - I/O communication error.