package org.opentrafficsim.demo; import org.djunits.unit.LengthUnit; import org.djunits.value.vdouble.scalar.Length; import org.opentrafficsim.base.parameters.ParameterException; import org.opentrafficsim.base.parameters.ParameterSet; import org.opentrafficsim.base.parameters.ParameterTypes; import org.opentrafficsim.base.parameters.Parameters; /** * Factory for defaults in demos. *

* Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License. *

* $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, * initial version Apr 8, 2016
* @author Alexander Verbraeck * @author Peter Knoppers * @author Wouter Schakel */ public final class DefaultsFactory { /** * Do not create instance. */ private DefaultsFactory() { // } /** * Returns a default set of parameters. * @return Default set of parameters. */ public static Parameters getDefaultParameters() { Parameters params = new ParameterSet().setDefaultParameters(ParameterTypes.class); // demos use different value from default LMRS value try { params.setParameter(ParameterTypes.LOOKAHEAD, new Length(250, LengthUnit.SI)); } catch (ParameterException pe) { throw new RuntimeException("Parameter type 'LOOKAHEAD' could not be set.", pe); } return params; } }