00001 import java.util.Vector; 00002 00003 import edu.ksu.cis.bnj.ver3.plugin.IOPlugInLoader; 00004 import edu.tum.cs.bayesnets.core.BeliefNetworkEx; 00005 00006 00007 public class BNJ { 00008 00012 public static void main(String[] args) { 00013 try { 00014 String pluginDir = null; 00015 Vector<String> files = new Vector<String>(); 00016 for(int i = 0; i < args.length; i++) { 00017 if(args[i].equals("-?") || args[i].contains("--help")) { 00018 System.out.println("usage: bnj [-p <plugin directory>] [network file(s)]"); 00019 return; 00020 } 00021 if(args[i].equals("-p")) { 00022 pluginDir = args[++i]; 00023 } 00024 else 00025 files.add(args[i]); 00026 } 00027 00028 if(pluginDir != null) 00029 IOPlugInLoader.getInstance().loadPlugins(pluginDir); 00030 00031 if(files.size() == 0) { 00032 new BeliefNetworkEx().show(); 00033 } 00034 else { 00035 for(String filename : files) { 00036 new BeliefNetworkEx(filename).show(); 00037 } 00038 } 00039 } 00040 catch(Exception e) { 00041 e.printStackTrace(); 00042 } 00043 } 00044 00045 }