Main.java

Go to the documentation of this file.
00001 
00006 public class Main {
00007 
00012     public static void main(String[] args) {
00013         boolean isNs2 = false;
00014         boolean isAnsim = false;
00015         // choose one of two possible actions
00016         for (String arg: args) {
00017             // convert to ns2
00018             if ("ns2".equals(arg.toLowerCase())) {
00019                 isNs2    = true;
00020             }
00021             // convert to ansim
00022             if ("ansim".equals(arg.toLowerCase())) {
00023                 isAnsim = true;
00024             }
00025         }
00026         
00027         if ( (isNs2 || isAnsim) == false ) {
00028             // no target selected
00029             System.err.println("Which target wanted? => [ns2|ansim]");
00030             System.exit(1);
00031         }
00032         
00033         if ( (isNs2 && isAnsim) == true) {
00034             // two targets selected
00035             System.err.println("Which target wanted? => [ns2|ansim]");
00036             System.exit(1);         
00037         }
00038         
00039         if (isNs2) {
00040             // convert!
00041             ns2.Converter.convert(args);
00042         } else if (isAnsim) {
00043             ansim.Converter.convert(args);
00044         }
00045     }
00046 }

Generated on Wed May 5 00:06:30 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6