static Optional<String> safeExecute(Experiment.Builder builder, String[] args) { return createMenu(builder).safeExecute(args); }
final Map<String, MASConfiguration> cfgMap = createConfigMap(builder); .footer("For more information see http://github.com/rinde/RinSim") .openGroup() .add(createBatchesOpt(builder), builder, IntHandlers.BATCHES) .add(createThreadsOpt(builder), builder, IntHandlers.THREADS) .openGroup() .add(createIncludeOpt(cfgMap), builder, new IncludeHandler(cfgMap)) .add(createExcludeOpt(cfgMap), builder, new ExcludeHandler(cfgMap)) .openGroup() .add(createLocalOpt(builder), builder, NoArgHandlers.LOCAL) .add(createJppfOpt(builder), builder, NoArgHandlers.DISTRIBUTED) .closeGroup() .add(createDryRunOpt(builder), builder, StringHandler.DRY_RUN) .add(createRepetitionsOpt(builder), builder, IntHandlers.REPS) .add(createSeedRepetitionsOpt(builder), builder, IntHandlers.SEED_REPS) .add(createSeedOption(builder), builder, LongHandlers.SEED) .add(createGuiOpt(builder), builder, BooleanHandler.GUI) .add(createOrderingOption(builder), builder, OrderingHandler.INSTANCE) .add(createWarmupOption(builder), builder, LongHandlers.WARMUP) .add(createCompositeSizeOpt(builder), builder, IntHandlers.COMPOSITE_SIZE) .addHelpOption("h", "help", "Print this message.");
static OptionArg<List<String>> createExcludeOpt( Map<String, MASConfiguration> configMap) { return Option.builder("e", ArgumentParser.prefixedIntList(CONFIG_PREFIX)) .longName("exclude") .description( "The following configurations can be excluded from the experiment" + " setup:", createConfigString(configMap), "This option can not be used together with --include.") .build(); }
final Map<String, MASConfiguration> cfgMap = createConfigMap(builder); .footer("For more information see http://github.com/rinde/RinSim") .openGroup() .add(createBatchesOpt(builder), builder, IntHandlers.BATCHES) .add(createThreadsOpt(builder), builder, IntHandlers.THREADS) .openGroup() .add(createIncludeOpt(cfgMap), builder, new IncludeHandler(cfgMap)) .add(createExcludeOpt(cfgMap), builder, new ExcludeHandler(cfgMap)) .openGroup() .add(createLocalOpt(builder), builder, NoArgHandlers.LOCAL) .add(createJppfOpt(builder), builder, NoArgHandlers.DISTRIBUTED) .closeGroup() .add(createDryRunOpt(builder), builder, StringHandler.DRY_RUN) .add(createRepetitionsOpt(builder), builder, IntHandlers.REPS) .add(createSeedRepetitionsOpt(builder), builder, IntHandlers.SEED_REPS) .add(createSeedOption(builder), builder, LongHandlers.SEED) .add(createGuiOpt(builder), builder, BooleanHandler.GUI) .add(createOrderingOption(builder), builder, OrderingHandler.INSTANCE) .add(createWarmupOption(builder), builder, LongHandlers.WARMUP) .add(createCompositeSizeOpt(builder), builder, IntHandlers.COMPOSITE_SIZE) .addHelpOption("h", "help", "Print this message.");
static OptionArg<List<String>> createIncludeOpt( Map<String, MASConfiguration> configMap) { return Option.builder("i", ArgumentParser.prefixedIntList(CONFIG_PREFIX)) .longName("include") .description( "The following configurations can be included in the experiment " + "setup:", createConfigString(configMap), "This option can not be used together with --exclude.") .build(); }
static Optional<String> execute(Experiment.Builder builder, String[] args) { return createMenu(builder).execute(args); }
static OptionArg<List<String>> createIncludeOpt( Map<String, MASConfiguration> configMap) { return Option.builder("i", ArgumentParser.prefixedIntList(CONFIG_PREFIX)) .longName("include") .description( "The following configurations can be included in the experiment " + "setup:", createConfigString(configMap), "This option can not be used together with --exclude.") .build(); }
static Optional<String> execute(Experiment.Builder builder, String[] args) { return createMenu(builder).execute(args); }
static OptionArg<List<String>> createExcludeOpt( Map<String, MASConfiguration> configMap) { return Option.builder("e", ArgumentParser.prefixedIntList(CONFIG_PREFIX)) .longName("exclude") .description( "The following configurations can be excluded from the experiment" + " setup:", createConfigString(configMap), "This option can not be used together with --include.") .build(); }
static Optional<String> safeExecute(Experiment.Builder builder, String[] args) { return createMenu(builder).safeExecute(args); }
/** * Set up the experiment builder and create the CLI menu. */ @Before public void setUp() { TestUtil.testEnum(ExperimentCli.ConfigToName.class); configA = ExperimentTestUtil.testConfig("A"); configB = ExperimentTestUtil.testConfig("B"); configC = ExperimentTestUtil.testConfig("C"); builder = Experiment.builder() .addScenario(ScenarioTestUtil.createRandomScenario(1655L)) .addConfiguration(configA) .addConfiguration(configB) .addConfiguration(configC) .setScenarioReader(ScenarioIO.reader()); menu = ExperimentCli.createMenu(builder); }