public class IOGraph2 extends Object
Constructor and Description |
---|
IOGraph2()
Create an empty IOGraph.
|
Modifier and Type | Method and Description |
---|---|
void |
addConversion(Conversion2 c)
This will add the conversion to the IOGraph.
|
void |
addConversion(int id,
String input,
String output,
String application)
This will add the conversion from
input to
output using the application for the
conversion. |
void |
addConversion(int id,
String input,
String output,
String application,
double weight)
This will add the conversion from
input to
output using the application for the conversion
with the weight. |
void |
addConversion(String input,
String output,
String application)
This will add the conversion from
input to
output using the application for the
conversion. |
void |
addConversion(String input,
String output,
String application,
double weight)
This will add the conversion from
input to
output using the application for the conversion
with the weight. |
void |
addConversions(SoftwareServerClient server)
Add all conversions found on the software server.
|
void |
addConversions(String host)
Add all conversions found on the software server found at the host.
|
void |
addConversions(String host,
int port)
Add all conversions found on the software server found at the host.
|
void |
addParameter(int id,
String name,
String values,
String defaultValue) |
void |
complexity()
Print statistics about the IOGraph.
|
Set<String> |
getApplications()
List of all applications known to the IOGraph.
|
Conversion2 |
getConversion(int id) |
List<Conversion2> |
getConversions()
List of all conversions known to the IOGraph.
|
List<Conversion2> |
getDomain(String vertex)
Return the list of all possible conversions reaching the vertex.
|
List<Conversion2> |
getRange(String vertex)
Return the list of all possible conversions starting at the vertex.
|
Map<String,Conversion2> |
getShortestPath(String input,
boolean useWeights)
Return a map that shows for each node what conversion to use to get to
the previous node, resulting in then end finding the path all the way
back to the source node.
|
List<Conversion2> |
getShortestPath(String input,
String output,
boolean useWeights)
Returns the shortest path from the input to the output.
|
Set<String> |
getValidApplications()
Returns the list of all applications used when finding the shortest path.
|
Set<String> |
getVertices()
List of all vertices in the graph.
|
static void |
main(String... args) |
void |
reset()
Reset the IOGraph.
|
void |
resetWeights()
Sets all the weights of all conversions to unknown.
|
void |
setValidApplications(Set<String> validApplications)
Sets the list of applications that should be considered when finding a
conversion path.
|
void |
setWeight(String input,
String output,
String application,
double weight)
Sets the weight of all conversions matching the triple [input, output,
application].
|
static void |
timings(int edges,
int formats,
int software) |
public void reset()
public void addConversions(String host) throws PolyglotException
host
- the host running the software server.PolyglotException
- throws PolyglotException if there was a problem adding the
conversions to the existing graph.public void addConversions(String host, int port) throws PolyglotException
host
- the host running the software server.port
- the port to connect to on the software serverPolyglotException
- throws PolyglotException if there was a problem adding the
conversions to the existing graph.public void addConversions(SoftwareServerClient server) throws PolyglotException
server
- the server that has the software server runningPolyglotException
- throws PolyglotException if there was a problem adding the
conversions to the existing graph.public void addConversion(String input, String output, String application) throws PolyglotException
input
to
output
using the application
for the
conversion. The weights assigned to the conversion are set to be
undefined.input
- input formatoutput
- output formatapplication
- application used for the conversionPolyglotException
- throws PolyglotException if there was a problem adding the
conversions to the existing graph.public void addConversion(String input, String output, String application, double weight) throws PolyglotException
input
to
output
using the application
for the conversion
with the weight.
input
- input formatoutput
- output formatapplication
- application used for the conversionweight
- the weight assigned to the conversion, ranging from 0 (perfect
conversion) to unknown weight (10000, all information lost).PolyglotException
- throws PolyglotException if there was a problem adding the
conversions to the existing graph.public void addConversion(int id, String input, String output, String application) throws PolyglotException
input
to
output
using the application
for the
conversion. The weights assigned to the conversion are set to be
undefined.id
- unique id used to reference the conversioninput
- input formatoutput
- output formatapplication
- application used for the conversionPolyglotException
- throws PolyglotException if there was a problem adding the
conversions to the existing graph.public void addConversion(int id, String input, String output, String application, double weight) throws PolyglotException
input
to
output
using the application
for the conversion
with the weight.
id
- unique id used to reference the conversioninput
- input formatoutput
- output formatapplication
- application used for the conversionweight
- the weight assigned to the conversion, ranging from 0 (perfect
conversion) to unknown weight (10000, all information lost).PolyglotException
- throws PolyglotException if there was a problem adding the
conversions to the existing graph.public void addConversion(Conversion2 c)
c
- the conversion to add to the IOGraphpublic void resetWeights() throws PolyglotException
PolyglotException
- throws PolyglotException if there was an error setting the
weights.public void setWeight(String input, String output, String application, double weight) throws PolyglotException
input
- input formatoutput
- output formatapplication
- application used for the conversionweight
- the weight assigned to the conversion, ranging from 0 (perfect
conversion) to unknown weight (10000, all information lost).PolyglotException
- throws PolyglotException if there was an error setting the
weights.public void setValidApplications(Set<String> validApplications)
validApplications
- list of valid applications to include when searching for the
shortest path.public Set<String> getValidApplications()
public Set<String> getApplications()
public Set<String> getVertices()
public Conversion2 getConversion(int id)
public List<Conversion2> getConversions()
public List<Conversion2> getRange(String vertex)
vertex
- the starting point in the graph.public List<Conversion2> getDomain(String vertex)
vertex
- the ending point in the graph.public List<Conversion2> getShortestPath(String input, String output, boolean useWeights) throws PolyglotException
input
- starting vertex in the IOGraph.output
- the finishing vertex in the IOGraph.useWeights
- should the shortest path be based on the weights in the
conversion (true), or the smallest number of conversions
(false).PolyglotException
- throws PolyglotException if no path could be found to go from
input to output.public Map<String,Conversion2> getShortestPath(String input, boolean useWeights)
input
- the node to start the search frompublic void complexity()
public static void timings(int edges, int formats, int software) throws PolyglotException
PolyglotException
Copyright © 2014. All rights reserved.