Skip to content

five-on-it / packages/ai/src/traffic-drive / DRIVE

Variable: DRIVE ​

const DRIVE: object

Defined in: packages/ai/src/traffic-drive.ts:81

The numbers of driving in traffic.

Type Declaration ​

accel ​

readonly accel: 2.5 = 2.5

The acceleration a driver pulls away with at most (m/s²; the Intelligent Driver Model's a)…

ahead ​

readonly ahead: 140 = 140

Route planned ahead of the lane the car is on (m)…

amberDecel ​

readonly amberDecel: 3.5 = 3.5

An amber light is run when stopping for it needs more than this (m/s²); decided once, and kept.

arrive ​

readonly arrive: 14 = 14

It arrives at a junction without a light this near its line, or within its braking distance at arriveDecel and 2 m (m, m/s²).

arriveDecel ​

readonly arriveDecel: 2.5 = 2.5

atStop ​

readonly atStop: 0.8 = 0.8

A stop this near (m) with the car this slow (m/s) is a car at its stop: the handbrake holds it.

bendFloor ​

readonly bendFloor: 1 = 1

bendLag ​

readonly bendLag: 0.25 = 0.25

A bend's plan aims this long before its point (s; the foot's lag) and treats the last metres as this many (m).

blockedTicks ​

readonly blockedTicks: 1200 = 1200

Ticks behind something that never moves before it is stuck, or (scared) bails out.

busClear ​

readonly busClear: 20 = 20

A bus's stop keeps this far from a junction's line and its box's exit (m).

busDoor ​

readonly busDoor: 3 = 3

…and the bus stops with its front this far past it, its front door by the queue (m)…

busDwell ​

readonly busDwell: readonly [240, 420]

Ticks a bus waits at its stop, at least and at most.

busEase ​

readonly busEase: 10 = 10

busEvery ​

readonly busEvery: readonly [140, 280]

…and each next one (m).

busFirst ​

readonly busFirst: readonly [40, 140]

A new bus's first stop this far on, at least and at most (m)…

busKerb ​

readonly busKerb: 0.8 = 0.8

busOvershoot ​

readonly busOvershoot: 2 = 2

…a stop it has run this far past still the one it stops at (m).

busPull ​

readonly busPull: 30 = 30

Within this of its stop (m) a bus in the rightmost lane steers this much closer to the kerb (m), eased in over this many metres, never nearer the kerb than this (m).

corridor ​

readonly corridor: 0.4 = 0.4

Clearance beside the car within which something counts as in front (m).

creep ​

readonly creep: 2 = 2

decel ​

readonly decel: 4 = 4

