Fig. 3: The utility of different behavioral controllers in habitats with varying complexity.

a Mean survival rate versus clutter density across random predator locations (n = 5), for a given planning level. The fill indicates ±s.e.m. across randomly generated environments (n = 20). b Mean change in survival rate across all planning levels shown in (a) calculated for Low: 0.0–0.3 entropy; Mid 0.4–0.6; High 0.7–0.9. Horizontal line: mean; Shaded region: ±s.e.m; Box: 95% confidence interval of the mean; Vertical line: range of the data. n = 20 for each entropy level; mean change in survival rate is averaged across tested initial predator locations (n = 5) and across entropy grouping. MWU tests (two-tailed) across entropy groupings (with Bonferroni correction): Ulow,mid = 39.0, Umid,high = 51.0, and Ulow,high = 142.0, (***p < 10−4; n.s. is not significant p = 0.06). (KW across entropy ranges H = 24.7, p < 10−5). c Spatial complexity with respect to entropy. The line plot shows the mean complexity and the interquartile range (n = 20 generated environments). Insert shows example 4 × 4 environments and their corresponding visibility networks. d–g Heatmaps of all action sequences taken by the prey that resulted in prey survival at the maximum planning level (5000 states) in four out of the 200 environments examined, with color density proportional to frequency. Color bar action frequencies range from 1 to 68, dependent on entropy level. Survival paths are aggregated across all tested predator locations (n = 5) and total number of episodes (n = 50). For other examples see Supplementary Fig. 5. h Path spread denotes the percent of unique cells occupied by successful action sequences at the 5000 state planning level. Plot representation, and low, mid, and high entropy ranges as in (b) (nlow = 76, nmid = 58, and nhigh = 46 generated environments). MWU tests (two-tailed) across entropy groupings (with Bonferroni correction): Ulow,mid = 1109.0, Umid,high = 246.0, and Ulow,high = 595.0 (***p < 10−7). i Graph distance between action sequences that resulted in prey survival implemented by habit. Plot representation, and low, mid, and high entropy ranges as in (b) (nlow = 70, nmid = 41, and nhigh = 32 generated environments). MWU tests (two-tailed) across entropy groupings (with Bonferroni correction): Ulow,mid = 1069.0, Umid,high = 322.0, and Ulow,high = 717.0 (*p = 0.013; **p = 0.002; ***p = 0.0001). j Mean survival rate for prey that uses habit (red dashed line). Representation as in (a). The planning data (blue solid line) as in (a) (±s.e.m. across randomly generated environments (n = 20), averaged across random initial predator locations (n = 5)). KW tests (two-tailed) for survival rate under habit- and plan-based action selection: low entropy (0.0–0.3) p > 0.05; mid entropy (0.4–0.6) p < 10−4; high entropy (0.7–0.9) p > 0.05. Source data are provided as a Source Data file.