Class TikZExporter
-
- All Implemented Interfaces:
public class TikZExporterExports a queueing network model as a TikZ diagram. Can generate LaTeX code, compile to PDF, and display the result.
-
-
Field Summary
Fields Modifier and Type Field Description public final TikZOptionsoptions
-
Constructor Summary
Constructors Constructor Description TikZExporter(Network model)Creates a TikZ exporter with default options. TikZExporter(Network model, TikZOptions options)Creates a TikZ exporter with custom options.
-
Method Summary
Modifier and Type Method Description TikZOptionsgetOptions()Gets the options used by this exporter. StringgenerateTikZ()Generates TikZ code for the network. voidexportToFile(String filePath)Exports the TikZ code to a file. voidexportToPNG(String filePath, int dpi)Exports the network diagram to a PNG file. voidexportToPNG(String filePath)Exports the network diagram to a PNG file with default 150 DPI. FileexportToPDF()Compiles the TikZ code to PDF using pdflatex. voiddisplay()Displays the network diagram. static booleanisPdfLatexAvailable()Checks if pdflatex is available on the system. StringgenerateEnvironmentTikZ(Array<String> stageNames, Array<Array<double>> transitionRates)Generates TikZ code for a combined network + Markov chain diagram. voidexportEnvironmentToPNG(String filePath, int dpi, Array<String> stageNames, Array<Array<double>> transitionRates)Exports a combined network + Markov chain diagram to PNG. -
-
Constructor Detail
-
TikZExporter
TikZExporter(Network model)
Creates a TikZ exporter with default options.
-
TikZExporter
TikZExporter(Network model, TikZOptions options)
Creates a TikZ exporter with custom options.
-
-
Method Detail
-
getOptions
TikZOptions getOptions()
Gets the options used by this exporter.
-
generateTikZ
String generateTikZ()
Generates TikZ code for the network.
- Returns:
Complete LaTeX document with TikZ diagram
-
exportToFile
void exportToFile(String filePath)
Exports the TikZ code to a file.
- Parameters:
filePath- Path to the output .
-
exportToPNG
void exportToPNG(String filePath, int dpi)
Exports the network diagram to a PNG file. Requires pdflatex and pdftoppm (from poppler-utils) to be installed.
- Parameters:
filePath- Path to the output .dpi- Resolution in dots per inch (default 150)
-
exportToPNG
void exportToPNG(String filePath)
Exports the network diagram to a PNG file with default 150 DPI.
- Parameters:
filePath- Path to the output .
-
exportToPDF
File exportToPDF()
Compiles the TikZ code to PDF using pdflatex.
- Returns:
The generated PDF file
-
display
void display()
Displays the network diagram. Compiles to PDF and opens in the system viewer.
-
isPdfLatexAvailable
static boolean isPdfLatexAvailable()
Checks if pdflatex is available on the system.
-
generateEnvironmentTikZ
String generateEnvironmentTikZ(Array<String> stageNames, Array<Array<double>> transitionRates)
Generates TikZ code for a combined network + Markov chain diagram. The Markov chain represents the environment states.
- Parameters:
stageNames- Names of the environment stagestransitionRates- Matrix of transition rates between stages- Returns:
TikZ code for the Markov chain placed to the right of the network
-
-
-
-