The comfortable braking (m/s²; the model's b): what a queue and a stop line are approached at…

decelMax ​

readonly decelMax: 8 = 8

…and the emergency reserve, never exceeded by the driver (a crash is the physics').

flipTicks ​

readonly flipTicks: 60 = 60

flipUp ​

readonly flipUp: 0.3 = 0.3

Its roof's up axis below this for so many ticks is a flipped car.

freeExponent ​

readonly freeExponent: 4 = 4

The exponent of the free acceleration's approach to the free speed (the model's δ).

gridlockTicks ​

readonly gridlockTicks: 1200 = 1200

Ticks held at a junction's line by the others (giving way, a box it could not leave) before it is stuck: a gridlock.

jamTicks ​

readonly jamTicks: 180 = 180

Ticks stopped in a box behind another car before it creeps on regardless, at this speed (m/s).

jerk ​

readonly jerk: 8 = 8

How fast the commanded acceleration may change (m/s³): a driver's foot, and in an emergency.

jerkEmergency ​

readonly jerkEmergency: 40 = 40

kerbClear ​

readonly kerbClear: 0.3 = 0.3

lateral ​

readonly lateral: 6 = 6

Lateral acceleration allowed in the bend being steered (m/s²).

longAccelShare ​

readonly longAccelShare: 0.6 = 0.6

…a bus or a truck (isLong) at this share of it…

longHalf ​

readonly longHalf: 3.5 = 3.5

A vehicle longer than twice this (m) keeps straight on at a junction where a way out lines up within this cosine.

lookAxles ​

readonly lookAxles: 1.2 = 1.2

…and never nearer than this many axle distances (a bus's wheel turns less for the same point: it never swerves at a kerb).

lookMax ​

readonly lookMax: 18 = 18

lookMin ​

readonly lookMin: 4 = 4

lookShare ​

readonly lookShare: 0.5 = 0.5

The pursuit point: this share of the speed ahead (m per m/s), within these bounds (m)…

lostOff ​

readonly lostOff: 10 = 10

Farther than this off its route (m) for so many ticks is a lost car.

lostTicks ​

readonly lostTicks: 120 = 120

minGap ​

readonly minGap: 2.5 = 2.5

The gap kept to the car in front: so many metres plus so many seconds of speed.

modeShare ​

readonly modeShare: 0.2 = 0.2

The interaction (as a share of the acceleration) from which what holds the speed names the mode.

panicAccel ​

readonly panicAccel: 4.5 = 4.5

…and a scared driver (m/s²).

panicBlocked ​

readonly panicBlocked: 90 = 90

panicDecel ​

readonly panicDecel: 6 = 6

…a scared driver's…

panicShare ​

readonly panicShare: 1.4 = 1.4

panicTop ​

readonly panicTop: 0.95 = 0.95

…nor, scared, beyond this share of it, at this share of the road's limit.

passAhead ​

readonly passAhead: 25 = 25

passBehind ​

readonly passBehind: 10 = 10

…from this far behind to this far ahead of the car (m).

passTicks ​

readonly passTicks: 90 = 90

Ticks held behind something that never moves before it moves over to the lane beside, when it is clear…

patience ​

readonly patience: 600 = 600

Ticks it waits at such a junction before it goes anyway.

planDecel ​

readonly planDecel: 3 = 3

The braking planned for a bend or a stop (m/s²): a point's braking is blended in by the square of its share of it, exact beyond it.

replanAhead ​

readonly replanAhead: 70 = 70

…and planned again once less than this is left (m).

reverseAccel ​

readonly reverseAccel: 2 = 2

reverseSpeed ​

readonly reverseSpeed: 2.5 = 2.5

Backing out of a stall: this fast (m/s) at this acceleration (m/s²).

reverseTicks ​

readonly reverseTicks: 60 = 60

roadTop ​

readonly roadTop: 0.85 = 0.85

Cruising never beyond this share of the class's top speed…

rollBackStop ​

readonly rollBackStop: 0.3 = 0.3

A car rolling backwards unasked brakes to a stop within this long (s).

senseMax ​

readonly senseMax: 60 = 60

senseMin ​

readonly senseMin: 20 = 20

How far ahead it looks for something to brake for: at least, seconds of speed, at most (m, s, m).

senseTime ​

readonly senseTime: 3 = 3

stallSpeed ​

readonly stallSpeed: 0.5 = 0.5

Slower than this while asking for speed is stalled (m/s), after so many ticks; it reverses for so many.

stallsToGiveUp ​

readonly stallsToGiveUp: 3 = 3

So many stalls within so many ticks and it is stuck.

stallTicks ​

readonly stallTicks: 120 = 120

stallWindow ​

readonly stallWindow: 1200 = 1200

stopHeadway ​

readonly stopHeadway: 0.4 = 0.4

A stop line (a red, a junction given way at, a bus stop) is a standing car queued behind at this time headway instead (s).

stopMargin ​

readonly stopMargin: 0.4 = 0.4

Stopped this far short of a stop line (m).

stopped ​

readonly stopped: 0.5 = 0.5

stopReach ​

readonly stopReach: 9 = 9

A bus stop this far from a bus's route at most is on it (m)…

stopsAhead ​

readonly stopsAhead: 80 = 80

Stops and bends looked at ahead (m).

straightCos ​

readonly straightCos: 0.88 = 0.88

timeGap ​

readonly timeGap: 0.9 = 0.9

vanDwell ​

readonly vanDwell: readonly [1200, 2100]

Ticks an ice-cream van stands at the kerb serving, at least and at most.

wetSlowing ​

readonly wetSlowing: 0.12 = 0.12

On a road soaked through the drivers cruise this share slower (GAME_DESIGN §5.7).