Package stallone.util

Examples of stallone.util.CommandLineParser


        return res;
    }

    public static CommandLineParser parseArguments(String[] args)
    {
        CommandLineParser parser = new CommandLineParser();

        // input
        parser.addStringArrayCommand("i", true);

        parser.addCommand("columns", true);
        parser.addIntArgument("columns", true);
        parser.addIntArgument("columns", true);
        parser.addIntArgument("columns", true);

        parser.addIntCommand("maxtime", true);
        parser.addDoubleCommand("lagmult", true);

        parser.addIntCommand("samplingtime", true);

        parser.addDoubleCommand("windowfraction", true);

        parser.addCommand("subtractmean", true);

        // parse
        if (!parser.parse(args))
        {
            throw (new IllegalArgumentException("Parsing error!"));
        }

        return parser;
View Full Code Here


        {
            System.out.println(getUsageString());
            System.exit(0);
        }

        CommandLineParser parser = parseArguments(args);

        // load photon trajectories
        List<String> inputFiles = Arrays.asList(parser.getStringArray("i"));

        int timecol = parser.getInt("columns", 0);
        int col1 = parser.getInt("columns", 1);
        int col2 = parser.getInt("columns", 2);
        double lagtmult = parser.getDouble("lagmult",0);
        int maxtime = parser.getInt("maxtime", 0);
        int samplingtime = parser.getInt("samplingtime",0);
        //double windowfraction = parser.getDouble("windowfraction",0);
        boolean subtractMean = parser.hasCommand("subtractmean");


        IDoubleList lagtimes = doublesNew.listFrom(0, 1);
        while (lagtimes.get(lagtimes.size() - 1) < maxtime)
        {
View Full Code Here

        return res;
    }

    public static CommandLineParser parseArguments(String[] args)
    {
        CommandLineParser parser = new CommandLineParser();

        // input
        parser.addStringArrayCommand("i", true);

        parser.addCommand("columns", true);
        parser.addIntArgument("columns", true);
        parser.addIntArgument("columns", true);
        parser.addIntArgument("columns", true);

        parser.addIntCommand("maxtime", true);

        parser.addCommand("subtractmean", true);

        // parse
        if (!parser.parse(args))
        {
            throw (new IllegalArgumentException("Parsing error!"));
        }

        return parser;
View Full Code Here

        {
            System.out.println(getUsageString());
            System.exit(0);
        }

        CommandLineParser parser = parseArguments(args);

        // load photon trajectories
        List<String> inputFiles = Arrays.asList(parser.getStringArray("i"));

        int timecol = parser.getInt("columns", 0);
        int col1 = parser.getInt("columns", 1);
        int col2 = parser.getInt("columns", 2);
        int maxtime = parser.getInt("maxtime", 0);
        boolean subtractMean = parser.hasCommand("subtractmean");


        IDoubleList lagtimes = doublesNew.listFrom(0,1);
        while (lagtimes.get(lagtimes.size() - 1) < maxtime)
        {
View Full Code Here

        return res;
    }

    public static CommandLineParser parseArguments(String[] args)
    {
        CommandLineParser parser = new CommandLineParser();

        // input
        parser.addStringArrayCommand("i", true);

        parser.addCommand("columns", true);
        parser.addIntArgument("columns", true);
        parser.addIntArgument("columns", true);
        parser.addIntArgument("columns", true);

        parser.addIntCommand("maxtime", true);

        parser.addCommand("subtractmean", true);

        // parse
        if (!parser.parse(args))
        {
            throw (new IllegalArgumentException("Parsing error!"));
        }

        return parser;
View Full Code Here

   
    public boolean parseArguments(String[] args)
            throws FileNotFoundException, IOException
    {
        CommandLineParser parser = new CommandLineParser();
        // input
        parser.addStringArrayCommand("i", true);
        // mandatory parameters
        parser.addIntCommand("nhidden", true);
        // optional initialization
        parser.addCommand("init", false);
        parser.addStringArgument("init", true); // T
        parser.addStringArgument("init", true); // Chi
        // option estimate
        parser.addCommand("estimate", false);
        parser.addIntArgument("estimate", true); // tau
        parser.addIntArgument("estimate", true); // average window
        // option hmm timescales
        parser.addCommand("hmmtimescales", false);
        parser.addIntArgument("hmmtimescales", true); // tau-min
        parser.addIntArgument("hmmtimescales", true); // tau-max
        parser.addDoubleArgument("hmmtimescales", true); // tau-mult
        parser.addIntArgument("hmmtimescales", true); // max-avg-window
        // hmm convergence options
        parser.addCommand("hmmconv",false);
        parser.addDoubleArgument("hmmconv", true, -0.1, Double.NEGATIVE_INFINITY,Double.POSITIVE_INFINITY); // dectol
        parser.addIntArgument("hmmconv", true, 1000, 0, Integer.MAX_VALUE); // niter
        // option
        parser.addCommand("direct", false);
        // output
        parser.addStringCommand("o", true);

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

        // read input and construct NINJA
        String[] ifiles = parser.getStringArray("i");
        inputFiles = new ArrayList();
        for (int i = 0; i < ifiles.length; i++)
        {
            inputFiles.add(ifiles[i]);
        }
        discreteTrajectories = intseqNew.intSequenceLoader(inputFiles).loadAll();

        // mandatory input
        nhidden = parser.getInt("nhidden");
       
        if (parser.hasCommand("init"))
        {
            String fileT = parser.getString("init",0);
            init_T = doublesNew.fromFile(fileT);
            String fileChi = parser.getString("init",1);
            init_Chi = doublesNew.fromFile(fileChi);
        }
       
        // read command option
        if (parser.hasCommand("estimate"))
        {
            singlePointEstimate = true;
            tau = parser.getInt("estimate",0);
            timeshift = parser.getInt("estimate",1);
        }
        else if (parser.hasCommand("estimatemult"))
        {
            multiStartEstimate = true;
            tau = parser.getInt("estimatemult",0);
            timeshift = parser.getInt("estimatemult",1);
            metastabilities = parser.getDoubleArray("metastabilities");
        }
        else if (parser.hasCommand("hmmtimescales"))
        {
            hmmTimescalesEstimate = true;
            taumin = parser.getInt("hmmtimescales",0);
            taumax = parser.getInt("hmmtimescales",1);
            taumult = parser.getDouble("hmmtimescales",2);
            timeshift = parser.getInt("hmmtimescales",3);
        }
       
        direct = parser.hasCommand("direct");
       
        if (parser.hasCommand("hmmconv"))
        {
            hmmDecTol = parser.getDouble("hmmconv",0);
            hmmNIter = parser.getInt("hmmconv",1);
        }
       
        outdir = parser.getString("o");

        return true;
    }
View Full Code Here

    private NinjaEstimator ninja;
   
    public boolean parseArguments(String[] args)
            throws FileNotFoundException, IOException
    {
        CommandLineParser parser = new CommandLineParser();
        // input
        parser.addStringArrayCommand("i", true);
        // mandatory parameters
        parser.addIntCommand("nhidden", true);
        // number of conv steps
        parser.addIntArrayCommand("nhmmconv", false);
        // option estimate
        parser.addCommand("estimate", false);
        parser.addIntArgument("estimate", true); // tau
        parser.addIntArgument("estimate", true); // average window
        // output
        parser.addStringCommand("o", true);

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

        // read input and construct NINJA
        String[] ifiles = parser.getStringArray("i");
        inputFiles = new ArrayList();
        for (int i = 0; i < ifiles.length; i++)
        {
            inputFiles.add(ifiles[i]);
        }
        discreteTrajectories = intseqNew.intSequenceLoader(inputFiles).loadAll();

        // mandatory input
        nhidden = parser.getInt("nhidden");
       
        if (parser.hasCommand("nhmmconv"))
            nHMMConv = parser.getIntArray("nhmmconv");
       
        // read command option
        if (parser.hasCommand("estimate"))
        {
            tau = parser.getInt("estimate",0);
            timeshift = parser.getInt("estimate",1);
        }
       
        outfile = parser.getString("o");

        return true;
    }
View Full Code Here

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

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

        inDir = parser.getString("i");
        outDir = parser.getString("o");

        return true;
    }
View Full Code Here

        {
            System.out.println(getUsageString());
            System.exit(0);
        }

        CommandLineParser parser = parseArguments(args);

        // load photon trajectories
        List<String> inputFiles = Arrays.asList(parser.getStringArray("i"));

        int timecol = parser.getInt("columns", 0);
        int col1 = parser.getInt("columns", 1);
        int col2 = parser.getInt("columns", 2);
        int maxtime = parser.getInt("maxtime", 0);
        boolean subtractMean = parser.hasCommand("subtractmean");


        IDoubleList lagtimes = doublesNew.listFrom(1);
        while (lagtimes.get(lagtimes.size() - 1) < maxtime)
        {
View Full Code Here

    private boolean computeTimescales = false;
   
    public boolean parseArguments(String[] args)
            throws FileNotFoundException, IOException
    {
        CommandLineParser parser = new CommandLineParser();
        // input
        parser.addStringCommand("iT", true);
        parser.addStringCommand("ipout", true);
        parser.addStringArrayCommand("idata", true);
        parser.addIntCommand("lag", true);

        // output
        parser.addStringCommand("o", true);
       
        // switch
        parser.addCommand("autocorrelations", false);
        parser.addCommand("timescales", false);

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

       
        String[] ifiles = parser.getStringArray("idata");
        inputFiles = new ArrayList();
        for (int i=0; i<ifiles.length; i++)
            inputFiles.add(ifiles[i]);
       
        IDataSequenceLoader loader = dataNew.multiSequenceLoader(inputFiles);
        data = intseq.loadIntSequences(inputFiles);
        for (int i=0; i<data.size(); i++)
        {
            dataMaxTime = Math.max(dataMaxTime, data.get(i).size());
            nObservableStates = Math.max(nObservableStates, ints.max(data.get(i))+1);
        }
       
        T = doublesNew.fromFile(parser.getString("iT"));
        pout = doublesNew.fromFile(parser.getString("ipout"));
        lagModel = parser.getInt("lag");
       
        outdir = parser.getString("o");
       
        if (parser.hasCommand("autocorrelations"))
        {
            computeAutocorrelations = true;
            computeTimescales = false;
        }

        if (parser.hasCommand("timescales"))
        {
            computeAutocorrelations = false;
            computeTimescales = 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.