gd
Class GDProblem

java.lang.Object
  extended by gd.GDProblem
All Implemented Interfaces:
Problem

public class GDProblem
extends java.lang.Object
implements Problem

Represents an instance of the Graph Drawing problem.

See Also:
Problem

Field Summary
 java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> adjList
          The adjacency list of the (undirected) graph.
 java.lang.String errorMessage
          If an error is found in the problem, a message is written here.
 double maxX
          maxX and maxY are the limits of the drawing area in the first quadrant.
 double maxY
           
 double minAngleSeparation
          The minimum angle required between two adjacent edges.
 double minPointSeparation
          The minimum distance required between points.
 int numNodes
          # nodes in graph.
 java.lang.String topMessage
           
 
Constructor Summary
GDProblem()
           
GDProblem(int numNodes)
          Creates a new GDProblem instance.
 
Method Summary
 java.lang.String getErrorMessage()
          Retrieve error message about an invalid problem.
 void readFromFile(java.io.File f)
          Read the problem in plain text from the given file.
 java.lang.String toString()
          Returns a problem description summary.
 void writeToFile(java.io.File f)
          Write the problem in plain text to the given file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numNodes

public int numNodes
# nodes in graph.


maxX

public double maxX
maxX and maxY are the limits of the drawing area in the first quadrant. X,Y must be positive. If maxX and maxY are negative, there no limits in 1st quadrant. Thus, the "-1" represents infinity.


maxY

public double maxY

minPointSeparation

public double minPointSeparation
The minimum distance required between points.


minAngleSeparation

public double minAngleSeparation
The minimum angle required between two adjacent edges.


adjList

public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> adjList
The adjacency list of the (undirected) graph. Convention: we'll store both (i,j) and (j,i), but in the textfiles, only (i,j) where j>i will be used. No self loops are allowed.


errorMessage

public java.lang.String errorMessage
If an error is found in the problem, a message is written here.


topMessage

public java.lang.String topMessage
Constructor Detail

GDProblem

public GDProblem(int numNodes)
Creates a new GDProblem instance.

Parameters:
numNodes - an int value

GDProblem

public GDProblem()
Method Detail

writeToFile

public void writeToFile(java.io.File f)
Description copied from interface: Problem
Write the problem in plain text to the given file.

Specified by:
writeToFile in interface Problem
Parameters:
f - a File value

readFromFile

public void readFromFile(java.io.File f)
Description copied from interface: Problem
Read the problem in plain text from the given file.

Specified by:
readFromFile in interface Problem
Parameters:
f - a File value

toString

public java.lang.String toString()
Description copied from interface: Problem
Returns a problem description summary.

Specified by:
toString in interface Problem
Overrides:
toString in class java.lang.Object
Returns:
a String value

getErrorMessage

public java.lang.String getErrorMessage()
Description copied from interface: Problem
Retrieve error message about an invalid problem.

Specified by:
getErrorMessage in interface Problem
Returns:
a String value