Package com.uppaal.engine
Class DotProtocol
java.lang.Object
com.uppaal.engine.DotProtocol
- All Implemented Interfaces:
Protocol
public class DotProtocol extends Object implements Protocol
This class implements the interface 'protocol'
-
Constructor Summary
Constructors Constructor Description DotProtocol(InputStream in, OutputStream out)
Constructor -
Method Summary
Modifier and Type Method Description void
close()
Disconnect from the server.protected void
flush()
Flushes the output stream.ConcreteState
getConcreteInitial(UppaalSystem system)
Returns the concrete initial state for the system.ConcreteSuccessor
getConcreteSuccessor(UppaalSystem system, ConcreteState state, SystemEdgeSelect[] edges, BigDecimal currentTime, BigDecimal delay)
Get the concrete simulation successorGanttChart
getGanttChart(UppaalSystem system, BigDecimal globalTime)
Get the gantt chartString
getOptionsInfo()
Returns information about available options.SymbolicState
getSymbolicInitial(UppaalSystem system)
Returns the symbolic initial state for the system.ArrayList<SymbolicTransition>
getTransitions(UppaalSystem system, SymbolicState state)
Returns the list of outgoing transitions for the state.String
getVersion()
Returns the version string of the server.protected String
parseResults(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.QueryResult
query(UppaalSystem system, Query query, QueryFeedback f)
Write the query data to the serverQueryResult
query(UppaalSystem system, SymbolicState state, Query query, QueryFeedback f)
Write the query data and the symbolic state to the servervoid
setOptions(String options)
Sets server options used for verification.protected static String
unquote(String s)
Get the unquote stringUppaalSystem
upload(Document document)
Upload the document to the server.UppaalSystem
upload(Document document, ArrayList<Problem> problems)
Upload the document to the server.LscProcess
uploadLsc(Document document, ArrayList<Problem> problems)
protected void
write(ConcreteState state, BigDecimal delay)
Writes the concrete state in the system to the output stream.protected void
write(SystemEdge[] edges)
Writes the list of the edges to the output streamprotected void
write(SystemEdgeSelect[] edges)
Writes the list of the selected edges to the output streamprotected void
write(Object o)
Writes the object to the output stream following by a newline.protected void
write(String s)
Writes the string to the output stream following by a newline.protected void
write(BigDecimal value)
Writes the value to the output stream following by a new line
-
Constructor Details
-
DotProtocol
Constructor- Parameters:
in
- - The input streamout
- - The output stream
-
-
Method Details
-
close
Description copied from interface:Protocol
Disconnect from the server.- Specified by:
close
in interfaceProtocol
- Throws:
IOException
- engine crash or problem in communication.
-
getSymbolicInitial
public SymbolicState getSymbolicInitial(UppaalSystem system) throws EngineException, IOException, CannotEvaluateExceptionDescription copied from interface:Protocol
Returns the symbolic initial state for the system. The stub must be connected and the system must be the last one uploaded to the server.- Specified by:
getSymbolicInitial
in interfaceProtocol
- Parameters:
system
- the compiled Uppaal system representation.- Returns:
- initial symbolic state.
- Throws:
EngineException
- error in the server protocol.IOException
- I/O communication error.CannotEvaluateException
- some expression could not be evaluated.
-
getConcreteInitial
public ConcreteState getConcreteInitial(UppaalSystem system) throws EngineException, IOException, CannotEvaluateExceptionDescription copied from interface:Protocol
Returns the concrete initial state for the system. The stub must be connected and the system must be the last one uploaded to the server.- Specified by:
getConcreteInitial
in interfaceProtocol
- Parameters:
system
- the compiled Uppaal system representation.- Returns:
- initial concrete state
- Throws:
EngineException
- error in the server protocol.IOException
- I/O communication error.CannotEvaluateException
- some expression could not be evaluated.
-
getConcreteSuccessor
public ConcreteSuccessor getConcreteSuccessor(UppaalSystem system, ConcreteState state, SystemEdgeSelect[] edges, BigDecimal currentTime, BigDecimal delay) throws EngineException, IOException, CannotEvaluateExceptionDescription copied from interface:Protocol
Get the concrete simulation successor- Specified by:
getConcreteSuccessor
in interfaceProtocol
- Parameters:
system
- - The uppaal systemstate
- - The concrete simulator stateedges
- - The vector of the selected system edgescurrentTime
- - the current simulation timedelay
- - The delay time- Returns:
- concrete successor object
- Throws:
EngineException
- error in the server protocol.IOException
- I/O communication error.CannotEvaluateException
- some expression could not be evaluated.
-
getOptionsInfo
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 interfaceProtocol
- Returns:
- The options information
- Throws:
EngineException
- problem in the Uppaal engine.IOException
- engine crash or problem in communication.
-
getTransitions
public ArrayList<SymbolicTransition> getTransitions(UppaalSystem system, SymbolicState state) throws EngineException, IOException, CannotEvaluateExceptionDescription 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 interfaceProtocol
- Parameters:
system
- - The uppaal systemstate
- - The symbolic state of the system- Returns:
- The array list of the symbolic transition
- Throws:
EngineException
- error in the server protocol.IOException
- I/O communication error.CannotEvaluateException
- some expression could not be evaluated.
-
getVersion
Description copied from interface:Protocol
Returns the version string of the server. The stub must be connected.- Specified by:
getVersion
in interfaceProtocol
- Returns:
- The version
- Throws:
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, IOExceptionWrite the query data to the server- Specified by:
query
in interfaceProtocol
- Parameters:
system
- - The Uppaal systemquery
- - The query stringf
- - 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.IOException
- engine crash or problem in communication.
-
query
public QueryResult query(UppaalSystem system, SymbolicState state, Query query, QueryFeedback f) throws EngineException, IOException, CannotEvaluateExceptionWrite the query data and the symbolic state to the server- Specified by:
query
in interfaceProtocol
- Parameters:
system
- - The uppaal systemstate
- - Representing a state in a systemquery
- - The query stringf
- - The feedback char: 'T'/'M'/'E'- Returns:
- '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.
- Throws:
EngineException
- problem in Uppaal engine.IOException
- engine crash or problem in communication.CannotEvaluateException
-
unquote
Get the unquote string- Parameters:
s
- - The quote string- Returns:
- The result string
-
parseResults
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
Description copied from interface:Protocol
Sets server options used for verification. The stub must be connected. TODO: Document format.- Specified by:
setOptions
in interfaceProtocol
- Parameters:
options
- - The options string- Throws:
EngineException
- problem in the Uppaal engine.IOException
- engine crash or problem in communication.
-
upload
public UppaalSystem upload(Document document, ArrayList<Problem> problems) throws EngineException, IOExceptionDescription 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 interfaceProtocol
- Parameters:
document
- - The system documentproblems
- - The problem array list- Returns:
- the compiled system representation
- Throws:
EngineException
- error in the server protocol.IOException
- I/O communication error.
-
upload
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 interfaceProtocol
- Parameters:
document
- - The system document- Returns:
- The Uppaal system
- Throws:
EngineException
- error in the server protocol.IOException
- I/O communication error.
-
write
Writes the string to the output stream following by a newline.- Parameters:
s
- - The input string- Throws:
IOException
- engine crash or problem in communication.
-
write
Writes the object to the output stream following by a newline.- Parameters:
o
- - The object- Throws:
IOException
- engine crash or problem in communication.
-
write
Writes the value to the output stream following by a new line- Parameters:
value
- - The value- Throws:
IOException
- engine crash or problem in communication.
-
write
Writes the concrete state in the system to the output stream.- Parameters:
state
- - The concrete state in the systemdelay
- - The delay time- Throws:
IOException
- engine crash or problem in communication.
-
write
Writes the list of the edges to the output stream- Parameters:
edges
- - The list of the edges- Throws:
IOException
- engine crash or problem in communication.
-
write
Writes the list of the selected edges to the output stream- Parameters:
edges
- - The list of the selected edges- Throws:
IOException
- engine crash or problem in communication.
-
flush
Flushes the output stream.- Throws:
IOException
- engine crash or problem in communication.
-
uploadLsc
public LscProcess uploadLsc(Document document, ArrayList<Problem> problems) throws EngineException, IOException- Specified by:
uploadLsc
in interfaceProtocol
- Throws:
EngineException
IOException
-
getGanttChart
public GanttChart getGanttChart(UppaalSystem system, BigDecimal globalTime) throws EngineException, IOExceptionDescription copied from interface:Protocol
Get the gantt chart- Specified by:
getGanttChart
in interfaceProtocol
- Parameters:
system
- - The uppaal systemglobalTime
- - The global time- Returns:
- The gantt chart object
- Throws:
EngineException
- error in the server protocol.IOException
- I/O communication error.
-