Package stallone.util

Examples of stallone.util.CommandLineParser


    private IDoubleArray pibig0, Rbig0;

    public boolean parseArguments(String[] args)
            throws FileNotFoundException, IOException
    {
        CommandLineParser parser = new CommandLineParser();
        // input
        parser.addStringCommand("i", true);

        // reference lag time
        parser.addIntCommand("reflag", true);
        parser.addDoubleCommand("minoverlap", true);

        if (!parser.parse(args))
        {
            return false;
        }

        inDir = parser.getString("i");
        reflag = parser.getInt("reflag");
        minOverlap = parser.getDouble("minoverlap");

        return true;
    }
View Full Code Here


    }
   
    public boolean parseArguments(String[] args)
            throws FileNotFoundException, IOException
    {
        CommandLineParser parser = new CommandLineParser();
        // input
        parser.addStringArrayCommand("i", true);
        parser.addIntCommand("ncluster", true);
        parser.addIntCommand("nsplit", true);
        parser.addStringCommand("o", true);

        if (!parser.parse(args))
            return false;

       
        String[] ifiles = parser.getStringArray("i");
        inputFiles = new ArrayList();
        for (int i=0; i<ifiles.length; i++)
            inputFiles.add(ifiles[i]);
       
        IDataSequenceLoader loader = dataNew.multiSequenceLoader(inputFiles);
        data = loader.loadAll();

        nclusters = parser.getInt("ncluster");
        nsplit = parser.getInt("nsplit");
       
        outPrefix = parser.getString("o");
       
        return true;
    }
View Full Code Here

    }

    public boolean parseArguments(String[] args)
            throws FileNotFoundException, IOException
    {
        CommandLineParser parser = new CommandLineParser();
        // input
        parser.addStringArrayCommand("i", true);
        // initial discretization
        parser.addIntCommand("ninitcluster", false);
        parser.addStringCommand("initcenters", false);
        parser.addStringCommand("metric", false, "euclidean", new String[]
                {
                    "euclidean", "minrmsd"
                });
        // parameters
        parser.addIntCommand("nsplit", true);
        parser.addCommand("tau", true);
        parser.addIntArgument("tau", true); // tau
        parser.addIntArgument("tau", true); // average window
        parser.addIntCommand("nhidden", true);
        parser.addDoubleCommand("requestederror", false);
        parser.addIntCommand("maxrefinementsteps", false);
        // output
        parser.addStringCommand("o", true);

        if (!parser.parse(args))
        {
            return false;
        }


        String[] ifiles = parser.getStringArray("i");
        inputFiles = new ArrayList();
        for (int i = 0; i < ifiles.length; i++)
        {
            inputFiles.add(ifiles[i]);
        }

        System.out.println("reading input data ... ");
        IDataSequenceLoader loader = dataNew.multiSequenceLoader(inputFiles);
        data = loader.loadAll();
        System.out.println(" done. size: " + data.getSequence(0).size() + " x " + data.getSequence(0).dimension());


        // data assignment metric
        String metricstring = parser.getString("metric");
        if (metricstring.equalsIgnoreCase("euclidean"))
        {
            metric = new EuclideanDistance();
        }
        if (metricstring.equalsIgnoreCase("minrmsd"))
        {
            metric = new MinimalRMSDistance3D(data.getSequence(0).dimension() / 3);
        }

        // initial discretization
        if (parser.hasCommand("ninitcluster"))
        {
            ninitclusters = parser.getInt("ninitcluster");
        }
        else
        {
            String initcenterfile = parser.getString("initcenters");
            initcenters = dataNew.reader(initcenterfile).load();
        }

        // parameters
        nsplit = parser.getInt("nsplit");
        tau = parser.getInt("tau", 0);
        timeshift = parser.getInt("tau", 1);
        nhidden = parser.getInt("nhidden");
        requestedError = parser.getDouble("requestederror");
        maxrefinementsteps = parser.getInt("maxrefinementsteps");

        outdir = parser.getString("o");
        System.out.println("read all input, continuing");

        return true;
    }
View Full Code Here

TOP

Related Classes of stallone.util.CommandLineParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.