a An in silico “Braitenberg vehicle” model matching the dimensions of a fly, with key parameters used as substrate for evolution (s = sensory input, v velocity; parameters: a gain, b offset ε, γ noise (2 evolved parameters each, see methods), wi, wc = weights of ipsi- and contralateral connections). b Schematic of the evolutionary process used to optimize the parameters. c Connectivity weights. Note that the best performing vehicles (dark blue dots) preserve both ipsi- and contralateral connectivity, and that ipsilateral weights are exclusively positive (excitatory) while contralateral weights are exclusively negative (inhibitory). d–f An evolved vehicle (red dot in (c)) nearly reproduces fly thermotactic behavior in a simulated arena. d Traces from a top-performing vehicle in the simulated arena (see Supplementary Fig. 5 and “methods” for details; arrowhead = start). e, f Vehicle performance in the simulated chamber (N = 400 simulations). g Vehicle responses are not robust to perturbation. “Ablation” of a single sensor produces vehicles that, entering the cool/hot boundary, invariably turn to the side of the lesion, irrespective of the direction of approach (mid-panel: as a control, removal of both sensors abolishes directional responses; N = 400 simulations each).