コード例 #1
0
 @Override
 protected void parseArgs(CommandLine cli, String[] args) throws ParseException, HelpException {
   super.parseArgs(cli, args);
   graph_options.parse(cli);
   ext_fmt.parse(cli);
   if (cli.hasOption(maxTimeOption)) maxTime = Long.parseLong(cli.getOptionValue(maxTimeOption));
   dtps = getTicsPerSecond(cli.getOptionValue(destTimeUnitOption, "s"));
   if (dtps == null) throw new HelpException();
   d_interval = Double.parseDouble(cli.getOptionValue(intervalOption, "1"));
 }
コード例 #2
0
 @Override
 protected void run() throws IOException, NoSuchTraceException {
   MovementTrace movement =
       (MovementTrace) _store.getTrace(graph_options.get(GraphOptions.MOVEMENT));
   long otps = movement.ticsPerSecond();
   long interval = Math.max((long) (d_interval * otps), 1);
   if (maxTime != null) maxTime *= otps;
   double timeMul = getTimeMul(otps, dtps);
   if (ext_fmt.is(ExternalFormat.NS2)) NS2Movement.toNS2(movement, _out, timeMul);
   else ONEMovement.toONE(movement, _out, timeMul, interval, maxTime);
 }
コード例 #3
0
 @Override
 protected void initOptions() {
   super.initOptions();
   graph_options.setOptions(options);
   ext_fmt.setOptions(options);
   options.addOption(null, maxTimeOption, true, "maximum movement time (for ONE only)");
   options.addOption(
       null,
       destTimeUnitOption,
       true,
       "time unit of destination trace [s, ms, us, ns] (default: s)");
   options.addOption(null, intervalOption, true, "interval (for ONE only)");
 }