Class LQNX2SRVN
.in grammar).
The writer is the inverse of SRVN2LQNX: an LQN XML document goes to SRVN text, so
LayeredNetwork.writeSRVN is writeXML followed by translate(java.lang.String), and the mapping of a model
onto the LQN schema stays in one place. The output is deterministic and byte-identical across the four codebases
(the srvn/expected_srvn golden; Python line_solver.io.srvn_io.lqnx2srvn is the reference). What
SRVN cannot say is refused by name (LINE:unsupported:Format) rather than dropped: an LQX program, SPEX
parameters, a semaphore's initial state, the LINE dialect elements (cache, setup, call groups), and names that
are not LQNS identifiers. Requests for output (results, histograms, mva-info) are skipped, as the reader skips
them. Entry phases carry no activity names in SRVN, so a phase activity reads back as <entry>_<phase>.
-
Method Summary
-
Method Details
-
translate
Translates an LQN XML document into SRVN text, naming the model after<lqn-model name>.- Parameters:
xml- the LQN XML document- Returns:
- the SRVN text, newline-terminated
- Throws:
LineInputException- (LINE:input:Format) when the XML is malformedLineUnsupportedException- (LINE:unsupported:Format) for content SRVN cannot express
-
translate
Translates an LQN XML document into SRVN text.- Parameters:
xml- the LQN XML documentname- the model name for the header comment; null for<lqn-model name>- Returns:
- the SRVN text, newline-terminated
- Throws:
LineInputException- (LINE:input:Format) when the XML is malformedLineUnsupportedException- (LINE:unsupported:Format) for content SRVN cannot express
-