Virtual Agent Playground

Four model agents from my research on classes of adaptive behavior. Each solves a task with a tiny nervous system, coupled to a body and an environment. Pick a task, watch the agent do it, then change its parameters and see how the behavior changes. Everything runs in your browser, in JavaScript ports of the Julia and Mathematica models I use for my figures.

Approach: steer to a goal

A Braitenberg vehicle has two sensors at its front and a motor on each side. Each sensor drives the motor on the opposite side: the wires cross. When the stimulus lies to the right, the right sensor reads more, the left wheel turns faster, and the vehicle swings toward it. A constant forward drive keeps it moving at 1 m/s, and a lag makes its turning catch up with its motors.

Drag the stimulus to move it. Click anywhere to release a vehicle; drag before letting go to aim it.

Wiring

1.00
1.00
0.31
0.40

A negative synapse inhibits its motor. With both negative the vehicle behaves like Braitenberg's uncrossed "coward" and turns away.

What these settings do

approach, with overshoot

This is how my parameter charts classify the vehicle: by where its heading comes to rest for a goal held still 2 m away. In the arena the goal is a point, so a vehicle that approaches drives through it and loops back.

The model

Each vehicle moves at the constant speed V along its heading φ, and turns toward the stimulus:

ẋ = V cos φ,   ẏ = V sin φ,   τ φ̈ = −φ̇ + (δ/d) e−cd r [ (fl − fr) / (δ cd) − ½(fl + fr) sin ψ ]

Here r is the distance to the stimulus and ψ the heading error, the angle between where the vehicle points and where the stimulus is. The stimulus is S = e−cd r/cd, each sensor reads it at its corner of the vehicle, and each motor's output is its synapse times the opposite sensor's reading. With equal synapses fl = fr = f the equation is τ φ̈ = −φ̇ − m e−cd r sin ψ with m = (δ/d) f. That is Fajen and Warren's (2003) law for how people walk to a goal, with sin ψ in place of ψ. The default vehicle is matched to their fit: τ = 1/b = 0.31 s, m = k/b = 2.31 /s and cd = 0.4 /m, and its paths stay within about a centimetre of theirs. Unequal synapses give it a built-in turn, like a car whose wheels are out of line.