package org.opentrafficsim.road.gtu.lane;
import java.util.Set;
import org.djunits.value.vdouble.scalar.Speed;
import org.opentrafficsim.core.gtu.GTUCharacteristics;
import org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalPlannerFactory;
import org.opentrafficsim.road.network.lane.DirectedLanePosition;
/**
* Characteristics for a lane base GTU. This class is used to store all characteristics of a (not-yet constructed) LaneBasedGTU.
*
* Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License.
*
* @version $Revision$, $LastChangedDate$, by $Author$, initial version Mar 8, 2016
* @author Alexander Verbraeck
* @author Peter Knoppers
*/
public class LaneBasedGTUCharacteristics extends GTUCharacteristics
{
/** */
private static final long serialVersionUID = 1L;
/** The strategical planner factory. */
private final LaneBasedStrategicalPlannerFactory> strategicalPlannerFactory;
/** The maximum speed of the GTU. */
private final Speed speed;
/** The initial lanes, positions and direction of the GTU. */
private final Set initialLongitudinalPositions;
/**
* Construct a new set of lane based GTU characteristics.
* @param gtuCharacteristics GTUCharacteristics; characteristics of the super GTU type to be used for the GTU
* @param laneBasedStrategicalPlannerFactory LaneBasedStrategicalPlannerFactory; the strategical planner for the GTU
* @param speed Speed; the initial speed of the GTU
* @param initialLongitudinalPositions Set<DirectedLanePosition>; the lane, initial position and direction of the GTU
*/
public LaneBasedGTUCharacteristics(final GTUCharacteristics gtuCharacteristics,
final LaneBasedStrategicalPlannerFactory> laneBasedStrategicalPlannerFactory, final Speed speed,
final Set initialLongitudinalPositions)
{
super(gtuCharacteristics.getGTUType(), gtuCharacteristics.getIdGenerator(), gtuCharacteristics.getLength(),
gtuCharacteristics.getWidth(), gtuCharacteristics.getMaximumSpeed(), gtuCharacteristics.getSimulator(),
gtuCharacteristics.getNetwork());
this.strategicalPlannerFactory = laneBasedStrategicalPlannerFactory;
this.speed = speed;
this.initialLongitudinalPositions = initialLongitudinalPositions;
}
/**
* @return LaneBasedStrategicalPlannerFactory; the strategical planner factory for the GTU
*/
public final LaneBasedStrategicalPlannerFactory> getStrategicalPlannerFactory()
{
return this.strategicalPlannerFactory;
}
/**
* @return Speed; the maximum speed of the GTU
*/
public final Speed getSpeed()
{
return this.speed;
}
/**
* @return Set<DirectedLanePosition>; the position and direction on each lane that the GTU will initially be on
*/
public final Set getInitialLongitudinalPositions()
{
return this.initialLongitudinalPositions;
}
}