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 voidclose()Disconnect from the server.protected voidflush()Flushes the output stream.ConcreteStategetConcreteInitial(UppaalSystem system)Returns the concrete initial state for the system.ConcreteSuccessorgetConcreteSuccessor(UppaalSystem system, ConcreteState state, SystemEdgeSelect[] edges, BigDecimal currentTime, BigDecimal delay)Get the concrete simulation successorGanttChartgetGanttChart(UppaalSystem system, BigDecimal globalTime)Get the gantt chartStringgetOptionsInfo()Returns information about available options.SymbolicStategetSymbolicInitial(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.StringgetVersion()Returns the version string of the server.protected StringparseResults(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.QueryResultquery(UppaalSystem system, Query query, QueryFeedback f)Write the query data to the serverQueryResultquery(UppaalSystem system, SymbolicState state, Query query, QueryFeedback f)Write the query data and the symbolic state to the servervoidsetOptions(String options)Sets server options used for verification.protected static Stringunquote(String s)Get the unquote stringUppaalSystemupload(Document document)Upload the document to the server.UppaalSystemupload(Document document, ArrayList<Problem> problems)Upload the document to the server.LscProcessuploadLsc(Document document, ArrayList<Problem> problems)protected voidwrite(ConcreteState state, BigDecimal delay)Writes the concrete state in the system to the output stream.protected voidwrite(SystemEdge[] edges)Writes the list of the edges to the output streamprotected voidwrite(SystemEdgeSelect[] edges)Writes the list of the selected edges to the output streamprotected voidwrite(Object o)Writes the object to the output stream following by a newline.protected voidwrite(String s)Writes the string to the output stream following by a newline.protected voidwrite(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:ProtocolDisconnect from the server.- Specified by:
closein interfaceProtocol- Throws:
IOException- engine crash or problem in communication.
-
getSymbolicInitial
public SymbolicState getSymbolicInitial(UppaalSystem system) throws EngineException, IOException, CannotEvaluateExceptionDescription copied from interface:ProtocolReturns 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:
getSymbolicInitialin 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:ProtocolReturns 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:
getConcreteInitialin 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:ProtocolGet the concrete simulation successor- Specified by:
getConcreteSuccessorin 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:ProtocolReturns information about available options. The information is returned as an XML document. The stub must be connected.- Specified by:
getOptionsInfoin 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:ProtocolReturns 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:
getTransitionsin 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:ProtocolReturns the version string of the server. The stub must be connected.- Specified by:
getVersionin 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:
queryin 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:
queryin 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:ProtocolSets server options used for verification. The stub must be connected. TODO: Document format.- Specified by:
setOptionsin 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:ProtocolUpload 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:
uploadin 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:ProtocolUpload 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:
uploadin 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:
uploadLscin interfaceProtocol- Throws:
EngineExceptionIOException
-
getGanttChart
public GanttChart getGanttChart(UppaalSystem system, BigDecimal globalTime) throws EngineException, IOExceptionDescription copied from interface:ProtocolGet the gantt chart- Specified by:
getGanttChartin 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.
-