/** * Copies properties of the specified scenario into this builder. * @param scenario The scenario to copy the properties from. * @return This, as per the builder pattern. */ protected T copyProperties(Scenario scenario) { timeWindow = scenario.getTimeWindow(); stopCondition = scenario.getStopCondition(); return self(); }
/** * Set the length (duration) of the scenario. Note that the time at which * the simulation is stopped is defined by * {@link #setStopCondition(StopCondition)} . * @param length The length of the scenario, expressed in the time unit as * defined by the {@link TimeModel}. * @return This, as per the builder pattern. */ public T scenarioLength(long length) { timeWindow = TimeWindow.create(0, length); return self(); }
/** * Set the condition when the scenario should stop. The default is to * continue indefinitely via {@link Predicates#alwaysFalse()}. * @param condition The stop condition to set. * @return This, as per the builder pattern. */ public T setStopCondition(StopCondition condition) { stopCondition = condition; return self(); }
/** * Set the length (duration) of the scenario. Note that the time at which * the simulation is stopped is defined by * {@link #setStopCondition(StopCondition)} . * @param length The length of the scenario, expressed in the time unit as * defined by the {@link TimeModel}. * @return This, as per the builder pattern. */ public T scenarioLength(long length) { timeWindow = TimeWindow.create(0, length); return self(); }
/** * Set the condition when the scenario should stop. The default is to * continue indefinitely via {@link Predicates#alwaysFalse()}. * @param condition The stop condition to set. * @return This, as per the builder pattern. */ public T setStopCondition(StopCondition condition) { stopCondition = condition; return self(); }
/** * Copies properties of the specified scenario into this builder. * @param scenario The scenario to copy the properties from. * @return This, as per the builder pattern. */ protected T copyProperties(Scenario scenario) { timeWindow = scenario.getTimeWindow(); stopCondition = scenario.getStopCondition(); return self(); }