public class DotSaver extends java.lang.Object implements NetworkSaver
Usage: Create dotSaver: DotSaver writer = new DotSaver(yourBayesianNetwork); To output network to a DOT file: writer.save(outputStream, saveValues); where saveValues specifies whether you want to output values for vertices for which they've been set.
Constructor and Description |
---|
DotSaver(BayesianNetwork network) |
DotSaver(java.util.Set<Vertex> vertices) |
Modifier and Type | Method and Description |
---|---|
void |
save(ConstantVertex vertex) |
void |
save(java.io.OutputStream output,
boolean saveValues)
Outputs a graph to a DOT file which can be used by various graph visualizers to generate a visual representation of the graph.
|
void |
save(java.io.OutputStream output,
boolean saveValues,
java.util.Map<java.lang.String,java.lang.String> metadata)
Outputs a graph to a DOT file which can be used by various graph visualizers to generate a visual representation of the graph.
|
void |
save(Vertex vertex) |
void |
saveValue(BooleanVertex vertex) |
void |
saveValue(DoubleVertex vertex) |
void |
saveValue(IntegerVertex vertex) |
void |
saveValue(Vertex vertex) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
save, save, save
public DotSaver(BayesianNetwork network)
public DotSaver(java.util.Set<Vertex> vertices)
public void save(java.io.OutputStream output, boolean saveValues) throws java.io.IOException
save
in interface NetworkSaver
output
- output stream to use for writingsaveValues
- specify whether you want to output values of non-constant scalar verticesjava.io.IOException
- Any errors that occur during saving to the output streampublic void save(java.io.OutputStream output, boolean saveValues, java.util.Map<java.lang.String,java.lang.String> metadata) throws java.io.IOException
save
in interface NetworkSaver
output
- output stream to use for writingsaveValues
- specify whether you want to output values of non-constant scalar verticesmetadata
- metadata to be added to the output as commentsjava.io.IOException
- Any errors that occur during saving to the output streampublic void save(Vertex vertex)
save
in interface NetworkSaver
public void save(ConstantVertex vertex)
save
in interface NetworkSaver
public void saveValue(Vertex vertex)
saveValue
in interface NetworkSaver
public void saveValue(DoubleVertex vertex)
saveValue
in interface NetworkSaver
public void saveValue(IntegerVertex vertex)
saveValue
in interface NetworkSaver
public void saveValue(BooleanVertex vertex)
saveValue
in interface NetworkSaver