/**This method reads the text file which contains the map*/
private static void readFile()
{
try {
FileHandler map = new FileHandler("de/axxeed/animosy/scotmap.txt");
log.info("Reading map network list <"+map.getInfo()+">");
// RandomAccessFile map=new RandomAccessFile(f,"r");
String buffer=map.readLine();
StringTokenizer token;
token=new StringTokenizer(buffer);
noOfNodes=Integer.parseInt(token.nextToken());
nodes=new Node[noOfNodes];
for(int i=0;i<nodes.length;i++)
nodes[i]=new Node(i);
buffer=map.readLine();
while(buffer!=null && buffer.trim().length()>0) {
// System.out.println(i+": "+buffer);
token=new StringTokenizer(buffer);
int node1=Integer.parseInt(token.nextToken());
int node2=Integer.parseInt(token.nextToken());
String strType=token.nextToken();
int type=INF;
if(strType.equals("T")) type=TAXI;
if(strType.equals("B")) type=BUS;
if(strType.equals("U")) type=UG;
if(strType.equals("X")) type=BLACK;
nodes[node1].addLink(nodes[node2],type);
nodes[node2].addLink(nodes[node1],type);
buffer=map.readLine();
}
map.close();
}
catch(Exception e) {
e.printStackTrace();
System.out.println("Error in file reading. Exitting!!! "+e);
System.exit(1);