spanReform
Class SpanReform

java.lang.Object
  extended by spanReform.SpanReform

public class SpanReform
extends java.lang.Object

Class for generating a map of cities from a constraint file.


Nested Class Summary
private  class SpanReform.City
          Class for stroing the name and location of a city.
 
Field Summary
private  java.util.HashMap<java.lang.String,SpanReform.City> cities
          a mapping of city names to the cities
(package private) static java.util.HashMap<java.lang.String,double[]> displacements
          a mapping of distance names to the spatial displacements
private  java.util.HashSet<java.lang.String> relations
          the relations between the cities
 
Constructor Summary
SpanReform()
           
 
Method Summary
private  void addCity(java.lang.String city1, java.lang.String city2, java.lang.String direction, boolean move)
          Adds the given cities to the map.
 Map generateMap(java.lang.String goalFile, MapImporter importer)
          Generates a map relating cities from the specified goal file.
static void main(java.lang.String[] args)
          Test main for generating a span reform map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

displacements

static java.util.HashMap<java.lang.String,double[]> displacements
a mapping of distance names to the spatial displacements


cities

private java.util.HashMap<java.lang.String,SpanReform.City> cities
a mapping of city names to the cities


relations

private java.util.HashSet<java.lang.String> relations
the relations between the cities

Constructor Detail

SpanReform

public SpanReform()
Method Detail

main

public static void main(java.lang.String[] args)
Test main for generating a span reform map.


generateMap

public Map generateMap(java.lang.String goalFile,
                       MapImporter importer)
Generates a map relating cities from the specified goal file.

Parameters:
goalFile - - the spatial constraints
importer - - the map importer
Returns:
- the resulting map

addCity

private void addCity(java.lang.String city1,
                     java.lang.String city2,
                     java.lang.String direction,
                     boolean move)
Adds the given cities to the map.

Parameters:
city1 - - the first city
city2 - - the second city
direction - - the relation between the cities
move - - specifies if the relation value should be used to determine the location of the cities