/** * Adds the specified model builders. * @param models The model builders to add. * @return This, as per the builder pattern. */ public Builder addModels(Iterable<? extends ModelBuilder<?, ?>> models) { for (final ModelBuilder<?, ?> mb : models) { addModel(mb); } return this; }
public static MASConfiguration testConfig(String name) { return MASConfiguration.pdptwBuilder() .setName(name) .addEventHandler(AddVehicleEvent.class, ExperimentTestUtil.randomVehicle()) .build(); }
public static StatisticsDTO singleRun(Scenario scenario, MASConfiguration c, long seed, ObjectiveFunction objFunc, boolean showGui) { return (StatisticsDTO) Experiment .singleRun(scenario, c, seed, showGui, PostProcessors.statisticsPostProcessor(objFunc), null) .getResultObject(); }
/** * Tests help. */ @Test public void testHelp() { testSuccess("-h"); builder.perform(System.out, "-h"); }
/** * Enable the GUI using the specified creator for each simulation. When a * large number of simulations is performed this may slow down the * experiment significantly. The GUI can not be shown when more than one * thread is used. * @param uic The {@link ModelBuilder} to use for creating the GUI. * @return This, as per the builder pattern. */ public Builder showGui(ModelBuilder<?, ?> uic) { uiCreator = uic; return showGui(true); }
@Override public void execute(Builder builder) { builder.computeLocal(); } },
@Override public void execute(Builder builder) { builder.computeDistributed(); } }
public static PostProcessor<StatisticsDTO> statisticsPostProcessor( ObjectiveFunction objectiveFunction) { return new StatisticsPostProcessor(objectiveFunction, FailureStrategy.ABORT_EXPERIMENT_RUN); }
@Override public Computer get() { return new DryRunComputer(originalComputerType, verbose, stream, error); } };
@Override public Computer get() { return new LocalComputer(); } },
/** * Start building a new experiment. * @return A new {@link Builder} instance. */ public static Builder builder() { return new Builder(); }
/** * Creates a new copying {@link Builder}. * @param config The configuration to copy all settings from into the created * builder. * @return A new {@link Builder} instance initialized with the same settings * as the specified configuration. */ public static Builder builder(MASConfiguration config) { return new Builder(config); }
@Override public Computer get() { return new JppfComputer(); } };
/** * Enable the GUI using the specified creator for each simulation. When a * large number of simulations is performed this may slow down the * experiment significantly. The GUI can not be shown when more than one * thread is used. * @param uic The {@link ModelBuilder} to use for creating the GUI. * @return This, as per the builder pattern. */ public Builder showGui(ModelBuilder<?, ?> uic) { uiCreator = uic; return showGui(true); }
public static PostProcessor<StatisticsDTO> statisticsPostProcessor( ObjectiveFunction objectiveFunction) { return new StatisticsPostProcessor(objectiveFunction, FailureStrategy.ABORT_EXPERIMENT_RUN); }
public static PostProcessor<StatisticsDTO> statisticsPostProcessor( ObjectiveFunction objectiveFunction, FailureStrategy failureStrategy) { return new StatisticsPostProcessor(objectiveFunction, failureStrategy); }