public static final class GeneratorPositions.LaneBias extends Object
 Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
 
 BSD-style license. See OpenTrafficSim License.
 
| Modifier and Type | Field and Description | 
|---|---|
static GeneratorPositions.LaneBias | 
LEFT
Left-hand bias, 2nd left lane contains 25% relative to left most lane, in free traffic. 
 | 
static GeneratorPositions.LaneBias | 
MIDDLE
Middle bias, 2nd left lane contains 25% relative to left most lane, in free traffic. 
 | 
static GeneratorPositions.LaneBias | 
NONE
No bias. 
 | 
static GeneratorPositions.LaneBias | 
RIGHT
Right-hand bias, 2nd right lane contains 25% relative to right most lane, in free traffic. 
 | 
static GeneratorPositions.LaneBias | 
STRONG_LEFT
Strong left-hand bias, 2nd left lane contains 3.125% relative to left most lane, in free traffic. 
 | 
static GeneratorPositions.LaneBias | 
STRONG_MIDDLE
Strong middle bias, 2nd left lane contains 3.125% relative to left most lane, in free traffic. 
 | 
static GeneratorPositions.LaneBias | 
STRONG_RIGHT
Strong right-hand bias, 2nd right lane contains 3.125% relative to right most lane, in free traffic. 
 | 
static GeneratorPositions.LaneBias | 
TRUCK_RIGHT
Strong right-hand bias, limited to a maximum of 2 lanes. 
 | 
static GeneratorPositions.LaneBias | 
WEAK_LEFT
Weak left-hand bias, 2nd left lane contains 50% relative to left most lane, in free traffic. 
 | 
static GeneratorPositions.LaneBias | 
WEAK_MIDDLE
Weak middle bias, 2nd left lane contains 50% relative to left most lane, in free traffic. 
 | 
static GeneratorPositions.LaneBias | 
WEAK_RIGHT
Weak right-hand bias, 2nd right lane contains 50% relative to right most lane, in free traffic. 
 | 
| Constructor and Description | 
|---|
LaneBias(GeneratorPositions.RoadPosition roadPosition,
        double bias,
        double stickyLanes)
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
static GeneratorPositions.LaneBias | 
bySpeed(double leftSpeedKm,
       double rightSpeedKm)
Returns a bias by speed with normal extent. 
 | 
static GeneratorPositions.LaneBias | 
bySpeed(org.djunits.value.vdouble.scalar.Speed leftSpeed,
       org.djunits.value.vdouble.scalar.Speed rightSpeed)
Returns a bias by speed with normal extent. 
 | 
double | 
calculateWeight(int laneNumFromRight,
               int numberOfLanes,
               int numberOfUnplacedGTUs,
               org.djunits.value.vdouble.scalar.Speed desiredSpeed)
Returns a random draw weight for given lane. 
 | 
boolean | 
equals(Object obj) | 
int | 
hashCode() | 
String | 
toString() | 
public static final GeneratorPositions.LaneBias NONE
public static final GeneratorPositions.LaneBias WEAK_LEFT
public static final GeneratorPositions.LaneBias LEFT
public static final GeneratorPositions.LaneBias STRONG_LEFT
public static final GeneratorPositions.LaneBias WEAK_MIDDLE
public static final GeneratorPositions.LaneBias MIDDLE
public static final GeneratorPositions.LaneBias STRONG_MIDDLE
public static final GeneratorPositions.LaneBias WEAK_RIGHT
public static final GeneratorPositions.LaneBias RIGHT
public static final GeneratorPositions.LaneBias STRONG_RIGHT
public static final GeneratorPositions.LaneBias TRUCK_RIGHT
public LaneBias(GeneratorPositions.RoadPosition roadPosition, double bias, double stickyLanes)
roadPosition - RoadPosition; lateral position on the road (0 = right, 0.5 = middle, 1 = left)bias - double; bias extent, lower values create more spread traffic, 0.0 causes no lane preferencestickyLanes - double; number of lanes to consider in either direction, including the preferred lanepublic static GeneratorPositions.LaneBias bySpeed(org.djunits.value.vdouble.scalar.Speed leftSpeed, org.djunits.value.vdouble.scalar.Speed rightSpeed)
leftSpeed - Speed; desired speed for full left biasrightSpeed - Speed; desired speed for full right biaspublic static GeneratorPositions.LaneBias bySpeed(double leftSpeedKm, double rightSpeedKm)
leftSpeedKm - double; desired speed for full left biasrightSpeedKm - double; desired speed for full right biaspublic double calculateWeight(int laneNumFromRight,
                              int numberOfLanes,
                              int numberOfUnplacedGTUs,
                              org.djunits.value.vdouble.scalar.Speed desiredSpeed)
 weight = { 0,                               d >= number of sticky lanes
          { 1 / ((d + 1)^bias * (m + 1)),    otherwise
 
 where,
      d:      lane deviation from lateral bias position
      bias:   bias extent
      m:      number of unplaced GTU's
 
 
 The formula makes sure that all lanes have equal weight for bias = 0, given an equal number of unplaced
 GTU's m. The bias can be seen to result in this: for each GTU on the 2nd lane, there are 2^(bias - 1)
 GTU's on the 1st lane. In numbers: 1 vs. 1 for bias = 0, 1 vs. 2 for bias = 1, 1 vs. 4 for
 bias = 2, 1 vs. 8 for bias = 3, etc.laneNumFromRight - int; number of lane counted from right to leftnumberOfLanes - int; total number of lanesnumberOfUnplacedGTUs - int; number of GTU's in the generation queuedesiredSpeed - Speed; desired speed, possibly used to determine the biased road positionCopyright © 2014–2018 Delft University of Technology. All rights reserved.