All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentrafficsim.road.gtu.lane.VehicleModelFactory Maven / Gradle / Ivy

The newest version!
package org.opentrafficsim.road.gtu.lane;

import org.opentrafficsim.core.gtu.GtuType;

/**
 * Factory for vehicle models.
 * 

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

* @author Alexander Verbraeck * @author Peter Knoppers * @author Wouter Schakel */ public interface VehicleModelFactory { /** No vehicle model. */ VehicleModelFactory NONE = fixed(VehicleModel.NONE); /** Acceleration bounded vehicle model. */ VehicleModelFactory MINMAX = fixed(VehicleModel.MINMAX); /** * Factory returning the same instance always. * @param vehicleModel VehicleModel; vehicle model * @return fixed vehicle model */ static VehicleModelFactory fixed(final VehicleModel vehicleModel) { return new VehicleModelFactory() { @Override public VehicleModel create(final GtuType gtuType) { return vehicleModel; } }; } /** * Create next vehicle model for given GTU type. * @param gtuType GtuType; GTU type * @return next vehicle model for given GTU type */ VehicleModel create(GtuType gtuType); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy