<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD with MathML3 v1.3 20210610//EN"  "JATS-archivearticle1-3-mathml3.dtd"><article xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="1.3"><front><journal-meta><journal-id journal-id-type="nlm-ta">elife</journal-id><journal-id journal-id-type="publisher-id">eLife</journal-id><journal-title-group><journal-title>eLife</journal-title></journal-title-group><issn publication-format="electronic" pub-type="epub">2050-084X</issn><publisher><publisher-name>eLife Sciences Publications, Ltd</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">103191</article-id><article-id pub-id-type="doi">10.7554/eLife.103191</article-id><article-id pub-id-type="doi" specific-use="version">10.7554/eLife.103191.4</article-id><article-version article-version-type="publication-state">version of record</article-version><article-categories><subj-group subj-group-type="display-channel"><subject>Research Article</subject></subj-group><subj-group subj-group-type="heading"><subject>Computational and Systems Biology</subject></subj-group><subj-group subj-group-type="heading"><subject>Neuroscience</subject></subj-group></article-categories><title-group><article-title><italic>Accept–reject</italic> decision-making revealed via a quantitative and ethological study of <italic>C. elegans</italic> foraging</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>Haley</surname><given-names>Jessica A</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0001-6282-7124</contrib-id><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="fn" rid="con1"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author"><name><surname>Chen</surname><given-names>Tianyi</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0009-0003-7572-2155</contrib-id><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="other" rid="fund5"/><xref ref-type="fn" rid="con2"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" corresp="yes"><name><surname>Aoi</surname><given-names>Mikio</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0002-7052-880X</contrib-id><email>maoi@ucsd.edu</email><xref ref-type="aff" rid="aff3">3</xref><xref ref-type="aff" rid="aff4">4</xref><xref ref-type="fn" rid="con3"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" corresp="yes"><name><surname>Chalasani</surname><given-names>Sreekanth H</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0003-2522-8338</contrib-id><email>schalasani@salk.edu</email><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="fn" rid="con4"/><xref ref-type="fn" rid="conf1"/></contrib><aff id="aff1"><label>1</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/0168r3w48</institution-id><institution>Neurosciences Graduate Program, University of California, San Diego</institution></institution-wrap><addr-line><named-content content-type="city">San Diego</named-content></addr-line><country>United States</country></aff><aff id="aff2"><label>2</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/03xez1567</institution-id><institution>Molecular Neurobiology Laboratory, Salk Institute for Biological Studies</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff><aff id="aff3"><label>3</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/0168r3w48</institution-id><institution>Halıcıoğlu Data Science Institute, University of California, San Diego</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff><aff id="aff4"><label>4</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/0168r3w48</institution-id><institution>Department of Neurobiology, University of California, San Diego</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff></contrib-group><contrib-group content-type="section"><contrib contrib-type="editor"><name><surname>Portman</surname><given-names>Douglas</given-names></name><role>Reviewing Editor</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/022kthw22</institution-id><institution>University of Rochester</institution></institution-wrap><country>United States</country></aff></contrib><contrib contrib-type="senior_editor"><name><surname>Gold</surname><given-names>Joshua I</given-names></name><role>Senior Editor</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/00b30xv10</institution-id><institution>University of Pennsylvania</institution></institution-wrap><country>United States</country></aff></contrib></contrib-group><pub-date publication-format="electronic" date-type="publication"><day>10</day><month>09</month><year>2025</year></pub-date><volume>13</volume><elocation-id>RP103191</elocation-id><history><date date-type="sent-for-review" iso-8601-date="2024-09-18"><day>18</day><month>09</month><year>2024</year></date></history><pub-history><event><event-desc>This manuscript was published as a preprint.</event-desc><date date-type="preprint" iso-8601-date="2024-09-19"><day>19</day><month>09</month><year>2024</year></date><self-uri content-type="preprint" xlink:href="https://doi.org/10.1101/2024.09.18.613674"/></event><event><event-desc>This manuscript was published as a reviewed preprint.</event-desc><date date-type="reviewed-preprint" iso-8601-date="2024-12-06"><day>06</day><month>12</month><year>2024</year></date><self-uri content-type="reviewed-preprint" xlink:href="https://doi.org/10.7554/eLife.103191.1"/></event><event><event-desc>The reviewed preprint was revised.</event-desc><date date-type="reviewed-preprint" iso-8601-date="2025-04-23"><day>23</day><month>04</month><year>2025</year></date><self-uri content-type="reviewed-preprint" xlink:href="https://doi.org/10.7554/eLife.103191.2"/></event><event><event-desc>The reviewed preprint was revised.</event-desc><date date-type="reviewed-preprint" iso-8601-date="2025-07-22"><day>22</day><month>07</month><year>2025</year></date><self-uri content-type="reviewed-preprint" xlink:href="https://doi.org/10.7554/eLife.103191.3"/></event></pub-history><permissions><copyright-statement>© 2024, Haley et al</copyright-statement><copyright-year>2024</copyright-year><copyright-holder>Haley et al</copyright-holder><ali:free_to_read/><license xlink:href="http://creativecommons.org/licenses/by/4.0/"><ali:license_ref>http://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>This article is distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution License</ext-link>, which permits unrestricted use and redistribution provided that the original author and source are credited.</license-p></license></permissions><self-uri content-type="pdf" xlink:href="elife-103191-v1.pdf"/><self-uri content-type="figures-pdf" xlink:href="elife-103191-figures-v1.pdf"/><abstract><p>Decision-making is a ubiquitous component of animal behavior that is often studied in the context of foraging. Foragers make a series of decisions while locating food (food search), choosing between food types (diet or patch choice), and allocating time spent within patches of food (patch-leaving). Here, we introduce a framework for investigating foraging decisions using detailed analysis of individual behavior and quantitative modeling in the nematode <italic>Caenorhabditis elegans</italic>. We demonstrate that <italic>C. elegans</italic> make <italic>accept–reject</italic> patch choice decisions upon encounter with food. Specifically, we show that when foraging among small, dispersed, and dilute patches of bacteria, <italic>C. elegans</italic> initially <italic>reject</italic> several bacterial patches, opting to prioritize exploration of the environment, before switching to a more exploitatory foraging strategy during subsequent encounters. Observed across a range of bacterial patch densities, sizes, and distributions, we use a quantitative model to show that this decision to <italic>explore</italic> or <italic>exploit</italic> is guided by available sensory information, internal satiety signals, and learned environmental statistics related to the bacterial density of recently encountered and <italic>exploited</italic> patches. We behaviorally validated model predictions on animals that had been food-deprived, animals foraging in environments with multiple patch densities, and null mutants with defective sensory modalities. Broadly, we present a framework to study ecologically relevant foraging decisions that could guide future investigations into the cellular and molecular mechanisms underlying decision-making.</p></abstract><kwd-group kwd-group-type="author-keywords"><kwd>decision-making</kwd><kwd>foraging</kwd><kwd>exploration</kwd><kwd>exploitation</kwd><kwd>dietary choice</kwd><kwd>quantitative modeling</kwd></kwd-group><kwd-group kwd-group-type="research-organism"><title>Research organism</title><kwd><italic>C. elegans</italic></kwd></kwd-group><funding-group><award-group id="fund1"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100000002</institution-id><institution>National Institutes of Health</institution></institution-wrap></funding-source><award-id>RO1 MH096881</award-id><principal-award-recipient><name><surname>Chalasani</surname><given-names>Sreekanth H</given-names></name></principal-award-recipient></award-group><award-group id="fund2"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">https://doi.org/10.13039/100001011</institution-id><institution>Dorsett Brown Foundation</institution></institution-wrap></funding-source><principal-award-recipient><name><surname>Haley</surname><given-names>Jessica A</given-names></name><name><surname>Chalasani</surname><given-names>Sreekanth H</given-names></name></principal-award-recipient></award-group><award-group id="fund3"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100018259</institution-id><institution>Salk Institute for Biological Studies</institution></institution-wrap></funding-source><award-id>Innovation Grant</award-id><principal-award-recipient><name><surname>Haley</surname><given-names>Jessica A</given-names></name><name><surname>Chalasani</surname><given-names>Sreekanth H</given-names></name></principal-award-recipient></award-group><award-group id="fund4"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100000001</institution-id><institution>National Science Foundation</institution></institution-wrap></funding-source><award-id>Graduate Research Fellowship Program DGE-1650112</award-id><principal-award-recipient><name><surname>Haley</surname><given-names>Jessica A</given-names></name></principal-award-recipient></award-group><award-group id="fund5"><funding-source><institution-wrap><institution-id institution-id-type="FundRef">http://dx.doi.org/10.13039/100007911</institution-id><institution>University of California, San Diego</institution></institution-wrap></funding-source><award-id>Undergraduate Summer Research Award</award-id><principal-award-recipient><name><surname>Chen</surname><given-names>Tianyi</given-names></name></principal-award-recipient></award-group><funding-statement>The funders had no role in study design, data collection, and interpretation, or the decision to submit the work for publication.</funding-statement></funding-group><custom-meta-group><custom-meta specific-use="meta-only"><meta-name>Author impact statement</meta-name><meta-value><italic>C. elegans</italic> foraging decisions are guided by learned environmental features, integrating recent patch quality with internal satiety to balance exploration and exploitation.</meta-value></custom-meta><custom-meta specific-use="meta-only"><meta-name>publishing-route</meta-name><meta-value>prc</meta-value></custom-meta></custom-meta-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>Decision-making is frequently defined as the selection of a course of action among several alternatives. The ubiquity and importance of decision-making has led to its use in describing a broad range of behaviors from taxes of unicellular organisms to economics and politics in human society (<xref ref-type="bibr" rid="bib49">Lee, 2013</xref>; <xref ref-type="bibr" rid="bib8">Budaev et al., 2019</xref>). In decision neuroscience, laboratory experiments have investigated the behavioral choices of animals in well-controlled environments or tasks (<xref ref-type="bibr" rid="bib58">Mobbs et al., 2018</xref>). While these experiments have led to key insights into mechanisms underlying decision-making and related cognitive processes (<xref ref-type="bibr" rid="bib32">Gold and Shadlen, 2007</xref>), a comprehensive understanding of decision-making remains elusive. Many researchers have advocated for a more neuroethological approach – suggesting that experiments designed to understand problems the brain evolved to solve offer a more rigorous framework for investigation (<xref ref-type="bibr" rid="bib58">Mobbs et al., 2018</xref>; <xref ref-type="bibr" rid="bib89">Stephens, 2008</xref>; <xref ref-type="bibr" rid="bib39">Hall McMaster and Luyckx, 2019</xref>). Thus, one approach to enrich our understanding of decision-making is to look at the decisions made by animals foraging in naturalistic environments.</p><p>Foraging animals make a hierarchy of decisions to locate food (food search), choose between different food types (diet or patch choice), and allocate time spent within patches of food items (patch-leaving) (<xref ref-type="bibr" rid="bib89">Stephens, 2008</xref>; <xref ref-type="bibr" rid="bib81">Schoener, 1971</xref>; <xref ref-type="bibr" rid="bib70">Pyke et al., 1977</xref>; <xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>; <xref ref-type="bibr" rid="bib88">Stephens et al., 2007</xref>). These foraging decisions often require that an animal <italic>exploit</italic> an environment for known resources or <italic>explore</italic> it for potentially better opportunities elsewhere (<xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>; <xref ref-type="bibr" rid="bib61">Nonacs, 2001</xref>). This <italic>exploration–exploitation</italic> trade-off requires cognitive computations such as learning the spatiotemporal distribution of food, route planning, estimation of food availability, and decision-making (<xref ref-type="bibr" rid="bib43">Hills, 2006</xref>; <xref ref-type="bibr" rid="bib11">Calhoun and Hayden, 2015</xref>). According to optimal foraging theory, foragers may seek to maximize their rate of net energy gained over time (<xref ref-type="bibr" rid="bib70">Pyke et al., 1977</xref>; <xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>; <xref ref-type="bibr" rid="bib14">Charnov, 1976</xref>) by using internal and external information to guide decision-making, especially in environments where resources are sparsely distributed or fluctuating. Although many studies have provided insight into the motivations, behavioral implementations, and genes associated with foraging decisions (<xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>; <xref ref-type="bibr" rid="bib88">Stephens et al., 2007</xref>), a more rigorous framework for exploring the neuronal mechanisms underlying foraging decisions is essential to establish a comprehensive understanding of decision-making.</p><p>The microscopic nematode <italic>Caenorhabditis elegans</italic> is well suited for investigating the cellular and molecular basis of foraging decisions (<xref ref-type="bibr" rid="bib36">Haley and Chalasani, 2024</xref>). A myriad of genetic tools, behavioral assays, and neuronal imaging techniques have been developed to take advantage of the species’ quick reproductive cycle, isogeneity, optical transparency, and ease of maintenance (<xref ref-type="bibr" rid="bib7">Brenner, 1974</xref>; <xref ref-type="bibr" rid="bib24">Faumont and Lockery, 2006</xref>; <xref ref-type="bibr" rid="bib6">Boulin and Hobert, 2012</xref>). While <italic>C. elegans</italic> typically feed upon a diversity of bacterial types in the wild (<xref ref-type="bibr" rid="bib76">Samuel et al., 2016</xref>), they are commonly maintained in the laboratory on agar plates containing large patches of the bacteria <italic>Escherichia coli</italic> as a food source (<xref ref-type="bibr" rid="bib7">Brenner, 1974</xref>). Even in these simplified laboratory conditions and despite having a numerically simple nervous system of only 302 neurons (<xref ref-type="bibr" rid="bib7">Brenner, 1974</xref>; <xref ref-type="bibr" rid="bib96">White et al., 1986</xref>), <italic>C. elegans</italic> display complex and robust species-typical behaviors (<xref ref-type="bibr" rid="bib20">de Bono and Maricq, 2005</xref>) involving learning and memory (<xref ref-type="bibr" rid="bib15">Colbert and Bargmann, 1995</xref>; <xref ref-type="bibr" rid="bib98">Zhang et al., 2005</xref>; <xref ref-type="bibr" rid="bib3">Ardiel and Rankin, 2010</xref>; <xref ref-type="bibr" rid="bib12">Calhoun et al., 2015</xref>), and decision-making (<xref ref-type="bibr" rid="bib5">Bendesky et al., 2011</xref>; <xref ref-type="bibr" rid="bib25">Faumont et al., 2012</xref>; <xref ref-type="bibr" rid="bib44">Iwanir et al., 2016</xref>; <xref ref-type="bibr" rid="bib92">Tanimoto et al., 2017</xref>; <xref ref-type="bibr" rid="bib45">Ji et al., 2021</xref>; <xref ref-type="bibr" rid="bib79">Scheer and Bargmann, 2023</xref>). Recent studies have demonstrated that ecologically focused environmental enrichment permits identification of novel behaviors and gene functions in <italic>C. elegans</italic> and other animals (<xref ref-type="bibr" rid="bib64">Petersen et al., 2015</xref>; <xref ref-type="bibr" rid="bib95">Volgin et al., 2018</xref>; <xref ref-type="bibr" rid="bib46">Kempermann, 2019</xref>; <xref ref-type="bibr" rid="bib35">Guisnet et al., 2021</xref>).</p><p>Foraging animals often must make one of two types of decisions: <italic>stay–switch</italic> or <italic>accept–reject. Stay–switch</italic> decisions refer to scenarios where an individual experiences diminishing returns with the current action and must decide when to switch to a new action (e.g., patch-leaving and area-restricted search) (<xref ref-type="bibr" rid="bib89">Stephens, 2008</xref>; <xref ref-type="bibr" rid="bib81">Schoener, 1971</xref>; <xref ref-type="bibr" rid="bib70">Pyke et al., 1977</xref>; <xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>; <xref ref-type="bibr" rid="bib88">Stephens et al., 2007</xref>). In contrast, <italic>accept–reject</italic> decisions refer to situations where an individual must decide between engaging with an option or ignoring it in search of a better one (e.g., diet or patch choice) (<xref ref-type="bibr" rid="bib89">Stephens, 2008</xref>; <xref ref-type="bibr" rid="bib70">Pyke et al., 1977</xref>; <xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>). <italic>Stay–switch</italic> decisions have been well described in <italic>C. elegans</italic> (<xref ref-type="bibr" rid="bib12">Calhoun et al., 2015</xref>; <xref ref-type="bibr" rid="bib5">Bendesky et al., 2011</xref>; <xref ref-type="bibr" rid="bib83">Shtonda and Avery, 2006</xref>; <xref ref-type="bibr" rid="bib42">Hills et al., 2004</xref>; <xref ref-type="bibr" rid="bib10">Calhoun et al., 2014</xref>; <xref ref-type="bibr" rid="bib34">Gray et al., 2005</xref>; <xref ref-type="bibr" rid="bib56">Milward et al., 2011</xref>; <xref ref-type="bibr" rid="bib62">Olofsson, 2014</xref>) and enable them to successfully explore an environment and exploit the bacteria within (<xref ref-type="bibr" rid="bib44">Iwanir et al., 2016</xref>; <xref ref-type="bibr" rid="bib66">Pradhan et al., 2019</xref>; <xref ref-type="bibr" rid="bib31">Gloria-Soria and Azevedo, 2008</xref>; <xref ref-type="bibr" rid="bib51">Madirolas et al., 2023</xref>). However, to our knowledge, <italic>accept–reject</italic> decisions have not yet been demonstrated in <italic>C. elegans</italic>. While <italic>C. elegans</italic> have been shown to alter food preferences in a diet choice assay, this behavior has only been described by a set of <italic>stay–switch</italic> decisions (<xref ref-type="bibr" rid="bib79">Scheer and Bargmann, 2023</xref>; <xref ref-type="bibr" rid="bib83">Shtonda and Avery, 2006</xref>; <xref ref-type="bibr" rid="bib51">Madirolas et al., 2023</xref>). The ability to make <italic>accept–reject</italic> decisions is likely advantageous for foraging in fluctuating or variable environments as rejecting an encountered food item of low quality creates the opportunity for a subsequent encounter with preferred food. Thus, while <italic>C. elegans</italic> can successfully forage in patchily distributed environments, it is not known whether <italic>C. elegans</italic> make decisions to <italic>exploit</italic> a patch of food upon encounter and how this decision-making process changes over a series of patch encounters.</p><p>In this study, we aimed to identify if <italic>C. elegans</italic> make <italic>accept–reject</italic> decisions upon encounter with bacterial patches. To answer this question, we performed a detailed analysis of the behavior of individual animals foraging in an ecologically inspired environment where bacterial patches were dilute and dispersed. In conditions where the bacterial density was much lower than that of previously visited patches, animals first explored the environment before <italic>accepting</italic> patches for exploitation. This explore-then-exploit strategy persists even when only one bacterial patch is present in the environment. Using a theoretical framework, we found that this initial exploration reflects a series of <italic>accept–reject</italic> decisions guided by signals related to the bacterial density of current and recently <italic>explored</italic> and <italic>exploited</italic> patches as well as the animal’s state of satiety.</p></sec><sec id="s2" sec-type="results"><title>Results</title><sec id="s2-1"><title><italic>C. elegans</italic> forage in patchy environments with an explore-then-exploit strategy</title><p>To investigate whether <italic>C. elegans</italic> make <italic>accept–reject</italic> decisions upon encounter with bacterial patches, we observed the behavior of animals foraging on an agar surface containing an isometric grid of small, low-density bacterial patches (<xref ref-type="fig" rid="fig1">Figure 1A</xref>, <xref ref-type="video" rid="video1">Videos 1</xref> and <xref ref-type="video" rid="video2">2</xref>). Animals were confined to an arena where their behavior was recorded and tracked for 60 min (<xref ref-type="fig" rid="fig1">Figure 1A</xref>, <xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1</xref>, <xref ref-type="video" rid="video3">Video 3</xref>). During this time, animals were observed to move about the arena (<xref ref-type="fig" rid="fig1">Figure 1A–C</xref>, <xref ref-type="fig" rid="fig1s2">Figure 1—figure supplement 2</xref>, <xref ref-type="video" rid="video4">Video 4</xref>) with each animal encountering, on average, ~8.4 total patches and ~5.3 unique patches during the 1-hr recording (<xref ref-type="fig" rid="fig1">Figure 1D</xref>). These patch encounters ranged in duration from seconds to tens of minutes and could be classified as either short or long (2+ min) using a Gaussian mixture model (GMM) (<xref ref-type="fig" rid="fig1">Figure 1E</xref>, <xref ref-type="fig" rid="fig1s3">Figure 1—figure supplement 3</xref>). Notably, animals were significantly more likely to stay on patch for longer durations at later time points (<xref ref-type="fig" rid="fig1">Figure 1F</xref>), which corresponded to an overall increase in their probability of residing on patch (<xref ref-type="fig" rid="fig1">Figure 1G</xref>, <xref ref-type="fig" rid="fig1s4">Figure 1—figure supplement 4</xref>). Specifically, we found that while animals initially resided on bacterial patches at levels close to those predicted by chance, an animal’s probability of residing on a bacterial patch increased significantly after ~10 min. These findings, that patch duration and residence increased over time, suggest that animals are more likely to exploit an encountered patch as time goes on.</p><fig-group><fig id="fig1" position="float"><label>Figure 1.</label><caption><title><italic>C</italic>. <italic>elegans</italic> forage in a patchy environment with an explore-then-exploit strategy.</title><p>(<bold>A</bold>) An example animal’s midbody location (colored to represent time in the experiment) as it forages in an environment bounded by a large (30 mm diameter) arena containing 19 small (~1.8 mm diameter) bacterial patches (gray). Each patch was made by pipetting ~0.5 µl of OP50 <italic>E. coli</italic> diluted to OD<sub>600</sub> ~10 and grown at room temperature for ~1 hr. (<bold>B</bold>) Distance between the example animal’s midbody position and the nearest patch edge (positive indicates inside patch) is plotted (black) for every time point. Putative encounters with a bacterial patch are indicated (gray). (<bold>C</bold>) Patch encounters (colored to represent the duration of the encounter) for 50 individuals foraging in these environments are plotted. (<bold>D</bold>) The number of total and unique patch encounters for each animal is shown. (<bold>E</bold>) Duration for each patch encounter was computed and classified as either short (0–2 min) or long (2–60 min) using a Gaussian mixture model. The distributions of all observed short and long encounters are plotted with duration binned logarithmically. (<bold>F</bold>) The observed start time of each patch encounter is shown for all short- and long-duration encounters. Long-duration encounters occur significantly later (one-tailed Mann–Whitney <italic>U</italic>-test). (<bold>G</bold>) The probability of residing on patch was computed for all worms across time (black) and compared to the probability of residing on patch if patch locations were semi-randomly permuted (pink). Smoothed median values are plotted with bootstrap-derived 2.5% and 97.5% quantiles shown in shaded regions. Time points where observed probabilities of residing on patch significantly exceed permuted probabilities are indicated by a black line (one-tailed Fisher’s exact test with Benjamini–Hochberg correction). (<bold>H</bold>) The track of the example animal in (<bold>A</bold>) is replotted with color used to represent the animal’s instantaneous velocity at each time point. (<bold>I</bold>) Velocity of the example animal over time is plotted (black) alongside patch encounters (gray) as previously identified in (<bold>B</bold>). Example encounters – one early, short duration (green) and one late, long duration (blue) – are indicated. (<bold>J</bold>, <bold>K</bold>) A 60-s time window surrounding the start of these example encounters is enlarged. (<bold>L</bold>) Velocity trajectories were aligned to patch entry for every encounter. Mean encounter-aligned (black/gray) and randomly aligned (pink) trajectories are plotted for each animal (light) and across all animals (dark). (<bold>M</bold>) Deceleration upon encounter with the patch edge is plotted for every encounter and grouped by duration type. Deceleration was significantly lower for encounter-aligned as compared to randomly aligned trajectories (pink) for all duration types (one-tailed Mann–Whitney <italic>U</italic>-tests with Bonferroni correction). (<bold>N</bold>) Mean velocity as a function of the distance from the edge of bacterial patches (computed for 50 μm bins) is shown for every animal (gray) and across all animals (black). (<bold>O</bold>) Each animal’s mean velocity during time spent on and off (midpoint at least –0.46 mm from patch edge) patch is shown. Velocity on patch was significantly slower than off patch (one-tailed paired-sample <italic>t</italic>-test). Sample data for one animal (worm #1) are shown in (<bold>A</bold>–<bold>C</bold>, <bold>H</bold>–<bold>K</bold>). Summary data for all animals (<italic>N</italic> = 50 worms) and encounters (<italic>N</italic> = 419 total encounters) are shown in (<bold>D</bold>–<bold>G</bold>, <bold>L</bold>–<bold>O</bold>). Violin plots in (<bold>D</bold>, <bold>F</bold>, <bold>M</bold>, <bold>O</bold>) give the kernel density estimate (KDE) and quartiles for each measure. Asterisks denote statistical significance (***p &lt; 0.001). See also <xref ref-type="fig" rid="fig1s1">Figure 1—figure supplements 1</xref>–<xref ref-type="fig" rid="fig1s5">5</xref> and <xref ref-type="video" rid="video1">Videos 1</xref>–<xref ref-type="video" rid="video4">4</xref>.</p><p><supplementary-material id="fig1sdata1"><label>Figure 1—source data 1.</label><caption><title>Number of total and unique patch encounters in <xref ref-type="fig" rid="fig1">Figure 1D</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig1-data1-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig1sdata2"><label>Figure 1—source data 2.</label><caption><title>Duration of patch encounters in <xref ref-type="fig" rid="fig1">Figure 1E</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig1-data2-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig1sdata3"><label>Figure 1—source data 3.</label><caption><title>Start time of patch encounters in <xref ref-type="fig" rid="fig1">Figure 1F</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig1-data3-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig1sdata4"><label>Figure 1—source data 4.</label><caption><title>On-patch residence in <xref ref-type="fig" rid="fig1">Figure 1G</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig1-data4-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig1sdata5"><label>Figure 1—source data 5.</label><caption><title>Velocity of animals upon encounter with patch edge in <xref ref-type="fig" rid="fig1">Figure 1L</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig1-data5-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig1sdata6"><label>Figure 1—source data 6.</label><caption><title>Deceleration of animals upon encounter with patch edge in <xref ref-type="fig" rid="fig1">Figure 1M</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig1-data6-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig1sdata7"><label>Figure 1—source data 7.</label><caption><title>Velocity of animals upon encounter with patch edge in <xref ref-type="fig" rid="fig1">Figure 1N</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig1-data7-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig1sdata8"><label>Figure 1—source data 8.</label><caption><title>Velocity on and off patch in <xref ref-type="fig" rid="fig1">Figure 1O</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig1-data8-v1.xlsx"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig1-v1.tif"/></fig><fig id="fig1s1" position="float" specific-use="child-fig"><label>Figure 1—figure supplement 1.</label><caption><title>Assay preparation, arena and patch detection, and behavioral tracking.</title><p>(<bold>A</bold>) Graphic describing the steps to prepare assay plates. Created with BioRender. (<bold>B</bold>) Example frames from a ‘contrast video’ showing how a piece of dark cardstock passed between the light source and the assay plate enables visualization of dilute bacterial patches. (<bold>C</bold>) An image of the bacterial patches is generated from the ‘contrast video’. (<bold>D</bold>) Masks of the arena (black) and bacterial patches (gray) were constructed using image processing techniques and, when applicable, subsequent manual corrections (see Bacterial patch location detection). Arena masks were used to calculate the image scale in pixels/mm. (<bold>E</bold>) Example frame from a behavior video containing four adult <italic>C. elegans</italic> is shown. (<bold>F</bold>) WormLab was used to identify the midbody location of animals in each frame (see Behavioral tracking). An inset shows detection of one of the four worms. (<bold>G</bold>) An example animal’s tracked location as it forages in this environment is plotted with color used to represent time (dark blue = 0 min; dark red = 60 min).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig1-figsupp1-v1.tif"/></fig><fig id="fig1s2" position="float" specific-use="child-fig"><label>Figure 1—figure supplement 2.</label><caption><title>Defining a patch encounter using high-resolution behavioral recordings.</title><p>(<bold>A</bold>) Example frame from a behavior video containing one adult <italic>C. elegans</italic> is shown. (<bold>B</bold>) WormLab was used to track the body of the animal in each frame (see Behavioral tracking). (<bold>C</bold>) An example image showing the center spline of the example animal as well as the location of the bacterial patch (gray) and arena (black). The inset shows the animal’s center spline and bacterial patch superimposed on top of the raw image. (<bold>D</bold>) Example body postures/orientations (black) of an animal during frames when its head is on the patch edge. The distance (blue lines) between the head (black dot) and midpoint (blue dot) of the animal was calculated. A histogram of this head-to-midpoint distance is plotted, and the median value (blue) is indicated (<italic>N</italic> = 220 animals; 74,839 frames). The median head-to-midpoint distance was subsequently used as a threshold for detection of patch encounter and leaving events. For one example animal, the distance between the head (black) or midbody (blue) position and the nearest patch edge (positive = inside patch; negative = outside patch) is plotted for every time point. The edge of the patch (solid horizontal black line) and threshold for encounter detection (dashed -.- black line) are indicated. Putative patch encounter (green) and leaving (red) events are shown. (<bold>E</bold>) Example body postures/orientations of an animal when its head is on the patch. The distance between the midpoint of the animal and the patch edge (blue lines) was calculated. A histogram of this midpoint-to-patch distance is plotted, and the 1st percentile (blue) is indicated (<italic>N</italic> = 220 animals; 1,571,163 frames). This value is used as a threshold for excluding putative encounters where the animal’s midpoint never comes within 0.28768 mm of the patch edge. A 1.5-min time window of the example animal’s position in (<bold>D</bold>) is shown. The edge of the patch (solid line), threshold for encounter detection (dashed -.- line), and threshold for encounter exclusion (dashed – line) are indicated. Example putative encounters are shown. The first two sets of enter and exit events were excluded. The third set shown was included. The included encounter is shaded in gray. (<bold>F</bold>) The standard deviation of the distance between the location of the patch edge and the midpoint of the animal was calculated for every putative on-patch encounter and off-patch event (<italic>N</italic> = 220 animals; 2945 putative on-patch events; 2725 putative off-patch events). A subset of putative off-patch events had low standard deviations matching those of on-patch events. A one-dimensional Gaussian mixture model was fit to the off-patch standard deviation values, and a threshold was set where the posterior probability of events falling in the high or low variance cluster was 0.5. A 1.5-min time window of the example animal’s position in (<bold>D</bold>) is shown. Examples of two excluded off-patch events and one included event are shown.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig1-figsupp2-v1.tif"/></fig><fig id="fig1s3" position="float" specific-use="child-fig"><label>Figure 1—figure supplement 3.</label><caption><title>Classifying encounters based on duration using a Gaussian mixture model (GMM).</title><p>(<bold>A</bold>) As in <xref ref-type="fig" rid="fig1">Figure 1E</xref>, duration for each patch encounter (<italic>N</italic> = 419 events; 50 worms) was computed and classified as either short or long using a GMM. The distributions of all observed short and long encounters are plotted with duration binned logarithmically. The probability density functions for the two component Gaussians are shown. (<bold>B</bold>) The posterior probabilities for classification as short or long are sorted for all encounters, highlighting the low posterior variance of the GMM. (<bold>C</bold>) Given that some patch encounters were not fully observed (i.e., ~22% of animals were already on patch at the start of the recording and ~96% of animals were on patch when the recording ended), we identified that ~14% of observed patch durations were left-censored (i.e., having actual duration ≥ observed duration). Thus, to confirm findings in <xref ref-type="fig" rid="fig1">Figure 1E, F</xref>, we re-classified only non-censored observations where both the entry and exit of a patch encounter were observed. As in <xref ref-type="fig" rid="fig1">Figure 1C</xref>, patch encounters for 50 individuals foraging in these patchy environments are plotted across time. Encounters that were uncensored (pink) and censored (gray) are indicated. (<bold>D</bold>) The distribution of the duration of only fully observed (uncensored) encounters (<italic>N</italic> = 360 events; 50 worms) is plotted. The component Gaussians for a GMM fitting this subset of data are shown. (<bold>E</bold>) Sorted posterior probabilities for the uncensored model are shown. (<bold>F</bold>) The observed start time of each uncensored patch encounter is shown for all short and long-duration encounters. Long-duration encounters occur significantly later (Mann–Whitney <italic>U</italic>-test, ***p &lt; 0.001). Violin plots show the kernel density estimate (KDE) and quartiles for each duration type. (<bold>G</bold>) Posterior probabilities for classification in the long-duration cluster are shown for the two models. The uncensored data model results in a slight increase in posterior probabilities of long-duration classification but ultimately affected classification of only one of the 419 encounters.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig1-figsupp3-v1.tif"/></fig><fig id="fig1s4" position="float" specific-use="child-fig"><label>Figure 1—figure supplement 4.</label><caption><title>Permuting patches to test for significance of the observed time-dependent increase in patch residence.</title><p>(<bold>A</bold>) Locations of bacterial patches (dark gray) are shown with the threshold for putative encounters (light gray) set at 0.46024 mm (as described in <xref ref-type="fig" rid="fig1s2">Figure 1—figure supplement 2</xref> and Patch encounter detection). (<bold>B</bold>) Patches were permuted via randomized rotation and translation with the restriction that patches could not overlap with other patches nor with the arena. (<bold>C</bold>, <bold>D</bold>) Midbody location of the animal over time was overlaid on the original and semi-randomly permuted patches. (<bold>E</bold>, <bold>F</bold>) On-patch events were subsequently identified. This permutation procedure was repeated for 1000 replicates for every worm tested. Smoothed median values of the probability of worms residing on patch over time were compared for every time point in <xref ref-type="fig" rid="fig1">Figures 1G</xref> and <xref ref-type="fig" rid="fig2">2F</xref>, <xref ref-type="fig" rid="fig2s5">Figure 2—figure supplement 5</xref>.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig1-figsupp4-v1.tif"/></fig><fig id="fig1s5" position="float" specific-use="child-fig"><label>Figure 1—figure supplement 5.</label><caption><title>Analyzing deceleration upon encounter with a patch.</title><p>(<bold>A</bold>) To quantify the magnitude of slowdown upon encounter with the patch edge, we averaged the velocity trajectories across encounters (black) and found the velocity reached a maximum at 1.5 s before (green) and a minimum at 6 s after (red) the start of the encounter (gray). (<bold>B</bold>, <bold>C</bold>) Subsequently, for every encounter, a line (blue) was fit to the animal’s velocity (black) for that 8-s time window surrounding the start of the encounter. Deceleration was defined as the slope of this line. Examples matching (<bold>B</bold>) the short-duration encounter in <xref ref-type="fig" rid="fig1">Figure 1J</xref> and (<bold>C</bold>) the long-duration encounter in <xref ref-type="fig" rid="fig1">Figure 1K</xref> are shown.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig1-figsupp5-v1.tif"/></fig></fig-group><media mimetype="video" mime-subtype="mp4" xlink:href="elife-103191-video1.mp4" id="video1"><label>Video 1.</label><caption><title><italic>C. elegans</italic> foraging in a patchily distributed environment.</title><p>Four adult <italic>C. elegans</italic> forage for 1 hr in a 30-mm arena containing an isometric grid of small, low-density bacterial patches.</p></caption></media><media mimetype="video" mime-subtype="mp4" xlink:href="elife-103191-video2.mp4" id="video2"><label>Video 2.</label><caption><title>Visualizing dilute bacterial patches using diffraction of light.</title><p>A piece of dark cardstock passed between the light source and the assay plate enables visualization of dilute bacterial patches.</p></caption></media><media mimetype="video" mime-subtype="mp4" xlink:href="elife-103191-video3.mp4" id="video3"><label>Video 3.</label><caption><title>Tracking the midbody location of an animal foraging in a patchily distributed environment.</title><p>The midbody location of one of the four animals shown in <xref ref-type="video" rid="video1">Video 1</xref> is shown as the animal forages for 1 hr in a 30-mm arena containing an isometric grid of small, low-density bacterial patches. The animal shown corresponds to the example animal observed in <xref ref-type="fig" rid="fig1">Figure 1A, B, H–K</xref>.</p></caption></media><media mimetype="video" mime-subtype="mp4" xlink:href="elife-103191-video4.mp4" id="video4"><label>Video 4.</label><caption><title>Tracking the entire body of a foraging animal.</title><p>The position of the entire body of an animal is shown as the animal forages for 1 hr in a 9-mm arena containing one small, low-density bacterial patch. The head is indicated by a small dot. The animal shown corresponds to the example animal observed in <xref ref-type="fig" rid="fig3">Figure 3D</xref>.</p></caption></media><p>Given that the bacterial density of the experimental patches was approximately 20 times more dilute than that of conditions animals experienced during development and immediately preceding the assay, it was possible that the initial delay in exploitation could be due to animals’ inability to detect the presence of bacteria in these more dilute patches. We therefore sought to determine if animals detected patches at all time points. Previous studies have shown that <italic>C. elegans</italic> display an immediate and marked slowdown upon encounter with the edge of a food patch and sustain these slower speeds on food (<xref ref-type="bibr" rid="bib44">Iwanir et al., 2016</xref>; <xref ref-type="bibr" rid="bib30">Fujiwara et al., 2002</xref>). Therefore, velocity can be used as a proxy for an animal’s ability to sense a bacterial patch. Following this precedent, we quantified the instantaneous velocity of individuals in our assay (<xref ref-type="fig" rid="fig1">Figure 1H</xref>). We observed significant deceleration of an animal’s instantaneous velocity upon encounter with the patch edge (<xref ref-type="fig" rid="fig1">Figure 1I</xref>), with no obvious difference between short-duration, early time point (<xref ref-type="fig" rid="fig1">Figure 1J</xref>) and long-duration, late time point (<xref ref-type="fig" rid="fig1">Figure 1K</xref>) encounters. Animals consistently displayed marked slowdown when approaching the patch edge (<xref ref-type="fig" rid="fig1">Figure 1L</xref>), achieving an average deceleration of –19.5 μm/s<sup>2</sup> upon encounter with the bacterial patch (<xref ref-type="fig" rid="fig1">Figure 1M</xref>, <xref ref-type="fig" rid="fig1s5">Figure 1—figure supplement 5</xref>). This slowdown was statistically significant for both long- and short-duration encounters (<xref ref-type="fig" rid="fig1">Figure 1M</xref>). Further, consistent with <italic>C. elegans</italic> behavior on larger and more densely seeded patches in other studies (<xref ref-type="bibr" rid="bib78">Sawin et al., 2000</xref>), animals in our assay maintained significantly lower average velocities on patch (~52 μm/s) compared to off patch (~198 μm/s) (<xref ref-type="fig" rid="fig1">Figure 1N, O</xref>). These results suggest that, despite detecting the availability of food during early patch encounters, <italic>C. elegans</italic> opt to initially prioritize exploration of the environment before switching to a more exploitatory foraging strategy during subsequent patch encounters.</p></sec><sec id="s2-2"><title>The timing of the switch from exploration to exploitation varies with bacterial density</title><p>To determine whether this explore-then-exploit foraging strategy is dependent upon food-related characteristics of the environment, we varied the density of the bacterial patches. By diluting bacterial stocks and controlling growth time, we created 12 bacterial density conditions with relative density ranging from 0 to ~200 (<xref ref-type="fig" rid="fig2">Figure 2A</xref>, <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplements 1</xref>–<xref ref-type="fig" rid="fig2s3">3</xref>). At the low end of this range (densities less than ~0.5), animals do not appear to detect bacterial patches as indicated by on-patch velocities matching those of animals foraging on bacteria-free (density 0) patches (<xref ref-type="fig" rid="fig2">Figure 2B, C</xref>). At the high end of the range (density ~200), bacterial density is comparable to the environments animals experienced during development and immediately prior to the assay (<xref ref-type="fig" rid="fig2s2">Figure 2—figure supplements 2</xref> and <xref ref-type="fig" rid="fig2s3">3</xref>).</p><fig-group><fig id="fig2" position="float"><label>Figure 2.</label><caption><title>The timing of the switch from explore-to-exploit is density dependent.</title><p>(<bold>A</bold>) The relative density (as estimated by fluorescently labeled OP50-GFP) is shown for small (~1.8 mm diameter) bacterial patches made by pipetting ~0.5 µl droplets of OP50 <italic>E. coli</italic> diluted in lysogeny broth (LB) to a range of optical densities OD<sub>600</sub> = {0, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 10} and controlling growth time at room temperature (hours = {1, 12, 48}). For (<bold>A</bold>–<bold>G</bold>, <bold>L</bold>–<bold>O</bold>), gray-scale color saturation is proportional to the relative density of each condition and corresponds to labels in (<bold>A</bold>). (<bold>B</bold>) The mean velocities of animals foraging in environments containing patches matching one of the 12 bacterial densities are plotted as a function of the distance from the edge of bacterial patches (computed for 50 μm bins). (<bold>C</bold>) Animals’ average on-patch velocity is plotted as a function of the relative density of bacteria. Compared to animals foraging among bacteria-free patches containing only LB (relative density 0), animals foraging on bacterial patches with relative density of 0.5 or greater display significantly slower on-patch velocities (one-tailed Mann–Whitney <italic>U</italic>-tests with Bonferroni correction). (<bold>D</bold>) The midbody location (colored to represent time in the experiment) of example animals foraging in environments containing patches (gray) of relative density 0, 1, 5, 10, and 200 is shown. (<bold>E</bold>) The total time each animal spent on patch is plotted as a function of the relative density of bacteria. Time on patch increased monotonically with increasing bacterial density (Kendall’s <italic>τ</italic> correlation, p &lt; 0.001) following a sigmoidal trend. (<bold>F</bold>) Smoothed median values of the probability of worms residing on patch over time for each density condition are plotted. Time points where observed probabilities of residing on patch either match (pink) or significantly exceed (gray) the probability of residing on patch if patch locations were semi-randomly permuted are indicated (one-tailed Fisher’s exact test with Benjamini–Hochberg correction). (<bold>G</bold>) A kernel density estimate (KDE) of the distribution of encounter durations is plotted for each density condition. (<bold>H</bold>) For each encounter, the average velocity of the animal during the encounter and the duration of that encounter are plotted on a double-logarithmic plot with color representing the probabilities of clustering classification as <italic>search</italic> (orange), <italic>sample</italic> (green), or <italic>exploit</italic> (blue). Contours showing the first, second, and third standard deviation of the Gaussian mixture model (GMM) used to classify <italic>explore</italic> and <italic>exploit</italic> encounters are shown as shaded ellipses with saturation corresponding to standard deviation. KDEs for distributions of average on-patch velocity and encounter duration are plotted for each encounter type. (<bold>I</bold>) For each encounter, the minimum on-patch velocity and maximum change in velocity are plotted. Contours showing the separation of <italic>sensing</italic> and <italic>non-responding</italic> encounters as estimated by semi-supervised quadratic discriminant analysis (QDA) are indicated. A KDE for the distribution of the maximum change in velocity is plotted for each encounter type. (<bold>J</bold>) Features used to classify encounters as <italic>search</italic>, <italic>sample</italic>, or <italic>exploit</italic> are summarized. (<bold>K</bold>) KDEs of the distributions of animals’ velocities are shown for all time points during search off and on patch as well as during sample and exploit encounters. (<bold>L</bold>) Ethograms of patch encounters (colored to represent the probability of classification as <italic>search</italic>, <italic>sample</italic>, and <italic>exploit</italic>) are shown for 443 individuals. (<bold>M</bold>) The average proportion of each encounter type over time is plotted. (<bold>N</bold>) Time elapsed and (<bold>O</bold>) number of encounters occurring prior to the first <italic>exploitation</italic> event are plotted for every animal (blue). In the event that no <italic>exploitation</italic> event occurred, the maximum observed time and encounters are plotted (red-orange). Both time and encounter number before <italic>exploitation</italic> decrease monotonically with increasing patch density (Kendall’s <italic>τ</italic> correlation, p &lt; 0.001) following a sigmoidal trend. Summary data for all animals (<italic>N</italic> = 443 total worms; <italic>N</italic> = 20–50 worms per condition) and encounters (<italic>N</italic> = 6560 total encounters; <italic>N</italic> = 46–876 encounters per condition) are shown in (<bold>A</bold>–<bold>C</bold>, <bold>E</bold>–<bold>I</bold>, <bold>K</bold>–<bold>O</bold>). Asterisks denote statistical significance (***p &lt; 0.001). See also <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplements 1</xref>–<xref ref-type="fig" rid="fig2s8">8</xref> and <xref ref-type="video" rid="video5">Videos 5</xref> and <xref ref-type="video" rid="video6">6</xref>.</p><p><supplementary-material id="fig2sdata1"><label>Figure 2—source data 1.</label><caption><title>Relative density of bacterial patches in each condition in <xref ref-type="fig" rid="fig2">Figure 2A</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data1-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata2"><label>Figure 2—source data 2.</label><caption><title>Velocity of animals upon encounter with patch edge in <xref ref-type="fig" rid="fig2">Figure 2B</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data2-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata3"><label>Figure 2—source data 3.</label><caption><title>Velocity on patch in <xref ref-type="fig" rid="fig2">Figure 2C</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data3-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata4"><label>Figure 2—source data 4.</label><caption><title>Time on patch in <xref ref-type="fig" rid="fig2">Figure 2E</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data4-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata5"><label>Figure 2—source data 5.</label><caption><title>On-patch residence in <xref ref-type="fig" rid="fig2">Figure 2F</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data5-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata6"><label>Figure 2—source data 6.</label><caption><title>Duration of patch encounters in <xref ref-type="fig" rid="fig2">Figure 2G</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data6-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata7"><label>Figure 2—source data 7.</label><caption><title>Encounter classification as explore or exploit using a Gaussian mixture model (GMM) in <xref ref-type="fig" rid="fig2">Figure 2H</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data7-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata8"><label>Figure 2—source data 8.</label><caption><title>Encounter classification as sense or no response using semi-supervised quadratic discriminant analysis (QDA) in <xref ref-type="fig" rid="fig2">Figure 2I</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data8-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata9"><label>Figure 2—source data 9.</label><caption><title>Velocity during search, sample, and exploit behaviors in <xref ref-type="fig" rid="fig2">Figure 2K</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data9-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata10"><label>Figure 2—source data 10.</label><caption><title>Encounter classification as explore or exploit and sense or no response in <xref ref-type="fig" rid="fig2">Figure 2L</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data10-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata11"><label>Figure 2—source data 11.</label><caption><title>Probability of an encounter type over time in <xref ref-type="fig" rid="fig2">Figure 2M</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data11-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata12"><label>Figure 2—source data 12.</label><caption><title>Time before first exploitation in <xref ref-type="fig" rid="fig2">Figure 2N</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data12-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig2sdata13"><label>Figure 2—source data 13.</label><caption><title>Number of encounters before first exploitation in <xref ref-type="fig" rid="fig2">Figure 2O</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig2-data13-v1.xlsx"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-v1.tif"/></fig><fig id="fig2s1" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 1.</label><caption><title>Obtaining intensity profiles for fluorescent bacterial patches.</title><p>(<bold>A</bold>) Fluorescently labeled OP50-GFP bacterial patches were seeded onto agar plates under conditions matching those in the experimental assay. Small patches (0.5 µl) were pipetted in an isometric grid (6 mm center-to-center spacing) on a 16 × 25 mm rectangular template comparable to the one used in behavioral assays. Large patches (20 or 200 µl) were seeded directly onto agar plates. Brightfield and fluorescence images were acquired for every condition at multiple time points of bacterial growth. The fluorescence intensity profile of these images was obtained. (<bold>B</bold>) Due to uneven illumination within the field of view of our imaging system, matched fluorescence images of an empty agar plate were acquired at each time point. These ‘background’ images were smoothed using a two-dimensional averaging filter to remove noise. (<bold>C</bold>) Fluorescence images of the bacterial patches were normalized to these background images. (<bold>D</bold>) Locations of bacterial patches within the template were automatically detected using image processing techniques. Each patch was then radially segmented in bins of equal area. The mean pixel intensity value for each bin was computed and used to create an intensity profile of the patch. (<bold>E</bold>) The patch border and peak were detected using signal processing techniques. Specifically, the patch border was identified by finding a peak in the curvature <inline-formula><alternatives><mml:math id="inf1"><mml:mi>κ</mml:mi></mml:math><tex-math id="inft1">\begin{document}$\kappa $\end{document}</tex-math></alternatives></inline-formula> of the edge profile. Border amplitude was defined as the magnitude of the difference between the patch border and peak. Relative border amplitude was defined as the border amplitude divided by the exposure time. A line was fit to the values of relative border amplitude across numerous time points and experiment days (five replicates shown as varying color points).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-figsupp1-v1.tif"/></fig><fig id="fig2s2" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 2.</label><caption><title>Example fluorescence profiles of bacterial patches under varied growth conditions.</title><p>Fluorescently labeled OP50-GFP bacterial patches were imaged (as described in <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref> and Bacterial patch density estimation). Inverted images (darker saturation = more bacteria) are shown here to highlight the range of bacterial densities tested in these experiments. All patches are shown on the same spatial scale and using one of the two linear saturation scales: (1) regular – normalized to show variance in high-density patches; (2) augmented (~22×) – normalized to show variance in low-density patches. Each patch shown is labeled with the optical density (OD<sub>600</sub>) at time of seeding and the approximate amount of time bacteria was grown for at room temperature (i.e., 1, 12, or 48 hr). (<bold>A</bold>) An example large (200 µl) bacterial patch of the type that animals experienced immediately prior to the assays in this paper. (<bold>B</bold>) Example small (0.5 µl) bacterial patches of greatest density. (<bold>C</bold>) Example small (0.5 µl) bacterial patches of lower density. The saturation of each image has been uniformly augmented to ~22× darker to the extent that the OD<sub>600</sub> = 10 (1H) bacterial patch is the same patch as the one in (<bold>B</bold>). (<bold>D</bold>) Example small (0.5 µl) bacterial patches of lower density seeded on nematode growth medium (NGM) agar plates lacking peptone. (<bold>E</bold>) Example medium (20 µl) bacterial patches of greater density. (<bold>F</bold>) Example medium (20 µl) bacterial patches of lowest density. The OD<sub>600</sub> = 1 (1H) bacterial patch is the same patch as the one shown in (<bold>E</bold>), but ~22× darker.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-figsupp2-v1.tif"/></fig><fig id="fig2s3" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 3.</label><caption><title>Quantifying the relative density of bacterial patches across conditions and time points.</title><p>(<bold>A</bold>) Relative density of OP50-GFP bacterial patches matched to all assay conditions in this paper is shown. Relative density represents the relative border amplitude (as defined in <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref> and Bacterial patch density estimation) normalized to the mean density of patches seeded with 0.5 µl of OD<sub>600</sub> = 10 grown for 1 hr on plates with peptone (blue asterisk). In this manner, the bacterial patches experienced by animals in <xref ref-type="fig" rid="fig1">Figure 1</xref> have been set to an average relative density of 10. Violin plots show the kernel density estimate (KDE) and quartiles for each condition. (<bold>B</bold>) Linear fits for the relative density of bacterial patches in each condition as a function of time are plotted. Saturation of each line corresponds to the relative density as depicted in (<bold>A</bold>). For each experimental plate, the relative density of bacterial patches was estimated by applying the coefficients from these linear regressions to the total amount of time the bacteria was grown at room temperature.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-figsupp3-v1.tif"/></fig><fig id="fig2s4" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 4.</label><caption><title>Example traces of animals foraging in environments with varying bacterial density.</title><p>Traces showing the midbody location of 12 example animals as they forage within a 30-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). Locations of bacterial patches are indicated in gray. The relative density of bacterial patches in each environment is noted. Animals shown foraging on relative density 0, 1, 5, 10, and 200 are the same as those in <xref ref-type="fig" rid="fig2">Figure 2D</xref>.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-figsupp4-v1.tif"/></fig><fig id="fig2s5" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 5.</label><caption><title>Time- and density-dependent increase in patch residence.</title><p>Probability of residing on patch was computed for all worms across time (black) and compared to the probability of residing on patch for semi-randomly permuted patch locations (pink) (as described in <xref ref-type="fig" rid="fig1s4">Figure 1—figure supplement 4</xref>). Smoothed median values are plotted with bootstrap-derived 2.5% and 97.5% quantiles shown in shaded regions. Time points where observed probabilities of residing on patch significantly exceed permuted probabilities are indicated by a black line (one-tailed Fisher’s exact tests with Benjamini–Hochberg correction, ***p &lt; 0.001). The smoothed median values for observed data are shown in <xref ref-type="fig" rid="fig2">Figure 2F</xref>. Data for relative density 10 match those in <xref ref-type="fig" rid="fig1">Figure 1G</xref>.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-figsupp5-v1.tif"/></fig><fig id="fig2s6" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 6.</label><caption><title>Classifying encounters as exploration or exploitation.</title><p>(<bold>A</bold>) A two-dimensional histogram shows the frequency of events for given pairs of values for the average velocity of the animal during an encounter and the duration of that encounter for all encounters in the paper. Probabilities are represented as a heat map of color. (<bold>B</bold>) The first principal component (PC1) for these two metrics was computed. The distribution of projections of the data onto PC1 is given by a histogram (gray). Kernel density estimates (KDEs) were computed using the bandwidth <inline-formula><alternatives><mml:math id="inf2"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:mi>h</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft2">\begin{document}$\hat{h}$\end{document}</tex-math></alternatives></inline-formula> defined by Silverman’s Rule of Thumb (blue) and using the critical bandwidth <inline-formula><alternatives><mml:math id="inf3"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msup><mml:mi>h</mml:mi><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math><tex-math id="inft3">\begin{document}$h^{*}$\end{document}</tex-math></alternatives></inline-formula> (red-orange) at which the KDE is at the threshold between uni- and bi-modal (see Patch encounter classification as exploration or exploitation). (<bold>C</bold>) Critical bandwidth values were computed across 2000 smoothed bootstrap resamples. The distribution of these bootstrapped critical values is given as a histogram and compared against the critical bandwidth of the original data set (red-orange). (<bold>D</bold>) The average velocity of the animal during an encounter and the duration of that encounter are plotted for each encounter as visualized on a double-logarithmic plot. Contours showing the first, second, and third standard deviation of the two-dimensional Gaussian mixture model (GMM) are shown as shaded ellipses with saturation corresponding to standard deviation. Encounters for all data in the paper are individually plotted as in <xref ref-type="fig" rid="fig2">Figure 2H</xref> but with color representing the posterior probability of clustering classification as <italic>explore</italic> (green) or <italic>exploit</italic> (blue). (<bold>E</bold>) Posterior variance of the data as defined in Patch encounter classification as <italic>exploration</italic> or <italic>exploitation</italic> was calculated for 1000 replicates of GMMs with varied regularization value α. The classifier with minimum posterior variance (i.e., <inline-formula><alternatives><mml:math id="inf4"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>α</mml:mi><mml:mo>=</mml:mo><mml:mn>0.025</mml:mn></mml:mrow></mml:mstyle></mml:math><tex-math id="inft4">\begin{document}$\alpha = 0.025$\end{document}</tex-math></alternatives></inline-formula>) was used. (<bold>F</bold>) The posterior probabilities for classification as <italic>explore</italic> (green) or <italic>exploit</italic> (blue) are sorted for all encounters, highlighting the low posterior variance of the GMM. (<bold>G</bold>) Posterior probabilities for only the data in <xref ref-type="fig" rid="fig2">Figure 2</xref> are shown.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-figsupp6-v1.tif"/></fig><fig id="fig2s7" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 7.</label><caption><title>Classifying encounters as sensing or non-responding.</title><p>(<bold>A</bold>) Minimum velocity (min. velocity on patch), maximum change in velocity (max. Δ velocity), and deceleration (Δ velocity) were calculated (as described in Patch encounter classification as sensing or non-responding). (<bold>B</bold>) Maximum change in velocity for every density condition is shown. Violin plots show the kernel density estimate (KDE) and quartiles for each condition. Two-dimensional histograms show the frequency of events for given pairs of values for (<bold>C</bold>) deceleration and minimum on-patch velocity and for (<bold>D</bold>) maximum change in velocity and minimum on-patch velocity for all encounters in the paper. Probabilities are represented as a heat map of color. (<bold>E</bold>) The first principal component (PC1) for these three metrics was computed. The distribution of projections of the data onto PC1 is given by a histogram (gray). KDEs were computed using the bandwidth <inline-formula><alternatives><mml:math id="inf5"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:mi>h</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft5">\begin{document}$\hat{h}$\end{document}</tex-math></alternatives></inline-formula> defined by Silverman’s Rule of Thumb (blue) and using the critical bandwidth <inline-formula><alternatives><mml:math id="inf6"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msup><mml:mi>h</mml:mi><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math><tex-math id="inft6">\begin{document}$h^{*}$\end{document}</tex-math></alternatives></inline-formula> (red-orange) at which the KDE is at the threshold between uni- and bi-modal (see Patch encounter classification as sensing or non-responding). (<bold>F</bold>) Critical bandwidth values were computed across 2000 smoothed bootstrap resamples. The distribution of these bootstrapped critical values is given as a histogram and compared against the critical bandwidth of the original data set (red-orange).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-figsupp7-v1.tif"/></fig><fig id="fig2s8" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 8.</label><caption><title>Classifying encounters as sensing or non-responding.</title><p>(<bold>A</bold>) Deceleration upon encounter and minimum on-patch velocity during the encounter are plotted for each encounter. A three-dimensional parabolic boundary between <italic>sensing</italic> and <italic>non-responding</italic> clusters was fit using semi-supervised quadratic discriminant analysis (QDA) and a subset of labeled data (blue circles = sensing, dark orange circles = non-responding). Regions identified by the classifier as <italic>non-responding</italic> or <italic>sensing</italic> are indicated by colored contours (orange = <italic>non-responding</italic>, green = <italic>sensing</italic>). Encounters for all data in the paper are individually plotted as in <xref ref-type="fig" rid="fig2">Figure 2I</xref> but with color representing the conditional probability of clustering classification as <italic>non-responding</italic> (orange) or <italic>sensing</italic> (green). (<bold>B</bold>) Maximum change in velocity and minimum on-patch velocity during the encounter are plotted for each encounter in the paper as in (<bold>A</bold>). (<bold>C</bold>) Minimum velocity on patch, maximum change in velocity, and deceleration are shown for every encounter in the paper. See <xref ref-type="video" rid="video5">Video 5</xref> for three-dimensional rotation of this plot. (<bold>D</bold>) The probabilities for classification as <italic>sensing</italic> (green) or <italic>non-responding</italic> (orange) are sorted for all encounters. (<bold>E</bold>) Probabilities for only the data in <xref ref-type="fig" rid="fig2">Figure 2</xref> are shown. (<bold>F</bold>) For a subset of encounters that were censored (i.e., recording did not observe animals entering the patch), probabilities of <italic>sensing</italic> were estimated using the semi-supervised QDA approach as well as via marginalization over the conditional probabilities using only the observed minimum velocity on patch. Marginalized probabilities were used for these values (see Patch encounter classification as sensing or non-responding).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig2-figsupp8-v1.tif"/></fig></fig-group><p>Previous studies have shown that in diet choice assays where animals are given the option between patches of varying quality or density, animals spend more time on preferred patches (<xref ref-type="bibr" rid="bib79">Scheer and Bargmann, 2023</xref>; <xref ref-type="bibr" rid="bib83">Shtonda and Avery, 2006</xref>; <xref ref-type="bibr" rid="bib51">Madirolas et al., 2023</xref>). We hypothesized that even when all patches in the environment are of equal density, an efficient forager should still modulate the amount of time spent on the bacterial patches in a density-dependent manner. To test this, behavior was recorded and tracked for 1 hr as animals foraged in patchy environments matching one of the bacterial density conditions (<xref ref-type="fig" rid="fig2">Figure 2D</xref>, <xref ref-type="fig" rid="fig2s4">Figure 2—figure supplement 4</xref>). Consistent with our hypothesis, we found that the total time animals spent on bacterial patches increased monotonically with increasing bacterial density following a sigmoidal trend (<xref ref-type="fig" rid="fig2">Figure 2E</xref>). Further, the probability of an animal residing on patch as a function of time was highly dependent on the bacterial density (<xref ref-type="fig" rid="fig2">Figure 2F</xref>, <xref ref-type="fig" rid="fig2s5">Figure 2—figure supplement 5</xref>). At the highest densities (50 and 200), animals spent nearly 100% of time in the assay on bacterial patches, while at the lowest densities (0–0.3), animals spent chance levels of time on patch for the duration of the experiment. At intermediate densities (0.5–10) animals initially resided on patches at rates predicted by chance, later transitioning to more time spent on patch. Notably, this delayed increase in patch residence is density dependent with animals switching earlier in environments with patches of greater density.</p><p>Consistent with our previous observation that animals reside on patches for either short or long durations (<xref ref-type="fig" rid="fig1">Figure 1E</xref>), we observed two distinct patch encounter types: (1) short (less than 2 minute) patch visits and (2) long (often tens of minutes) patch visits (<xref ref-type="fig" rid="fig2">Figure 2G</xref>). We validated the existence of two patch types using Silverman’s test (<xref ref-type="bibr" rid="bib1">Ahmed and Walther, 2012</xref>; <xref ref-type="bibr" rid="bib84">Silverman, 1981</xref>) for bimodality <xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6</xref> and then, using a two-component GMM, classified all encounters based on the duration of these patch visits and animals’ average velocity during the encounter (<xref ref-type="fig" rid="fig2">Figure 2H</xref>, <xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6</xref>). We identified two behaviorally distinct clusters: (1) short-duration and fast velocity (<italic>explore</italic>) and (2) long-duration and slow velocity (<italic>exploit</italic>) encounters. The <italic>explore</italic> encounters suggest that an animal has <italic>rejected</italic> a patch, opting to continue exploration of the environment. In contrast, the <italic>exploit</italic> encounters suggest that an animal has <italic>accepted</italic> a patch and is consuming the bacteria within.</p><p>While we previously found that animals consistently slowed down upon encounter with the patch edge when foraging in relative density ~10 (<xref ref-type="fig" rid="fig1">Figure 1J–M</xref>), we observed that a large portion of short-duration, exploratory encounters were not accompanied by this slow down (<xref ref-type="fig" rid="fig2s7">Figure 2—figure supplement 7A, B</xref>), especially for the lowest bacterial densities tested. Therefore, to determine which exploratory encounters displayed evidence that the patch was detected by the animal, we further classified encounters by an animal’s minimum velocity on patch, deceleration upon patch entry, and maximum change in the animal’s velocity upon encounter (i.e., the difference between the peak velocity immediately before the patch encounter and the minimum velocity achieved during the patch encounter) (<xref ref-type="fig" rid="fig2">Figure 2I</xref>, <xref ref-type="fig" rid="fig2s7">Figure 2—figure supplement 7</xref>). We again observed two behaviorally distinct clusters: (1) large slowdown and slow on-patch velocity and (2) small slowdown and fast on-patch velocity. We validated the existence of these two clusters using Silverman’s test (<xref ref-type="bibr" rid="bib1">Ahmed and Walther, 2012</xref>; <xref ref-type="bibr" rid="bib84">Silverman, 1981</xref>) for bimodality (<xref ref-type="fig" rid="fig2s7">Figure 2—figure supplement 7</xref>) and then classified these encounters as <italic>sensing</italic> or <italic>non-responding</italic>, respectively, using a semi-supervised quadratic discriminant analysis (QDA) approach (<xref ref-type="fig" rid="fig2s8">Figure 2—figure supplement 8</xref>, <xref ref-type="video" rid="video5">Video 5</xref>). The presence of a slowdown and the subsequent continuation of slower on-patch velocity suggest that an animal sensed the bacteria, while the absence of a slowdown response suggests that the animal either did not perceive the encounter or chose to ignore it. For simplicity, we define: (1) <italic>non-responding</italic> encounters as <italic>searching</italic> (i.e., on-patch behavior that matches off-patch behavior where an animal appears to be searching for food); (2) <italic>sensing</italic>, short-duration encounters as <italic>sampling</italic> (i.e., evaluating a patch’s suitability as a food source, but ultimately <italic>rejecting</italic> the patch and continuing to explore the environment); and (3) <italic>sensing</italic>, long-duration encounters as <italic>exploiting</italic> (i.e., <italic>accepting</italic> a patch and consuming its bacteria) (<xref ref-type="fig" rid="fig2">Figure 2J</xref>). Consistent with our interpretation of <italic>searching</italic> encounters, the average velocities that animals achieved during <italic>search</italic> on (~200 μm/s) and off (~207 μm/s) patch were similar, especially when compared to markedly slower on-patch velocities during <italic>sample</italic> (~114 μm/s) and <italic>exploit</italic> (~57 μm/s) encounters (<xref ref-type="fig" rid="fig2">Figure 2K</xref>). In summary, we have identified three distinct patch encounter types: encounters lacking a slowdown that were either not detected or ignored (<italic>search</italic>) and encounters that were detected with the animal subsequently deciding to <italic>reject</italic> (<italic>sample</italic>) or <italic>accept</italic> (<italic>exploit</italic>) the patch.</p><media mimetype="video" mime-subtype="mp4" xlink:href="elife-103191-video5.mp4" id="video5"><label>Video 5.</label><caption><title>Classifying encounters as <italic>sensing</italic> based on quantification of slowdown.</title><p>Three metrics quantifying the magnitude of slowdown upon patch encounter were computed. A semi-self-supervised quadratic discriminant analysis was trained on a subset of labeled data and used to classify all encounters as <italic>sensing</italic> (green) or <italic>non-responding</italic> (orange). Data correspond with <xref ref-type="fig" rid="fig2">Figure 2I</xref>, <xref ref-type="fig" rid="fig2s8">Figure 2—figure supplement 8A–C</xref>.</p></caption></media><p>We next characterized how the frequency of encounter types varied as a function of time and patch density. The behavior of 443 animals (20–50 worms per condition) was tracked and classified at each time point (<xref ref-type="fig" rid="fig2">Figure 2L</xref>, <xref ref-type="video" rid="video6">Video 6</xref>). In low-density conditions (0–0.3), animals spent nearly all of their time <italic>searching</italic> on or off patch. With increasing bacterial patch density, animals spent less time <italic>searching</italic> and more time <italic>sampling</italic> and <italic>exploiting</italic>. Animals foraging in medium-density patches (0.5–10) initially spent most of their time <italic>sampling</italic> patches upon encounter. However, animals eventually switched to mostly <italic>exploiting</italic> patches. Animals foraging on high-density patches (50 and 200) almost exclusively <italic>exploited</italic>. Classification of on-patch behavior across all densities tested revealed a consistent switch from <italic>exploratory</italic> behaviors (<italic>searching</italic> and <italic>sampling</italic>) to <italic>exploitation</italic> (<xref ref-type="fig" rid="fig2">Figure 2M</xref>) with the timing of the switch occurring earlier for animals foraging in environments with higher bacterial patch density (<xref ref-type="fig" rid="fig2">Figure 2N</xref>). The delay in exploitation corresponded to a comparatively large number of initial exploratory encounters with animals on medium density conditions (0.5–10) <italic>exploiting</italic> after an average of 4.8–18.7 exploratory encounters (<xref ref-type="fig" rid="fig2">Figure 2O</xref>). To summarize, for densities similar to those experienced immediately preceding the experiment (50 and 200), animals immediately <italic>exploit</italic> available bacteria. On the other hand, for bacterial densities that appear to be below an animal’s sensory threshold (0–0.3), animals never <italic>exploit</italic> patches and spend the entire 60-min assay <italic>searching</italic> for food. When foraging in medium-density patches (0.5–10), animals initially explore the environment via a combination of <italic>searching</italic> and <italic>sampling</italic> encounters and eventually switch to <italic>exploiting</italic>. Notably, the timing of this switch is density dependent with animals switching earlier when foraging on higher-density patches.</p><media mimetype="video" mime-subtype="mp4" xlink:href="elife-103191-video6.mp4" id="video6"><label>Video 6.</label><caption><title>Foraging behavior of an animal with encounters labeled as <italic>search</italic>, <italic>sample</italic>, or <italic>exploit</italic>.</title><p>The midbody location of the animal in <xref ref-type="video" rid="video3">Video 3</xref> is shown and labeled by the probability of classification as <italic>searching</italic> (i.e., off-patch <italic>exploration</italic> and patch encounters lacking a slowdown response), <italic>sampling</italic> (i.e., patch encounters that were <italic>sensed</italic>, but not <italic>exploited</italic>), and <italic>exploiting</italic> at every time point. The animal shown corresponds to the example animal observed in <xref ref-type="fig" rid="fig1">Figure 1A, B, H–K</xref>.</p></caption></media></sec><sec id="s2-3"><title>Animals explore before exploiting even when only one patch is available</title><p>Given that bacterial patches within an environment were relatively invariable and that bacterial growth during the experiment was negligible (<xref ref-type="fig" rid="fig2s3">Figure 2—figure supplement 3</xref>), it was surprising that animals were often willing to <italic>reject</italic> 10+ patches before <italic>exploiting</italic> a patch of the same density as those previously <italic>rejected</italic> (<xref ref-type="fig" rid="fig2">Figure 2O</xref>). This <italic>sampling</italic> behavior may be beneficial when food is patchily distributed in the environment, as exploiting a dilute patch may result in a lost opportunity for future encounter with a higher quality patch. Thus, we hypothesized that an animal’s willingness to <italic>accept</italic> a patch whose density matched that of a previously <italic>rejected</italic> patch could be a specific feature of a patchily distributed environment where numerous observations of individual patches could contribute to learning the features of a changing environment. To investigate this, we observed whether animals were willing to <italic>reject</italic> a patch numerous times before <italic>accepting</italic> it even when only one patch is available in the environment. We created environments with single large (~8.3 mm) or small (~1.8 mm) diameter patches with relative density ranging from 0 to ~400 (<xref ref-type="fig" rid="fig3">Figure 3A–C</xref>). Behavior was tracked for 60 min as animals foraged in these environments (<xref ref-type="fig" rid="fig3">Figure 3D, E</xref>, <xref ref-type="fig" rid="fig3s1">Figure 3—figure supplements 1</xref> and <xref ref-type="fig" rid="fig3s2">2</xref>). We found that even in these single patch environments, animals initially <italic>explore</italic> (<italic>search</italic> and <italic>sample</italic>) before <italic>exploiting</italic> (<xref ref-type="fig" rid="fig3">Figure 3F, G</xref>) in a density-dependent manner. Just as when foraging in a patchily distributed environment (<xref ref-type="fig" rid="fig2">Figure 2N</xref>), animals <italic>explored</italic> (<italic>search</italic> and <italic>sample</italic>) the small and large single patches numerous times prior to <italic>exploiting</italic>, with the timing of this switch occurring significantly earlier with increasing bacterial density (<xref ref-type="fig" rid="fig3">Figure 3H, I</xref>). These results suggest that the explore-then-exploit strategy employed by <italic>C. elegans</italic> is not specific to a patchily distributed environment. Rather, animals may <italic>sample</italic> the same patch numerous times before deciding to <italic>exploit</italic>, especially when foraging on dilute patches. The decision of when to stop <italic>exploring</italic> and start <italic>exploiting</italic> is highly dependent upon the density of bacteria within a patch, with the switch occurring earlier when animals encounter patches of higher density.</p><fig-group><fig id="fig3" position="float"><label>Figure 3.</label><caption><title><italic>C</italic>. <italic>elegans</italic> explore first even when only one patch is available.</title><p>(<bold>A</bold>) Relative density of large (~8.3 mm diameter) and (<bold>B</bold>) small (~1.8 mm diameter) bacterial patches was varied by pipetting 20 and 0.5 µl, respectively, droplets of OP50 <italic>E. coli</italic> diluted in lysogeny broth (LB) to a range of optical densities OD<sub>600</sub> = {0, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 10} and controlling growth time at room temperature (hours = {1, 48}). (<bold>C</bold>) Large patches were formed in the center of 30-mm arenas while small patches were formed in the center of 9-mm arenas. The midbody location (colored to represent time in the experiment) of example animals foraging in environments containing a single (<bold>D</bold>) large or (<bold>E</bold>) small patch (gray) is shown. Ethograms of patch encounters (colored to represent the probability of classification as <italic>search</italic>, <italic>sample</italic>, and <italic>exploit</italic>) for (<bold>F</bold>) 144 individuals (8–15 per condition) foraging on a single large patch and (<bold>G</bold>) 191 individuals (27–38 per condition) foraging on a single small patch are shown. Time elapsed prior to the first <italic>exploitation</italic> event (blue) for animals foraging on (<bold>H</bold>) large and (<bold>I</bold>) small patches is plotted for every animal. When <italic>exploitation</italic> was not observed, time elapsed in the experiment is plotted (red-orange). Animals in large and small patch environments <italic>exploited</italic> higher-density patches significantly earlier (Kendall’s <italic>τ</italic> correlation, p &lt; 0.001) following a sigmoidal trend. See also <xref ref-type="fig" rid="fig3s1">Figure 3—figure supplements 1</xref> and <xref ref-type="fig" rid="fig3s2">2</xref>.</p><p><supplementary-material id="fig3sdata1"><label>Figure 3—source data 1.</label><caption><title>Relative density of large (20 μl) bacterial patches in <xref ref-type="fig" rid="fig3">Figure 3A</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig3-data1-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig3sdata2"><label>Figure 3—source data 2.</label><caption><title>Relative density of small (0.5 μl) bacterial patches in <xref ref-type="fig" rid="fig3">Figure 3B</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig3-data2-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig3sdata3"><label>Figure 3—source data 3.</label><caption><title>Encounter classification as explore or exploit and sense or no response in <xref ref-type="fig" rid="fig3">Figure 3F</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig3-data3-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig3sdata4"><label>Figure 3—source data 4.</label><caption><title>Encounter classification as explore or exploit and sense or no response in <xref ref-type="fig" rid="fig3">Figure 3G</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig3-data4-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig3sdata5"><label>Figure 3—source data 5.</label><caption><title>Time before first exploitation in <xref ref-type="fig" rid="fig3">Figure 3H</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig3-data5-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig3sdata6"><label>Figure 3—source data 6.</label><caption><title>Time before first exploitation in <xref ref-type="fig" rid="fig3">Figure 3I</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig3-data6-v1.xlsx"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig3-v1.tif"/></fig><fig id="fig3s1" position="float" specific-use="child-fig"><label>Figure 3—figure supplement 1.</label><caption><title>Example traces of animals foraging in environments with one large bacterial patch.</title><p>Example traces showing the midbody location of 11 animals as they forage within a 30-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). The location of bacterial patches is indicated in gray. The relative density of bacterial patches in each environment is noted. The animal shown foraging on relative density 10 is the same as that in <xref ref-type="fig" rid="fig3">Figure 3D</xref>.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig3-figsupp1-v1.tif"/></fig><fig id="fig3s2" position="float" specific-use="child-fig"><label>Figure 3—figure supplement 2.</label><caption><title>Example traces of animals foraging in environments with one small bacterial patch.</title><p>Example traces showing the midbody location of six animals as they forage within a 9-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). The location of bacterial patches is indicated in gray. The relative density of bacterial patches in each environment is noted. The animal shown foraging on relative density 10 is the same as that in <xref ref-type="fig" rid="fig2">Figure 2E</xref>.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig3-figsupp2-v1.tif"/></fig></fig-group></sec><sec id="s2-4"><title>External and internal sensory information guide the decision to explore or exploit</title><p>While our behavioral analysis demonstrated that <italic>C. elegans</italic> modulate their decision to <italic>explore</italic> or <italic>exploit</italic> in a density-dependent manner, it remains unclear whether these animals use more complex cognitive processes such as learning and memory to guide their foraging decision. It is plausible that animals are making decisions using simple heuristics given only available sensory information about the current patch. However, previous studies have shown that food-related behaviors in <italic>C. elegans</italic> can be driven by internal states (<xref ref-type="bibr" rid="bib79">Scheer and Bargmann, 2023</xref>) as well as memories of the environment (<xref ref-type="bibr" rid="bib12">Calhoun et al., 2015</xref>; <xref ref-type="bibr" rid="bib83">Shtonda and Avery, 2006</xref>; <xref ref-type="bibr" rid="bib66">Pradhan et al., 2019</xref>). Thus, to better understand the factors driving the exploitation decision, we implemented a generalized linear model (GLM) to test how foraging decisions are influenced by the density of the current patch as well as additional food-related factors such as an animal’s level of satiety and prior experience (<xref ref-type="fig" rid="fig4">Figure 4A</xref>).</p><fig-group><fig id="fig4" position="float"><label>Figure 4.</label><caption><title>Exploitation decisions are driven by available sensory information, satiety, and prior experience.</title><p>(<bold>A</bold>) Schematic of the covariates <inline-formula><alternatives><mml:math id="inf7"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft7">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> used in our logistic regression model to predict the probability of <italic>exploiting</italic> a patch upon any given encounter <inline-formula><alternatives><mml:math id="inf8"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft8">\begin{document}$p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula>. <inline-formula><alternatives><mml:math id="inf9"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft9">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> includes the relative density of the encountered patch <inline-formula><alternatives><mml:math id="inf10"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>k</mml:mi><mml:mtext> </mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>ρ</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math><tex-math id="inft10">\begin{document}$k\ (\rho _{k})$\end{document}</tex-math></alternatives></inline-formula>, the duration of time spent off food since departing the last <italic>exploited</italic> patch (<inline-formula><alternatives><mml:math id="inf11"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft11">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>), the relative density of the patch encountered immediately before encounter <inline-formula><alternatives><mml:math id="inf12"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>k</mml:mi><mml:mtext> </mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>ρ</mml:mi><mml:mi>k</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mstyle></mml:math><tex-math id="inft12">\begin{document}$k\ (\rho_k)$\end{document}</tex-math></alternatives></inline-formula>, and the relative density of the last <italic>exploited</italic> patch (<inline-formula><alternatives><mml:math id="inf13"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft13">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>). (<bold>B</bold>) To account for uncertainty in our classification of sensation, we produced 100 sets of observations wherein we probabilistically included <italic>sensed</italic> encounters (<inline-formula><alternatives><mml:math id="inf14"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft14">\begin{document}$v_{k}=1$\end{document}</tex-math></alternatives></inline-formula>) estimated from the distribution <inline-formula><alternatives><mml:math id="inf15"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft15">\begin{document}$v_{k}|\boldsymbol{w}_{k}\sim \text{Bern}\left (p\left (v_{k}=1|\boldsymbol{w}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> where <inline-formula><alternatives><mml:math id="inf16"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft16">\begin{document}$p\left (v_{k}=1|\boldsymbol{w}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> is the probability that the patch was <italic>sensed</italic> as estimated in <xref ref-type="fig" rid="fig2">Figure 2I</xref>. To account for uncertainty in our classification of <italic>exploitation</italic>, we substitute the response variable <inline-formula><alternatives><mml:math id="inf17"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft17">\begin{document}$y_{k}$\end{document}</tex-math></alternatives></inline-formula> with our estimate of the probability that the patch was <italic>exploited</italic> <inline-formula><alternatives><mml:math id="inf18"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft18">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> as estimated in <xref ref-type="fig" rid="fig2">Figure 2H</xref>, a procedure analogous to including <italic>exploitations</italic> (<inline-formula><alternatives><mml:math id="inf19"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow></mml:mstyle></mml:math><tex-math id="inft19">\begin{document}$y_{k}=1$\end{document}</tex-math></alternatives></inline-formula>) estimated from the distribution <inline-formula><alternatives><mml:math id="inf20"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft20">\begin{document}$y_{k}|\boldsymbol{z}_{k}\sim \text{Bern}\left (p\left (y_{k}=1|\boldsymbol{z}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula>. A schematic of these procedures is shown (see Models of exploitation probability). (<bold>C</bold>) Coefficient values for each covariate in the GLM were estimated across 50,000 replicates (500 replicates of hierarchically bootstrapped animals in combination with 100 sets of probabilistically <italic>sensed</italic> encounters). All coefficients are significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction). (<bold>D</bold>) Using observed <inline-formula><alternatives><mml:math id="inf21"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft21">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> and estimated <inline-formula><alternatives><mml:math id="inf22"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft22">\begin{document}$p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> probabilities of <italic>exploitation</italic>, <italic>exploitation</italic> events were simulated from a Bernoulli distribution. Distributions of the probability of first <italic>exploiting</italic> as a function of the number of encounters as estimated by the model with covariates added one-by-one and as observed are shown for animals foraging in single-density, multi-patch environments of relative density 1 or 10. (<bold>E</bold>) A schematic of multi-density, multi-patch assays where animals foraged in environments containing small (~1.8 mm diameter) bacterial patches (gray) of varying combinations of OP50 <italic>E. coli</italic> with relative densities 1, 4, and 7 are shown. (<bold>F</bold>) The probability of exploitation as estimated with (<inline-formula><alternatives><mml:math id="inf23"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft23">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}\right)$\end{document}</tex-math></alternatives></inline-formula>) and without (<inline-formula><alternatives><mml:math id="inf24"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft24">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}\right)$\end{document}</tex-math></alternatives></inline-formula>) the history-dependent terms and as observed <inline-formula><alternatives><mml:math id="inf25"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft25">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> is shown for every pairing of current patch density (<inline-formula><alternatives><mml:math id="inf26"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft26">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>) combined with the density of recently encountered (<inline-formula><alternatives><mml:math id="inf27"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft27">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula>) or <italic>exploited</italic> (<inline-formula><alternatives><mml:math id="inf28"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft28">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>) patches. Heat maps for observed values were interpolated between the nine patch density pairings tested. (<bold>G</bold>) <italic>Exploitation</italic> events were simulated from the distribution <inline-formula><alternatives><mml:math id="inf29"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mrow><mml:mi mathvariant="normal">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">r</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">n</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft29">\begin{document}$y_{k}|\boldsymbol{z}_{k} \sim \mathrm{B}\mathrm{e}\mathrm{r}\mathrm{n}\left (p\left (y_{k}=1|\boldsymbol{z}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> and used to calculate the probability of observing <italic>exploitation</italic> for the first time as a function of the number of encounters for N2, <italic>mec-4</italic>, and <italic>osm-6</italic> animals foraging in single-density, multi-patch environments of relative density 1 or 10. (<bold>H</bold>) Coefficient values for each covariate were estimated using ridge regression models for each strain across 50,000 replicates. A subset of these coefficients significantly varied between wild-type and mutant strains (mean of differences tests with Benjamini–Hochberg correction). Summary data for all animals (<italic>N</italic> = 443 total worms; <italic>N</italic> = 20–50 worms per condition) and encounters (<italic>μ</italic> = 2659.8, <italic>σ</italic> = 15.9) in the single-density, multi-patch assay are shown in (<bold>C</bold>, <bold>D</bold>). Summary data for all animals (<italic>N</italic> = 198 total worms; <italic>N</italic> = 20–40 worms per condition) and <italic>sensed</italic> encounters (<italic>μ</italic> = 1724.6, <italic>σ</italic> = 9.9) in the multi-density, multi-patch assay are shown in (<bold>F</bold>). Summary data for all wild-type and mutant animals (<italic>N</italic> = 221 total worms; <italic>N</italic> = 14–44 worms per condition) and encounters (<italic>N</italic> = 1352 total encounters) in a single-density, multi-patch assay are shown in (<bold>G</bold>,<bold> H</bold>). Violin plots in (<bold>C</bold>, <bold>H</bold>) show the kernel density estimate (KDE) and quartiles for each measure. Asterisks denote statistical significance (<sup>†</sup>p<sub>unadjusted</sub> &lt; 0.05; *p &lt; 0.05; **p &lt; 0.01; ***p &lt; 0.001). See also <xref ref-type="fig" rid="fig4s1">Figure 4—figure supplements 1</xref>–<xref ref-type="fig" rid="fig4s5">5</xref>.</p><p><supplementary-material id="fig4sdata1"><label>Figure 4—source data 1.</label><caption><title>Coefficients of linear regression model in <xref ref-type="fig" rid="fig4">Figure 4C</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig4-data1-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig4sdata2"><label>Figure 4—source data 2.</label><caption><title>Probability of exploitation occurring for the first time as a function of the number of encounters in <xref ref-type="fig" rid="fig4">Figure 4D</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig4-data2-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig4sdata3"><label>Figure 4—source data 3.</label><caption><title>Observed and predicted (with and without history dependence) posterior probabilities of exploitation in <xref ref-type="fig" rid="fig4">Figure 4F</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig4-data3-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig4sdata4"><label>Figure 4—source data 4.</label><caption><title>Probability of exploitation occurring for the first time as a function of the number of encounters for animals with sensory mutations in <xref ref-type="fig" rid="fig4">Figure 4G</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig4-data4-v1.xlsx"/></supplementary-material></p><p><supplementary-material id="fig4sdata5"><label>Figure 4—source data 5.</label><caption><title>Coefficients of linear regression model in <xref ref-type="fig" rid="fig4">Figure 4H</xref>.</title></caption><media mimetype="application" mime-subtype="xlsx" xlink:href="elife-103191-fig4-data5-v1.xlsx"/></supplementary-material></p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig4-v1.tif"/></fig><fig id="fig4s1" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 1.</label><caption><title>Model selection for nested GLMs.</title><p>(<bold>A</bold>) Values of log-likelihood, Aikake information criterion (AIC), and Bayesian information criterion (BIC) were computed for 50,000 replicates of the linear regression model described in Models of exploitation probability. The replicate-by-replicate difference in value of these metrics between the full model (i.e., <inline-formula><alternatives><mml:math id="inf30"><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft30">\begin{document}$\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}=\beta _{0}+\beta _{k}\mathrm{\rho }_{k}+\beta _{s}\mathrm{\tau }_{s}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>) and every combination of covariate subsets is plotted here. Log-likelihood values less than zero and AIC or BIC values greater than zero indicate worse model performance of the partial term models as compared to the full model. Percentages indicate the proportion of replicates where the model performed best according to that criterion. Even using BIC, the strictest model criterion, the full model performs better than any other model on the majority of replicates. (<bold>B</bold>) To illustrate the replicate-by-replicate variance, log-likelihood, AIC, and BIC are plotted across all 100 replicates of ‘encounter samples’ (i.e., we removed encounters where the animal likely did not <italic>sense</italic> the encounter <inline-formula><alternatives><mml:math id="inf31"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math><tex-math id="inft31">\begin{document}$v_{k}=0$\end{document}</tex-math></alternatives></inline-formula> as estimated from the distribution <inline-formula><alternatives><mml:math id="inf32"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mo> </mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft32">\begin{document}$v_{k}|\boldsymbol{w}_{k}\sim \text{Bern}\left (p\left (v_{k}=1|\boldsymbol{w}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula>) and 500 replicates of hierarchically bootstrapped ‘worm samples’ (i.e., we resampled animals with replacement and included all encounters of the resampled animals). Values for each metric at each replicate are colored to match their respective color bar. Metrics are shown for this subset of models to illustrate the addition of each covariate to the model. Lower AIC and BIC values for the full model (i.e., <inline-formula><alternatives><mml:math id="inf33"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>ρ</mml:mi><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>ρ</mml:mi><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft33">\begin{document}$\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}=\beta _{0}+\beta _{k}\mathrm{\rho }_{k}+\beta _{s}\mathrm{\tau }_{s}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>) represent better model performance even with penalization for increasing the number of parameters. (<bold>C</bold>) Coefficients <inline-formula><alternatives><mml:math id="inf34"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mo mathvariant="bold">∗</mml:mo></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math><tex-math id="inft34">\begin{document}$\boldsymbol{\beta }^{\boldsymbol{*}}$\end{document}</tex-math></alternatives></inline-formula> for the null distribution (i.e., observations of the response variable <inline-formula><alternatives><mml:math id="inf35"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft35">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> shuffled relative to the covariates <inline-formula><alternatives><mml:math id="inf36"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft36">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula>) are plotted. Only <inline-formula><alternatives><mml:math id="inf37"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math><tex-math id="inft37">\begin{document}$\beta _{0}$\end{document}</tex-math></alternatives></inline-formula> was significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction). These <inline-formula><alternatives><mml:math id="inf38"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mrow><mml:mo mathvariant="bold">∗</mml:mo></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math><tex-math id="inft38">\begin{document}$\boldsymbol{\beta }^{\boldsymbol{*}}$\end{document}</tex-math></alternatives></inline-formula> represent the null distribution for the <inline-formula><alternatives><mml:math id="inf39"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi></mml:mrow></mml:mstyle></mml:math><tex-math id="inft39">\begin{document}$\boldsymbol{\beta }$\end{document}</tex-math></alternatives></inline-formula> in <xref ref-type="fig" rid="fig4">Figure 4C</xref>. Violin plots in (<bold>A</bold>, <bold>C</bold>) show the kernel density estimate (KDE) and quartiles for each covariate across the 50,000 replicates. Asterisks denote statistical significance (***p &lt; 0.001).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig4-figsupp1-v1.tif"/></fig><fig id="fig4s2" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 2.</label><caption><title>Probability of first exploitation as a function of the number of encounters.</title><p>Histograms of the probability of first <italic>exploiting</italic> as a function of the number of encounters as estimated by the models and as observed are shown for animals foraging in single-density, multi-patch environments of all 12 density conditions. <italic>Exploitation</italic> events were simulated from a Bernoulli distribution with probability estimated by the model <inline-formula><alternatives><mml:math id="inf40"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mrow><mml:mi mathvariant="normal">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">r</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">n</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft40">\begin{document}$y_{k} |\boldsymbol{x}_{k}\sim \mathrm{B}\mathrm{e}\mathrm{r}\mathrm{n}\left (p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> where covariates were added one at a time as well as from the observed probabilities estimated by the Gaussian mixture model classification <inline-formula><alternatives><mml:math id="inf41"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mrow><mml:mi mathvariant="normal">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">r</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">n</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft41">\begin{document}$y_{k}|\boldsymbol{z}_{k} \sim \mathrm{B}\mathrm{e}\mathrm{r}\mathrm{n}\left (p\left (y_{k}=1|\boldsymbol{z}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> in <xref ref-type="fig" rid="fig2">Figure 2H</xref>. Histograms for relative densities 1 and 10 are the same as those in <xref ref-type="fig" rid="fig4">Figure 4D</xref>.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig4-figsupp2-v1.tif"/></fig><fig id="fig4s3" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 3.</label><caption><title>Exploitation decision of food-deprived animals is well predicted by the model.</title><p>(<bold>A</bold>) Schematic of experiments used to test satiety’s influence on the decision to <italic>exploit</italic>. As in all experiments, animals were acclimated to high-density (relative density ~200) patches for ~24 hr. Well-fed animals were then removed from these acclimation plates, cleaned of bacteria, and then immediately transferred to the assay plate with relative density 5. Food-deprived animals moved about a bacteria-free arena for 3 hr prior to the assay. Examples of animal behavior while foraging in acclimation-like, bacteria-free, and single-density, multi-patch environments of relative density 5 are shown. (<bold>B</bold>) Patch encounters for 28 food-deprived and 28 well-fed individuals are plotted across time. Each encounter is colored to match its probability of classification as <italic>search</italic> (orange), <italic>sample</italic> (green), and <italic>exploit</italic> (blue). (<bold>C</bold>) Coefficient values were re-estimated across 50,000 replicates as in <xref ref-type="fig" rid="fig4">Figure 4C</xref> for a model with the satiety term removed (i.e., <inline-formula><alternatives><mml:math id="inf42"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft42">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}\right)$\end{document}</tex-math></alternatives></inline-formula>). All coefficients are significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction; ***p &lt; 0.001). Violin plots show the kernel density estimate (KDE) and quartiles for each measure. (<bold>D</bold>) Histograms of the probability of first <italic>exploiting</italic> as a function of the number of encounters are shown for food-deprived and well-fed animals. Model predictions of <italic>exploitation</italic> events were simulated from a Bernoulli distribution <inline-formula><alternatives><mml:math id="inf43"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mrow><mml:mi mathvariant="normal">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">r</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">n</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft43">\begin{document}$y_{k}|\boldsymbol{x}_{k} \sim \mathrm{B}\mathrm{e}\mathrm{r}\mathrm{n}\left (p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> where the coefficient values <italic>β</italic> corresponded to those previously estimated for our linear regression model with (<xref ref-type="fig" rid="fig4">Figure 4C</xref>) and without (<xref ref-type="fig" rid="fig4s3">Figure 4—figure supplement 3C</xref>) the satiety term using the data set shown in <xref ref-type="fig" rid="fig2">Figure 2</xref> (i.e., the 443 well-fed animals foraging in one of 12 density conditions). Observed <italic>exploitations</italic> were simulated from a Bernoulli distribution using the probability of <italic>exploitation</italic> estimated by our Gaussian mixture model (GMM) classifier <inline-formula><alternatives><mml:math id="inf44"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mrow><mml:mi mathvariant="normal">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">r</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">n</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft44">\begin{document}$y_{k}|\boldsymbol{z}_{k} \sim \mathrm{B}\mathrm{e}\mathrm{r}\mathrm{n}\left (p\left (y_{k}=1|\boldsymbol{z}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> in <xref ref-type="fig" rid="fig2">Figure 2H</xref>. Summary data for all animals (<italic>N</italic> = 56 total worms; <italic>N</italic> = 28 worms per condition) and encounters (<italic>N</italic> = 277 total encounters; <italic>N</italic> = 42–235 encounters per condition) are shown in (<bold>B</bold>, <bold>D</bold>).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig4-figsupp3-v1.tif"/></fig><fig id="fig4s4" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 4.</label><caption><title>Example traces and classified behavior of animals foraging in environments with multiple patch densities.</title><p>(<bold>A</bold>) Example traces showing the midbody location of seven animals as they forage within a 30-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). Locations of bacterial patches are indicated in gray with saturation indicating the relative density. Environments contained combinations of patches with relative density 1, 4, and 7 as noted. (<bold>B</bold>) Patch encounters for 200 individuals (20–40 per condition) are plotted across time. Each encounter is colored to match its relative density. (<bold>C</bold>) Patch encounters are colored to match their probability of classification as <italic>search</italic> (orange), <italic>sample</italic> (green), and <italic>exploit</italic> (blue). (<bold>D</bold>) Coefficient values were estimated across 50,000 replicates for the multiple density data set for models containing only the satiety-related covariate (i.e., <inline-formula><alternatives><mml:math id="inf45"><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft45">\begin{document}$\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}=\beta _{0}+\beta _{k}\mathrm{\rho }_{k}+\beta _{s}\mathrm{\tau }_{s}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>), only the transfer-related covariate (i.e., <inline-formula><alternatives><mml:math id="inf46"><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">τ</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft46">\begin{document}$\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}=\beta _{0}+\beta _{k}\mathrm{\rho }_{k}+\beta _{t}\mathrm{\tau }_{t}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>), and for both the satiety and transfer covariates (i.e., <inline-formula><alternatives><mml:math id="inf47"><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">τ</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft47">\begin{document}$\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}=\beta _{0}+\beta _{k}\mathrm{\rho }_{k}+\beta _{s}\mathrm{\tau }_{s}+\beta _{t}\mathrm{\tau }_{t}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>). All coefficients are significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction) with the exception of <inline-formula><alternatives><mml:math id="inf48"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft48">\begin{document}$\beta _{t}$\end{document}</tex-math></alternatives></inline-formula> in the satiety and transfer model. (<bold>E</bold>) Coefficient values were re-estimated across 50,000 replicates for the original single-density data set as in <xref ref-type="fig" rid="fig4">Figure 4C</xref> for a model with the history-dependent terms removed (i.e., <inline-formula><alternatives><mml:math id="inf49"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft49">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}\right)$\end{document}</tex-math></alternatives></inline-formula>). All coefficients are significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction). Violin plots show the kernel density estimate (KDE) and quartiles for each measure. Summary data for all animals (<italic>N</italic> = 198 total worms; <italic>N</italic> = 20–40 worms per condition) and encounters (<italic>N</italic> = 3493 total encounters; <italic>N</italic> = 282–795 encounters per condition) are shown in (<bold>B</bold>, <bold>C</bold>). Asterisks denote statistical significance (*p&lt;0.05; **p &lt; 0.01; ***p &lt; 0.001).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig4-figsupp4-v1.tif"/></fig><fig id="fig4s5" position="float" specific-use="child-fig"><label>Figure 4—figure supplement 5.</label><caption><title>Example traces and classified behavior of animals with chemosensory or mechanosensory deficiencies.</title><p>(<bold>A</bold>) Example traces showing the midbody location of nine animals as they forage within a 30-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). The location of bacterial patches is indicated in gray. The relative density of bacterial patches in each environment is noted. Three strains of <italic>C. elegans</italic> were tested (gray = N2, pink = <italic>mec-4</italic>, orange = <italic>osm-6</italic>) across three conditions of relative density (1, 5, and 10). (<bold>B</bold>) Patch encounters for 76 individuals (16–44 per density condition) of each strain are plotted across time. Each encounter is colored to match its probability of classification as <italic>search</italic> (orange), <italic>sample</italic> (green), and <italic>exploit</italic> (blue). (<bold>C</bold>). Histograms of the probability of first <italic>exploiting</italic> as a function of the number of encounters are shown for each strain and density condition. Observed <italic>exploitations</italic> were simulated from a Bernoulli distribution using the posterior probability of <italic>exploitation</italic> defined by our Gaussian mixture model (GMM) classifier <inline-formula><alternatives><mml:math id="inf50"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mi>B</mml:mi><mml:mi>e</mml:mi><mml:mi>r</mml:mi><mml:mi>n</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft50">\begin{document}$y_{k}|\boldsymbol{z}_{k} \sim Bern\left (p\left (y_{k}=1|\boldsymbol{z}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> in <xref ref-type="fig" rid="fig2">Figure 2H</xref>. Histograms of each strain for relative density conditions 1 and 10 are the same as those in <xref ref-type="fig" rid="fig4">Figure 4G</xref>. (<bold>D</bold>) Coefficients <inline-formula><alternatives><mml:math id="inf51"><mml:msup><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="bold-italic">*</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="inft51">\begin{document}$\boldsymbol{\beta }^{\boldsymbol{*}}$\end{document}</tex-math></alternatives></inline-formula> for the null distribution (i.e., observations of the response variable <inline-formula><alternatives><mml:math id="inf52"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft52">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> were shuffled relative to the covariates <inline-formula><alternatives><mml:math id="inf53"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft53">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula>) are plotted. Violin plots show the kernel density estimate (KDE) and quartiles for each covariate across the 50,000 replicates. These <inline-formula><alternatives><mml:math id="inf54"><mml:msup><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="bold-italic">*</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="inft54">\begin{document}$\boldsymbol{\beta }^{\boldsymbol{*}}$\end{document}</tex-math></alternatives></inline-formula> represent the null distribution for the <inline-formula><alternatives><mml:math id="inf55"><mml:mi mathvariant="bold-italic">β</mml:mi></mml:math><tex-math id="inft55">\begin{document}$\boldsymbol{\beta }$\end{document}</tex-math></alternatives></inline-formula> in <xref ref-type="fig" rid="fig4">Figure 4H</xref>. (<bold>E</bold>) The ridge regression parameter <inline-formula><alternatives><mml:math id="inf56"><mml:mi>λ</mml:mi></mml:math><tex-math id="inft56">\begin{document}$\lambda $\end{document}</tex-math></alternatives></inline-formula> was optimized for each strain to maximize the mean log-likelihood of the model. Summary data for all animals (<italic>N</italic> = 221 total worms; <italic>N</italic> = 14–44 worms per condition) and encounters (<italic>N</italic> = 1352 total encounters; <italic>N</italic> = 27–193 encounters per condition) are shown in (<bold>B</bold>, <bold>C</bold>).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-103191-fig4-figsupp5-v1.tif"/></fig></fig-group><p>We considered that the probability of exploiting a patch upon any given encounter can be described by a logistic function:<disp-formula id="equ1"><alternatives><mml:math id="m1"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mtext> </mml:mtext><mml:mo>=</mml:mo><mml:mtext> </mml:mtext><mml:mfrac><mml:mn>1</mml:mn><mml:mrow><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:mfrac><mml:mo>,</mml:mo></mml:mrow></mml:mstyle></mml:math><tex-math id="t1">\begin{document}$$\displaystyle p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\ =\ \frac{1}{1 + e^{-\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}}},$$\end{document}</tex-math></alternatives></disp-formula></p><p>where <inline-formula><alternatives><mml:math id="inf57"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft57">\begin{document}$p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> represents the conditional probability that an animal exploited during patch encounter <inline-formula><alternatives><mml:math id="inf58"><mml:mi>k</mml:mi></mml:math><tex-math id="inft58">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula>; <inline-formula><alternatives><mml:math id="inf59"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∈</mml:mo><mml:msup><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="inft59">\begin{document}$\boldsymbol{x}_{k}\in R^{n}$\end{document}</tex-math></alternatives></inline-formula> is a vector of covariates; and <inline-formula><alternatives><mml:math id="inf60"><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>∈</mml:mo><mml:msup><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="inft60">\begin{document}$\boldsymbol{\beta }\in R^{n}$\end{document}</tex-math></alternatives></inline-formula> is a vector of weights that describes how much each covariate influences the animal’s choice. In models compared here, <inline-formula><alternatives><mml:math id="inf61"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft61">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> includes a combination of a constant element and covariates that may empirically influence the decision to <italic>exploit</italic>. We considered the simplest model where every encounter is independent with fixed probability of <italic>exploiting</italic> (i.e., <inline-formula><alternatives><mml:math id="inf62"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft62">\begin{document}$p\left (y_{k}=1|\beta _{0}\right)$\end{document}</tex-math></alternatives></inline-formula>) where <inline-formula><alternatives><mml:math id="inf63"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math><tex-math id="inft63">\begin{document}$\beta _{0}$\end{document}</tex-math></alternatives></inline-formula> represents the average animal’s propensity to <italic>exploit</italic>. We compared this null model against a set of nested models containing covariates that vary from encounter to encounter and relate to: (1) the relative density of the encountered patch <inline-formula><alternatives><mml:math id="inf64"><mml:mi>k</mml:mi></mml:math><tex-math id="inft64">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula> (<inline-formula><alternatives><mml:math id="inf65"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft65">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>), (2) the duration of time spent off food since departing the last <italic>exploited</italic> patch (<inline-formula><alternatives><mml:math id="inf66"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft66">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>), (3) the relative density of the patch encountered immediately before encounter <inline-formula><alternatives><mml:math id="inf67"><mml:mi>k</mml:mi></mml:math><tex-math id="inft67">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula> (<inline-formula><alternatives><mml:math id="inf68"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft68">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula>), and (4) the relative density of the last <italic>exploited</italic> patch (<inline-formula><alternatives><mml:math id="inf69"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft69">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>). Using this model design (i.e., <inline-formula><alternatives><mml:math id="inf70"><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi mathvariant="normal">τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft70">\begin{document}$\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}=\beta _{0}+\beta _{k}\mathrm{\rho }_{k}+\beta _{s}\mathrm{\tau }_{s}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>), we assessed how each of these covariates influences the probability of <italic>exploitation</italic> at each patch encounter <inline-formula><alternatives><mml:math id="inf71"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:mstyle></mml:math><tex-math id="inft71">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula> (<xref ref-type="fig" rid="fig4">Figure 4A</xref>).</p><p>Given that our aim is to understand what factors influence an animal’s decision to <italic>explore</italic> or <italic>exploit</italic>, we rationalized that encounters where the animal did not detect the presence of bacteria were unlikely to contribute to decision-making. Therefore, we excluded <italic>searching</italic> encounters from our analysis where animals did <italic>not respond</italic> to the bacterial patch. To account for the uncertainty in our classification of <italic>sensing</italic>, we probabilistically included patch encounters with frequency equal to the probability that the bacterial patch was <italic>sensed</italic> (<xref ref-type="fig" rid="fig4">Figure 4B</xref>) as previously estimated by semi-supervised QDA (<xref ref-type="fig" rid="fig2">Figure 2I</xref>, <xref ref-type="fig" rid="fig2s8">Figure 2—figure supplement 8</xref>). In doing so, we simulated sets of observations of <italic>sensed</italic> (<italic>sample</italic> and <italic>exploit</italic>) encounters. Further, to account for the uncertainty in our classification of patch encounters as <italic>exploration</italic> or <italic>exploitation</italic>, we fit our GLM to the probability of <italic>exploiting</italic> <inline-formula><alternatives><mml:math id="inf72"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft72">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> as previously estimated by GMM (<xref ref-type="fig" rid="fig2">Figure 2H</xref>, <xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6</xref>) rather than fitting to direct observations of exploitation <inline-formula><alternatives><mml:math id="inf73"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft73">\begin{document}$y_{k}$\end{document}</tex-math></alternatives></inline-formula> (see Models of exploitation probability).</p><p>When selecting covariates for our model, we calculated the Bayesian information criterion – a model selection test to avoid overfitting by penalizing increases in the number of parameters – and observed the best model performance when all covariates were included (<xref ref-type="fig" rid="fig4s1">Figure 4—figure supplement 1A–B</xref>). Further, we found that all covariates (i.e., <inline-formula><alternatives><mml:math id="inf74"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft74">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf75"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft75">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf76"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft76">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula>, and <inline-formula><alternatives><mml:math id="inf77"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft77">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>) significantly contribute to the decision to <italic>exploit</italic> <inline-formula><alternatives><mml:math id="inf78"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft78">\begin{document}$p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> as indicated by coefficient values significantly greater than or less than zero (<xref ref-type="fig" rid="fig4">Figure 4C</xref>, <xref ref-type="fig" rid="fig4s1">Figure 4—figure supplement 1</xref>). Specifically, we found that <inline-formula><alternatives><mml:math id="inf79"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft79">\begin{document}$\beta _{k}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf80"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft80">\begin{document}$\beta _{s}$\end{document}</tex-math></alternatives></inline-formula> are significantly greater than zero, which suggests that animals are more likely to <italic>exploit</italic> patches with increasing patch density <inline-formula><alternatives><mml:math id="inf81"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft81">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula> and duration of food deprivation <inline-formula><alternatives><mml:math id="inf82"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft82">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>. On the other hand, <inline-formula><alternatives><mml:math id="inf83"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft83">\begin{document}$\beta _{h}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf84"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft84">\begin{document}$\beta _{e}$\end{document}</tex-math></alternatives></inline-formula> are significantly negative, which suggests that the greater the density of a recently encountered or <italic>exploited</italic> patch, <inline-formula><alternatives><mml:math id="inf85"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft85">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf86"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft86">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>, the less likely an animal should be willing to <italic>exploit</italic> the current patch.</p><p>In order to better understand how each of the covariates in our model affects the <italic>exploitation</italic> decision, we examined the probability of observing <italic>exploitation</italic> for the first time as a function of the cumulative number of patches an animal encountered. Exploitation events were simulated from a Bernoulli distribution with probability estimated by the model (i.e., <inline-formula><alternatives><mml:math id="inf87"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mrow><mml:mi mathvariant="normal">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">r</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">n</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft87">\begin{document}$y_{k}|\boldsymbol{x}_{k} \sim \mathrm{B}\mathrm{e}\mathrm{r}\mathrm{n}\left (p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula>) or observed from our classification of <italic>exploitation</italic> (i.e., <inline-formula><alternatives><mml:math id="inf88"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mrow><mml:mi mathvariant="normal">B</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">e</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">r</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">n</mml:mi></mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft88">\begin{document}$y_{k}|\boldsymbol{z}_{k}\sim \mathrm{B}\mathrm{e}\mathrm{r}\mathrm{n}\left (p\left (y_{k}=1|\boldsymbol{z}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula>). Although the probability of <italic>exploiting</italic> for the first time was not expressly fit by our model, this derived metric highlights the model’s ability to predict the delay in <italic>exploitation</italic> observed for animals foraging on low to medium density bacterial patches in our experiments (<xref ref-type="fig" rid="fig4">Figure 4D</xref>, <xref ref-type="fig" rid="fig4s2">Figure 4—figure supplement 2</xref>). For the simplest model where every encounter is independent with fixed probability of <italic>exploiting</italic> <inline-formula><alternatives><mml:math id="inf89"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft89">\begin{document}$p\left (y_{k}=1|\beta _{0}\right)$\end{document}</tex-math></alternatives></inline-formula>, we find that the probability of <italic>exploiting</italic> for the first time is greatest for the first encounter and decreases for every subsequent encounter (<xref ref-type="fig" rid="fig4">Figure 4D</xref>, <xref ref-type="fig" rid="fig4s2">Figure 4—figure supplement 2</xref>), fitting a geometric distribution.</p><p>We next considered whether the observed delay in <italic>exploitation</italic> could be explained by a simple density-dependent model (i.e., <inline-formula><alternatives><mml:math id="inf90"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft90">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}\right)$\end{document}</tex-math></alternatives></inline-formula>). This model predicts that animals are more likely to <italic>exploit</italic> bacterial patches of greater density with probability proportional to the relative density of the current patch <inline-formula><alternatives><mml:math id="inf91"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft91">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>. While this density-dependent model accurately predicted that the first <italic>exploitation</italic> occurs earlier on average for higher density patches, it also predicted that, regardless of patch density, the first <italic>exploitation</italic> is most frequently observed on the first encounter, which did not match the observed distribution (<xref ref-type="fig" rid="fig4">Figure 4D</xref>, <xref ref-type="fig" rid="fig4s2">Figure 4—figure supplement 2</xref>). We subsequently considered that the onset of food deprivation during <italic>exploration</italic> of these low-density environments could drive the observed time-dependent delay in <italic>exploitation</italic>. We assume that animals become satiated during <italic>exploitation</italic> and use the duration of time an animal spent searching off-food since the last <italic>exploitation</italic> event (i.e., <inline-formula><alternatives><mml:math id="inf92"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft92">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>) as a proxy for the animal’s likely decrease in satiety. With the addition of this satiety-related signal (i.e., <inline-formula><alternatives><mml:math id="inf93"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft93">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}\right)$\end{document}</tex-math></alternatives></inline-formula>), we observed a slight delay in when animals are predicted to first <italic>exploit</italic> for the lowest density conditions tested (<xref ref-type="fig" rid="fig4">Figure 4D</xref>, <xref ref-type="fig" rid="fig4s2">Figure 4—figure supplement 2</xref>). To validate our finding that animals use a satiety-related signal to inform decision-making, we applied our model to observations of animals foraging in patchily distributed environments following 3 hr of food deprivation (<xref ref-type="fig" rid="fig4s3">Figure 4—figure supplement 3A–B</xref>). We found that only with the inclusion of a satiety-related covariate in our model were we able to reliably predict the immediate <italic>exploitation</italic> that food-deprived animals exhibit (<xref ref-type="fig" rid="fig4s3">Figure 4—figure supplement 3C</xref>).</p><p>We next considered the alternative possibility that this time-dependent signal could actually be related to the physical stress induced by the process of moving animals into the experimental arena rather than the onset of food deprivation. While we used an agar plug method to mitigate the stress of moving (see Nematode cultures), we sought to examine the impact of satiety as compared to transfer-induced stress on the <italic>exploitation</italic> decision. We quantified both <inline-formula><alternatives><mml:math id="inf94"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft94">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>, the duration of time an animal spent searching off-food since the last <italic>exploitation</italic> event, and <inline-formula><alternatives><mml:math id="inf95"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft95">\begin{document}$\tau _{t}$\end{document}</tex-math></alternatives></inline-formula>, the duration of time since transfer (i.e., the time elapsed in the experiment). However, as our initial experiments were only 1 hr, we typically observed only one <italic>exploitation</italic> event. Resultantly, <inline-formula><alternatives><mml:math id="inf96"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft96">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf97"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft97">\begin{document}$\tau _{t}$\end{document}</tex-math></alternatives></inline-formula> were highly correlated, and their individual contributions to the model could not be easily parsed. Therefore, we ran additional experiments with animals foraging in environments with multiple patch densities over 2 hr (<xref ref-type="fig" rid="fig4">Figure 4E</xref>, <xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4A–C</xref>), which led to observations containing multiple <italic>exploitation</italic> events and a resultant decorrelation of <inline-formula><alternatives><mml:math id="inf98"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft98">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf99"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft99">\begin{document}$\tau _{t}$\end{document}</tex-math></alternatives></inline-formula>. When the model was re-fit to this 2-hr data set using both <inline-formula><alternatives><mml:math id="inf100"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft100">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf101"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>τ</mml:mi><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft101">\begin{document}$\tau _{t}$\end{document}</tex-math></alternatives></inline-formula> covariates (i.e., <inline-formula><alternatives><mml:math id="inf102"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>ρ</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>τ</mml:mi><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>τ</mml:mi><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>ρ</mml:mi><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>β</mml:mi><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>ρ</mml:mi><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft102">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}+\beta _{t}\tau _{t}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}\right)$\end{document}</tex-math></alternatives></inline-formula>), only the satiety-related covariate <inline-formula><alternatives><mml:math id="inf103"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>τ</mml:mi><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft103">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula> was statistically significant (<xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4D</xref>). This result suggests that the time-dependent change in <italic>exploitation</italic> is likely due to a satiety-related signal rather than a stress-related signal. Altogether, these results suggest that animals use available external and internal sensory information to guide the decision to <italic>exploit</italic>.</p></sec><sec id="s2-5"><title>Prior experience guides the decision to <italic>explore</italic> or <italic>exploit</italic></title><p>Although the current patch density and satiety covariates significantly influence the decision to <italic>exploit</italic>, this model (i.e., <inline-formula><alternatives><mml:math id="inf104"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft104">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}\right)$\end{document}</tex-math></alternatives></inline-formula>) does not accurately predict the extent that <italic>exploitation</italic> was delayed. We hypothesized that because animals had experienced very densely seeded bacterial patches immediately prior to the assay, animals may have built an expectation that high-density bacterial patches are available in the new environment. We would therefore expect an initial suppression in the probability of <italic>exploiting</italic> while animals updated their expectation using information learned from <italic>sampling</italic> patches in the current environment. To test whether the decision to <italic>exploit</italic> could be influenced by prior experience, we added a history-dependent covariate to our model (i.e., <inline-formula><alternatives><mml:math id="inf105"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft105">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}+\beta _{h}\rho _{h}\right)$\end{document}</tex-math></alternatives></inline-formula> where <inline-formula><alternatives><mml:math id="inf106"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft106">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> is the relative density of the patch encountered immediately before encounter <inline-formula><alternatives><mml:math id="inf107"><mml:mi>k</mml:mi></mml:math><tex-math id="inft107">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula>). We find that inclusion of the density of the most recently encountered patch significantly improves our prediction of <italic>exploitation</italic> (<xref ref-type="fig" rid="fig4">Figure 4D</xref>, <xref ref-type="fig" rid="fig4s2">Figure 4—figure supplement 2</xref>). We then considered whether the animal’s expectation of bacterial density in the environment might be a longer lasting memory. Specifically, we considered if the relative density of the most recently <italic>exploited</italic> patch <inline-formula><alternatives><mml:math id="inf108"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft108">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula> could have influenced the animal’s decision to <italic>exploit</italic>. The addition of this second history-dependent term to our model (i.e., <inline-formula><alternatives><mml:math id="inf109"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft109">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}\right)$\end{document}</tex-math></alternatives></inline-formula>) further improved the fit of our model (<xref ref-type="fig" rid="fig4">Figure 4D</xref>, <xref ref-type="fig" rid="fig4s2">Figure 4—figure supplement 2</xref>), suggesting that <italic>C. elegans</italic> use recent experiences of encountered and <italic>exploited</italic> patches to guide their decision to <italic>exploit</italic>. Animals may use this learned information to create and update an expectation for the relative density of bacterial patches available in their environment and compare that estimate against the density of a subsequently encountered patch. Altogether, these results suggest that animals use recent experiences to estimate available resources and modulate their decision to <italic>explore</italic> or <italic>exploit</italic>, a strategy that is highly beneficial for behavioral adaptation in a changing environment.</p><p>To validate the role of prior experience in guiding foraging decisions, we observed animals foraging in environments with multiple patch densities (<xref ref-type="fig" rid="fig4">Figure 4E</xref>, <xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4A–C</xref>). Our model predicts that the lower the density of recently encountered and/or <italic>exploited</italic> patches, the more likely an animal should be to <italic>exploit</italic> a subsequent patch. Without the history-dependent terms <inline-formula><alternatives><mml:math id="inf110"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft110">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf111"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft111">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>, our model predicts that no relationship should exist between prior experience and the probability of <italic>exploiting</italic> the current patch. To test which model best fit the animals’ behavior, we calculated the conditional probabilities of <italic>exploiting</italic> <inline-formula><alternatives><mml:math id="inf112"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft112">\begin{document}$p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> using the coefficients <italic>β</italic> learned previously (<xref ref-type="fig" rid="fig4">Figure 4C</xref>) for this new multi-density, multi-patch data set containing more nuanced combinations of current (<inline-formula><alternatives><mml:math id="inf113"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft113">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>) and recent patch (<inline-formula><alternatives><mml:math id="inf114"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft114">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf115"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft115">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>) density. We observed significantly improved predictions of <italic>exploitation</italic> probability for the model including prior experience as compared to the model without the terms <inline-formula><alternatives><mml:math id="inf116"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft116">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf117"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft117">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula> (<xref ref-type="fig" rid="fig4">Figure 4F</xref>, <xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4E</xref>) as confirmed by a likelihood-ratio test. We observed an augmentation in <italic>exploitation</italic> when animals move from low to high density (e.g., 1–4 or 1–7) as predicted by the model with history dependence, but not the model without. It is important to note that this improvement in prediction was achieved without re-fitting the model to this new multi-density data set. In summary, our modeling results suggest that animals evaluate bacterial density, monitor internal signals of satiety, and leverage recent experiences to drive their decision to <italic>exploit</italic> a bacterial patch upon encounter.</p></sec><sec id="s2-6"><title>Ciliated sensory neurons are required for the evaluation of patch density</title><p>The quantitative modeling applied in this study provides a useful framework for testing the influence of behaviorally relevant features on decision-making. To validate this approach and further elucidate how animals evaluate current and recent patch density, we assessed the foraging behavior of mutants with sensory deficiencies (<xref ref-type="fig" rid="fig4s5">Figure 4—figure supplement 5</xref>). We found that animals with reduced function of non-ciliated mechanoreceptor neurons due to a null mutation in the <italic>mec-4</italic> gene behave similarly to wild-type N2 animals, displaying increasingly delayed <italic>exploitation</italic> as patch density decreases (<xref ref-type="fig" rid="fig4">Figure 4G</xref>, <xref ref-type="fig" rid="fig4s5">Figure 4—figure supplement 5</xref>). Contrastingly, animals with reduced function of ciliated chemoreceptor and mechanoreceptor neurons due to a null mutation in the <italic>osm-6</italic> gene displayed immediate <italic>exploitation</italic> even while foraging on low-density patches (<xref ref-type="fig" rid="fig4">Figure 4G</xref>, <xref ref-type="fig" rid="fig4s5">Figure 4—figure supplement 5</xref>). These results indicate altered decision-making in the <italic>osm-6</italic> mutants. Specifically, it appears that the influence of patch density on the <italic>exploitation</italic> decision is reduced in <italic>osm-6</italic> mutants and that these animals are more likely to <italic>accept</italic> a patch by default.</p><p>To further elaborate on these findings, we fit our GLM to each of the three data sets (i.e., N2, <italic>mec-4</italic>, and <italic>osm-6</italic>) and assessed the difference in the estimated distributions of coefficients <inline-formula><alternatives><mml:math id="inf118"><mml:mi mathvariant="bold-italic">β</mml:mi></mml:math><tex-math id="inft118">\begin{document}$\boldsymbol{\beta }$\end{document}</tex-math></alternatives></inline-formula> between mutant and wild-type models (<xref ref-type="fig" rid="fig4">Figure 4H</xref>). We hypothesized that the density-related covariates (<inline-formula><alternatives><mml:math id="inf119"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft119">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf120"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft120">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula>, and <inline-formula><alternatives><mml:math id="inf121"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft121">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>) would have smaller magnitude (i.e., less influence on decision-making) for animals with reduced sensation of bacterial density. Consistent with this hypothesis, we found a significant reduction in the magnitude of the influence of current patch density (i.e., <inline-formula><alternatives><mml:math id="inf122"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft122">\begin{document}$\beta _{k}$\end{document}</tex-math></alternatives></inline-formula>) on the decision to exploit in <italic>osm-6</italic> mutants. Further, we found a significant increase in the intercept <inline-formula><alternatives><mml:math id="inf123"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math><tex-math id="inft123">\begin{document}$\beta _{0}$\end{document}</tex-math></alternatives></inline-formula> in <italic>osm-6</italic> mutants which corresponds to the overall increase in <italic>exploitation</italic> observed in these animals (<xref ref-type="fig" rid="fig4">Figure 4G</xref>, <xref ref-type="fig" rid="fig4s5">Figure 4—figure supplement 5</xref>). These results suggest that the ciliated sensory neurons play an important role in evaluating the density of the current patch and that when sensation is impaired, animals modify their default behavioral strategy to prioritize <italic>exploitation</italic>. We also observed a marginal increase in our estimate of the influence of recently <italic>exploited</italic> patches (i.e., <inline-formula><alternatives><mml:math id="inf124"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft124">\begin{document}$\beta _{e}$\end{document}</tex-math></alternatives></inline-formula>) in <italic>osm-6</italic> mutants, which suggests that reduced efficacy in the evaluation of current patch density also affects learning and memory of patch density. No significant changes were detected in the <italic>mec-4</italic> mutants. Although we cannot rule out a role for non-ciliated mechanoreceptor neurons in contributing to the assessment of patch density, this modality likely provides less salient information. Altogether, these results suggest that ciliated sensory neurons are necessary for the evaluation of patch density and that when the function of these neurons is impaired, animals prioritize <italic>exploitation</italic>. Further, these results demonstrate that this quantitative modeling approach can be used to probe mechanisms underlying decision-making.</p></sec></sec><sec id="s3" sec-type="discussion"><title>Discussion</title><p>Like all foraging animals, <italic>C. elegans</italic> must choose between <italic>exploiting</italic> an environment for known resources and <italic>exploring</italic> it for potentially better opportunities elsewhere (<xref ref-type="bibr" rid="bib89">Stephens, 2008</xref>; <xref ref-type="bibr" rid="bib81">Schoener, 1971</xref>; <xref ref-type="bibr" rid="bib70">Pyke et al., 1977</xref>; <xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>; <xref ref-type="bibr" rid="bib88">Stephens et al., 2007</xref>; <xref ref-type="bibr" rid="bib61">Nonacs, 2001</xref>). Previous studies have shown that <italic>C. elegans</italic> use <italic>stay–switch</italic> decisions to efficiently explore a patchily distributed environment and exploit the bacteria within (<xref ref-type="bibr" rid="bib44">Iwanir et al., 2016</xref>; <xref ref-type="bibr" rid="bib66">Pradhan et al., 2019</xref>; <xref ref-type="bibr" rid="bib31">Gloria-Soria and Azevedo, 2008</xref>; <xref ref-type="bibr" rid="bib51">Madirolas et al., 2023</xref>). In this study, we show that <italic>C. elegans</italic> also make <italic>accept–reject</italic> decisions while foraging. Specifically, we observe that animals often initially <italic>reject</italic> low-density bacterial patches, opting to prioritize exploration of the environment before switching to a more exploitatory foraging strategy during subsequent encounters. This explore-then-exploit strategy was consistent across a range of bacterial patch densities, sizes, and distributions. In order to better understand this phenomenon and identify the factors that contribute to the decision to <italic>exploit</italic>, we leveraged a quantitative modeling approach to hypothesis testing. We found that animals do not employ a default explore-then-exploit strategy; rather, this behavior reflects a series of <italic>accept–reject</italic> decisions guided by multimodal information related to an animal’s environment and internal state. Specifically, we show that each decision to <italic>explore</italic> or <italic>exploit</italic> is informed by available sensory information, internal satiety signals, and learned environmental statistics related to the bacterial density of recently encountered and <italic>exploited</italic> patches.</p><sec id="s3-1"><title><italic>C. elegans</italic> make <italic>accept–reject</italic> foraging decisions</title><p>While <italic>C. elegans</italic> have been shown to alter food preferences in a diet choice assay, this behavior has only been described by a set of <italic>stay–switch</italic> decisions (<xref ref-type="bibr" rid="bib79">Scheer and Bargmann, 2023</xref>; <xref ref-type="bibr" rid="bib83">Shtonda and Avery, 2006</xref>; <xref ref-type="bibr" rid="bib51">Madirolas et al., 2023</xref>). Specifically, <italic>C. elegans</italic> were found to modulate their patch-leaving frequency to <italic>stay</italic> on high-quality bacterial patches and <italic>switch</italic> with declining food quality and quantity (<xref ref-type="bibr" rid="bib5">Bendesky et al., 2011</xref>; <xref ref-type="bibr" rid="bib83">Shtonda and Avery, 2006</xref>; <xref ref-type="bibr" rid="bib56">Milward et al., 2011</xref>; <xref ref-type="bibr" rid="bib62">Olofsson, 2014</xref>). The overall effect of leaving low-quality patches more frequently is that animals are more likely to reside on high-quality patches. Thus, <italic>stay–switch</italic> decision-making enables <italic>C. elegans</italic> to allocate time spent between exploring or exploiting in a manner consistent with optimal foraging theory (<xref ref-type="bibr" rid="bib89">Stephens, 2008</xref>; <xref ref-type="bibr" rid="bib81">Schoener, 1971</xref>; <xref ref-type="bibr" rid="bib70">Pyke et al., 1977</xref>; <xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>; <xref ref-type="bibr" rid="bib88">Stephens et al., 2007</xref>; <xref ref-type="bibr" rid="bib61">Nonacs, 2001</xref>). However, optimal foraging theory also predicts that an animal should never exploit (i.e., always <italic>reject</italic>) a low-density patch if higher-density patches are sufficiently abundant, as inclusion of the low-density patch type in the animals’ diet decreases the overall rate of energy gained (<xref ref-type="bibr" rid="bib89">Stephens, 2008</xref>; <xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>). Thus, while leaving low-density patches more frequently drives an overall increase in the rate of energy gained, it can still result in sub-optimal foraging behavior.</p><p>Here, we demonstrate that <italic>C. elegans</italic> are capable of making <italic>accept–reject</italic> decisions upon encounter with bacterial patches. We employed quantitative methods – GMM and semi-supervised QDA – to estimate whether animals <italic>sensed</italic> a patch and, if they did, whether they <italic>accepted</italic> or <italic>rejected</italic> it. We found that when transferred from high- to low-density bacterial patches, animals initially <italic>rejected</italic> several patches, opting to continue exploration of the environment, and that this <italic>reject</italic> decision did not reflect an animal’s inability to detect the presence of bacteria in these dilute patches. Further, we found that the decision to <italic>explore</italic> or <italic>exploit</italic> is density-dependent and robust across a range of bacterial densities, distributions, and sizes. The initial preference for <italic>exploration</italic> during foraging on low-density patches suggests that animals may be <italic>searching</italic> for denser bacterial patches such as those experienced immediately preceding the assay and throughout development. This explore-then-exploit strategy is advantageous for animals when bacterial patch density is low or variable. On the other hand, we observed immediate <italic>exploitation</italic> of high-density patches. In these environments, an explore-then-exploit strategy is disadvantageous, as delaying <italic>exploitation</italic> when patch density is already high results in spending more energy on food search with no expected increase in energy gained during <italic>exploitation</italic> of a subsequently encountered patch. Thus, consistent with an energy-maximizing optimal forager, <italic>C. elegans</italic> initially <italic>explores</italic> when bacterial patch density is low but immediately <italic>exploits</italic> when bacterial patch density is sufficiently high. Altogether, our results demonstrate that <italic>C. elegans</italic> make a distinct decision to either <italic>explore</italic> or <italic>exploit</italic> a patch upon encounter and that the density dependence of this decision is consistent with predictions from optimal foraging theory.</p><p>The concepts of <italic>accept–reject</italic> and <italic>stay–switch</italic> decision-making are well described in foraging theory literature (see <xref ref-type="bibr" rid="bib70">Pyke et al., 1977</xref> for a review on the subject) and represent the questions ‘Do you want to eat it?’ and, if so, ‘How long do you want to eat it for?’. These concepts are easily distinguishable for animals that forage using the following framework: (1) search for prey, (2) encounter prey from a distance, (3) identify prey type, (4) decide to pursue (<italic>accept–reject</italic> decision), (5) pursue and capture the prey, (6) exploit prey, and (7) decide to stop exploiting and start searching again (<italic>stay–switch</italic> decision). However, in some scenarios, animals must physically encounter prey prior to identification. In these cases where pursuit and capture are not visualized, it is harder to distinguish between <italic>accept–reject</italic> and <italic>stay–switch</italic> decisions. In our experiments, <italic>C. elegans</italic> do not appear to detect the presence of bacterial patches prior to encounter as slowdown only occurs within one body length of the patch edge (<xref ref-type="fig" rid="fig2">Figure 2B</xref>). Further, we find significant bimodality in encounter duration (<xref ref-type="fig" rid="fig2">Figure 2H</xref>) where short-duration (<italic>exploratory</italic>) encounters appear to represent a lower bound where animals spend the minimum amount of time possible on a patch (less than 2 min), which we interpret as a <italic>rejection</italic> of the patch. On the other hand, <italic>exploitatory</italic> encounters span a large range of durations from 2 to 60+ min which we interpret as an initial <italic>acceptance</italic> of the patch followed by a series of <italic>stay–switch</italic> decisions which determine the overall duration of the encounter. While we could certainly model our data using only <italic>stay–switch</italic> decision-making, we ascertain that an encounter of minimal duration is better interpreted ethologically as a <italic>rejection</italic> rather than as an immediate <italic>switch</italic> decision. In accordance with this interpretation, we hypothesize that if <italic>C. elegans</italic> were able to detect the presence of a bacterial patch prior to encountering it, it is possible that animals may be observed to navigate toward (<italic>accept</italic>) or away from (<italic>reject</italic>) a patch. However, it could be the case that, for <italic>C. elegans</italic>, <italic>sampling</italic> the patch is prerequisite to an <italic>accept-reject</italic> decision which would suggest that gustation, mechanosensation, and/or post-ingestive feedback may guide <italic>C. elegans</italic> foraging decisions.</p><p>Our finding that <italic>C. elegans</italic> are willing to <italic>reject</italic> numerous encountered patches is somewhat surprising, especially given that <italic>C. elegans</italic> likely possess limited spatial memory (<xref ref-type="bibr" rid="bib12">Calhoun et al., 2015</xref>) and are likely unaware of how many patches are in the environment as evidenced by their willingness to <italic>reject</italic> a patch even when only one patch is available (<xref ref-type="fig" rid="fig3">Figure 3</xref>). Taken together, this suggests that animals are ‘knowingly’ passing up an opportunity to <italic>exploit</italic> an immediately available food source for the potential opportunity to <italic>exploit</italic> preferred food later. This type of behavior has been described in humans and other animals in the context of delayed gratification (<xref ref-type="bibr" rid="bib26">Fawcett et al., 2012</xref>; <xref ref-type="bibr" rid="bib91">Susini et al., 2021</xref>), intertemporal choice (<xref ref-type="bibr" rid="bib26">Fawcett et al., 2012</xref>; <xref ref-type="bibr" rid="bib16">Constantino and Daw, 2015</xref>; <xref ref-type="bibr" rid="bib13">Carter et al., 2015</xref>), self-control (<xref ref-type="bibr" rid="bib40">Hayden, 2019</xref>; <xref ref-type="bibr" rid="bib87">Stephens and Anderson, 2001</xref>), and optimal stopping (<xref ref-type="bibr" rid="bib27">Ferguson, 1967</xref>; <xref ref-type="bibr" rid="bib74">Robbins, 1970</xref>). Notably, few animals display the capacity for delayed gratification when given the option between eating an immediately available but less preferred food item and waiting for a preferred food item (<xref ref-type="bibr" rid="bib57">Mischel and Ebbesen, 1970</xref>; <xref ref-type="bibr" rid="bib75">Rosati et al., 2007</xref>; <xref ref-type="bibr" rid="bib80">Schnell et al., 2021</xref>; <xref ref-type="bibr" rid="bib73">Range et al., 2020</xref>). Even fewer animals are willing to wait if the delayed reward is not visible or increases in quantity rather than quality (<xref ref-type="bibr" rid="bib41">Hillemann et al., 2014</xref>; <xref ref-type="bibr" rid="bib55">Miller et al., 2020</xref>). Our observation that <italic>C. elegans</italic> can exhibit delayed gratification suggests that this and similar processes require less complex cognition than previously considered or that we may have underestimated the cognitive capacity of <italic>C. elegans</italic>.</p></sec><sec id="s3-2"><title>External and internal sensory information guide foraging decision-making</title><p><italic>Stay–switch</italic> decisions in <italic>C. elegans</italic> are strongly modulated by a variety of internal and external sensory cues over a range of behavioral timescales. For example, patch-leaving frequency can be modulated by an animal’s prior experience (<xref ref-type="bibr" rid="bib12">Calhoun et al., 2015</xref>; <xref ref-type="bibr" rid="bib66">Pradhan et al., 2019</xref>), metabolic status, arousal state (<xref ref-type="bibr" rid="bib79">Scheer and Bargmann, 2023</xref>), as well as the presence of pathogens (<xref ref-type="bibr" rid="bib69">Pujol et al., 2001</xref>; <xref ref-type="bibr" rid="bib54">Melo and Ruvkun, 2012</xref>), chemorepellents (<xref ref-type="bibr" rid="bib65">Pradel et al., 2007</xref>), predators (<xref ref-type="bibr" rid="bib71">Quach and Chalasani, 2022</xref>; <xref ref-type="bibr" rid="bib68">Pribadi et al., 2023</xref>), and varying levels of environmental O<sub>2</sub> and CO<sub>2</sub> (<xref ref-type="bibr" rid="bib56">Milward et al., 2011</xref>; <xref ref-type="bibr" rid="bib9">Busch and Olofsson, 2012</xref>).</p><p>Here, we used a quantitative framework to show that recent experiences (i.e., the density of current and recently encountered and <italic>exploited</italic> bacterial patches) guide <italic>accept–reject</italic> decision-making. In our study and others (<xref ref-type="bibr" rid="bib51">Madirolas et al., 2023</xref>; <xref ref-type="bibr" rid="bib78">Sawin et al., 2000</xref>), <italic>C. elegans</italic> appear to be able to detect the presence of and assess the relative density of bacterial patches. When foraging in environments with low-density bacterial patches, we initially observed many <italic>searching</italic> encounters where animals did not appear to slow down; however, over time, the proportion of <italic>searching</italic> encounters decreased (<xref ref-type="fig" rid="fig2">Figure 2L, M</xref>). This increased responsiveness to dilute patches over time could have resulted from small changes in bacterial growth or a modulation of patch detection sensitivity. Contrastingly, animals with reduced function of ciliated chemoreceptor and mechanoreceptor neurons due to a null mutation in the <italic>osm-6</italic> gene almost never <italic>searched</italic>. Rather, they displayed immediate <italic>exploitation</italic> even while foraging on low-density patches. This suggests that <italic>osm-6</italic> mutants display an augmented ability to detect bacterial patches but a diminished ability to assess the bacterial density of those patches. While this may seem contradictory, it suggests that bacterial detection and density assessment are mediated by distinct sensory mechanisms. Specifically, post-ingestive feedback or other non-ciliary sensory cues may drive the initial detection of bacteria, while ciliated sensory neurons appear to be crucial for the nuanced evaluation of bacterial patch density. This interplay allows for a flexible foraging strategy where initial detection by one modality can trigger exploitation, which can then be modulated or overridden by more detailed chemosensory and mechanosensory information. This framework may explain why <italic>osm-6</italic> mutants, lacking the ability to finely assess bacterial density, prioritize exploitation; if all patches appear effectively equivalent, further exploration is inefficient. Collectively, these results suggest an important role for sensory modalities in the detection and assessment of bacterial patch density and highlight a need to investigate the mechanisms behind these effects in future studies.</p><p>The difficulty in assessing bacterial patch density is more than just a sensory challenge. Within-patch spatial inhomogeneity resulting from areas of active proliferation of bacteria (<xref ref-type="bibr" rid="bib31">Gloria-Soria and Azevedo, 2008</xref>; <xref ref-type="bibr" rid="bib37">Hallatschek et al., 2007</xref>) complicates an animal’s ability to accurately assess the quantity of bacteria within a patch and, consequently, our ability to accurately compute a metric related to our assumptions of what the animal is sensing. In our study, we used the relative density of the patch edge where bacterial density is highest as a proxy for an animal’s assessment of bacterial patch density (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>). This decision was based on a previous finding that the time spent on the edge of a bacterial patch affected the dynamics of subsequent area-restricted search (<xref ref-type="bibr" rid="bib12">Calhoun et al., 2015</xref>). While within-patch spatial inhomogeneity likely affects an animal’s ability to assess patch density, we do not believe that this qualitatively affects the results of our study. Both the patch densities tested (<xref ref-type="fig" rid="fig2s3">Figure 2—figure supplement 3A</xref>) as well as our observations of time-dependent changes in <italic>exploitation</italic> (<xref ref-type="fig" rid="fig2">Figure 2E, N, O</xref> and <xref ref-type="fig" rid="fig3">Figure 3H, I</xref>) maintained a monotonic relationship. Therefore, alternative methods of patch density estimation should yield similar results.</p><p>According to early models in optimal foraging theory, foragers behave as if they have <italic>complete information</italic> about the environment (e.g., animals are assumed to know the average density of bacterial patches) (<xref ref-type="bibr" rid="bib86">Stephens and Krebs, 1986</xref>). Later theoretical and empirical work expanded models of patch choice to accommodate situations where animals have <italic>incomplete information</italic> (e.g., environments with fluctuating resources) and, therefore, must both acquire information and forage (<xref ref-type="bibr" rid="bib70">Pyke et al., 1977</xref>; <xref ref-type="bibr" rid="bib88">Stephens et al., 2007</xref>; <xref ref-type="bibr" rid="bib47">Krebs and Inman, 1992</xref>). This work suggests that animals may continuously sample areas in their environment to keep track of resource availability. Here, we found that animals initially choose to <italic>sample</italic> patches and that the duration of this period of <italic>sampling</italic> is correlated with the degree of mismatch between current and recently experienced and <italic>exploited</italic> patches (i.e., animals spend more time <italic>sampling</italic> as the magnitude of difference between the patch density experienced immediately before and during the experiment increases). When there is no difference between current and prior experience (i.e., animals foraging on patches of relative density 200), animals rarely <italic>sample</italic>. These results suggest that <italic>C. elegans</italic> use <italic>sampling</italic> as a way of re-evaluating the overall quality of patches available in the environment when a change is detected. Further, the results of our model suggest that animals likely use the information learned during <italic>sampling</italic> encounters to guide their decision to <italic>explore</italic> or <italic>exploit</italic> on subsequent patch encounters. We behaviorally validated this hypothesis by applying our model predictions to animals foraging in environments with multiple patch densities. Consistent with our predictions, we observed that the lower the density of recently encountered or <italic>exploited</italic> patches and the higher the density of the current patch, the more likely an animal would be to <italic>exploit</italic> (<xref ref-type="fig" rid="fig4">Figure 4F</xref>). These results suggest that <italic>C. elegans</italic> can learn and remember features of recent experiences and use that learned information to guide efficient decision-making. Incorporating prior experience into the decision to <italic>explore</italic> or <italic>exploit</italic> currently available food is highly beneficial when foraging in a fluctuating environment. <italic>C. elegans</italic> thus may have evolved this ability to maximize foraging in the wild where animals experience a boom-and-bust environment (<xref ref-type="bibr" rid="bib29">Frézal and Félix, 2015</xref>). Future studies investigating the effects of varying patch density during animal development could provide additional insights into the effects of more distant experiences on the <italic>explore–exploit</italic> decision. However, testing this is non-trivial as maintaining stable bacterial density conditions over long timescales requires matching the rate of bacterial growth with the rate of bacterial consumption.</p><p>In addition to external sensory information, internal state signals serve a critical role in modifying decision-making in <italic>C. elegans</italic> (<xref ref-type="bibr" rid="bib79">Scheer and Bargmann, 2023</xref>; <xref ref-type="bibr" rid="bib53">Matty et al., 2022</xref>). For example, food-deprived animals are more likely to cross an aversive barrier in search of food as compared to well-fed controls (<xref ref-type="bibr" rid="bib53">Matty et al., 2022</xref>; <xref ref-type="bibr" rid="bib23">Ezcurra et al., 2011</xref>). Here, we find that a satiety-related signal likely drives the decision to <italic>exploit</italic>. Specifically, our model suggests that as animals’ satiety decreases, their willingness to accept a lower quality patch increases. We confirmed this prediction by analyzing the behavior of food-deprived animals, which immediately <italic>exploit</italic> even when bacterial patches are very dilute (<xref ref-type="fig" rid="fig4s3">Figure 4—figure supplement 3</xref>). Further, we showed that this temporal signal was not likely to have been caused by transfer-induced stress (<xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4D</xref>). Combined with the effect of prior experience, these results suggest that the decision to <italic>explore</italic> or <italic>exploit</italic> likely requires integration of food-related internal and external cues. Future studies should probe if additional factors related to the animal’s biotic and abiotic environment (<xref ref-type="bibr" rid="bib35">Guisnet et al., 2021</xref>; <xref ref-type="bibr" rid="bib2">Anderson et al., 2011</xref>; <xref ref-type="bibr" rid="bib63">Petersen et al., 2014</xref>; <xref ref-type="bibr" rid="bib28">Fraune and Bosch, 2010</xref>; <xref ref-type="bibr" rid="bib22">Dirksen P et al., 2020</xref>) as well as alternative motivations (e.g., reproduction and predatory avoidance) (<xref ref-type="bibr" rid="bib21">Ding et al., 2020</xref>; <xref ref-type="bibr" rid="bib50">Lipton et al., 2004</xref>; <xref ref-type="bibr" rid="bib4">Barrios et al., 2008</xref>; <xref ref-type="bibr" rid="bib52">Matsuura et al., 2005</xref>) further modify these foraging decisions.</p></sec><sec id="s3-3"><title>Quantitative and ethological approach to investigating decision-making</title><p>Naturalistic observations of <italic>C. elegans</italic> behavior are necessary to achieve a more complete cellular, molecular, and genetic understanding of how the nervous system has evolved to drive animal behavior. For example, large patches of densely seeded bacteria have primarily been used in experiments assessing <italic>C. elegans</italic> foraging (<xref ref-type="bibr" rid="bib96">White et al., 1986</xref>; <xref ref-type="bibr" rid="bib20">de Bono and Maricq, 2005</xref>; <xref ref-type="bibr" rid="bib33">Gray and Lissmann, 1964</xref>; <xref ref-type="bibr" rid="bib17">Croll, 1975a</xref>; <xref ref-type="bibr" rid="bib18">Croll, 1975b</xref>). However, wild nematodes experience a boom-and-bust environment (<xref ref-type="bibr" rid="bib29">Frézal and Félix, 2015</xref>) that may be more consistent with sparse, patchily distributed bacteria (<xref ref-type="bibr" rid="bib44">Iwanir et al., 2016</xref>). Thus, just as quiescence is only observed on high-quality bacterial patches (<xref ref-type="bibr" rid="bib97">You et al., 2008</xref>), additional behavioral states may be discovered when assessing foraging in dilute patchy environments. By conducting detailed analyses of ecologically inspired foraging behaviors in individual animals, we discovered that <italic>C. elegans</italic> make <italic>accept–reject</italic> decisions upon encounter with bacterial patches. By studying foraging in these environments containing small, dilute bacterial patches, we increased the frequency of opportunities for <italic>accept–reject</italic> decision-making (i.e., patch encounters and patch-leaving events are more frequent) and decreased the condition-specific bias toward <italic>accept</italic> decisions (i.e., animals are less likely to <italic>accept</italic> patches when moved between environments of differing bacterial density). We expect that further investigation into naturalistic behaviors could reveal additional insights into more complex behaviors and decision-making in <italic>C. elegans</italic> and other animals.</p><p>In this study, we developed an assay that enables observation of ecologically relevant decision-making in freely moving animals. We posit that future studies can leverage this assay to investigate the neuronal mechanisms underlying decision-making. The frequency of decision-making opportunities (i.e., numerous <italic>accept–reject</italic> decisions could be observed in the span of minutes) and consistency of patch choice decisions across hundreds of animals and a range of environmental conditions tested supports this claim. Further, we anticipate that the <italic>accept–reject</italic> decision occurs during a narrow time window – possibly at the time of encounter with the patch edge or shortly thereafter. Therefore, we expect that this assay could be adapted for experiments utilizing calcium imaging in freely moving animals (<xref ref-type="bibr" rid="bib24">Faumont and Lockery, 2006</xref>; <xref ref-type="bibr" rid="bib45">Ji et al., 2021</xref>; <xref ref-type="bibr" rid="bib67">Prevedel et al., 2014</xref>; <xref ref-type="bibr" rid="bib60">Nguyen et al., 2016</xref>; <xref ref-type="bibr" rid="bib93">Venkatachalam et al., 2016</xref>; <xref ref-type="bibr" rid="bib94">Voleti et al., 2019</xref>; <xref ref-type="bibr" rid="bib38">Hallinen et al., 2021</xref>) to monitor neuronal activity as animals make these decisions. Additionally, the foraging task used here could be leveraged as an accumulation of evidence paradigm, which has been predominantly studied using mammalian animal models (<xref ref-type="bibr" rid="bib19">Davidson and El Hady, 2019</xref>).</p><p>Finally, we used simple quantitative models to dissect and validate the components underlying decision-making. Specifically, we employed a logistic regression GLM which we adapted to accommodate our uncertainty in classification of <italic>sensing</italic> and <italic>exploitation</italic> for each encounter. While alternative models may provide more mechanistic predictions, the GLM enabled us to conduct a sequence of hypothesis tests probing the influence of food-related signals on the decision to <italic>exploit</italic>. Indeed, we conducted a great number of analyses involving model selection and optimization. Ultimately, we focused our study on asking whether a set of simple covariates could be used to predict foraging decisions. The GLM enabled us to identify the simplest model that could explain the observed delay in <italic>exploitation</italic>. While even the null model predicted that, on average, numerous <italic>exploratory</italic> encounters were likely to occur before the first <italic>exploitation</italic>, models including satiety and prior experience significantly better predicted the extent of this delay. Further, we demonstrated that we could validate these model predictions in food-deprived animals, animals exploring multiple patch densities, and animals with sensory deficiencies. We regard our study as an initial foray into demonstrating <italic>accept–reject</italic> decision-making in nematodes and, while our model is a useful tool for testing the effects of past experiences, our results do not imply that <italic>C. elegans</italic> discretize their experiences into the parameters used in our model. The exact mechanisms and, consequently, the best model design require further investigation. For example, it is possible that the density of recently <italic>exploited</italic> patches is predictive of subsequent <italic>exploitation</italic> because post-ingestive feedback is required for the memory and/or because more distant experiences are remembered (i.e., long-term memory is involved). Future studies should seek to differentiate between these possibilities and characterize the time window of the memory. Altogether, we suggest that this quantitative and ecologically inspired approach to investigating behavior and decision-making is incredibly powerful for refining hypotheses and enables subsequent investigation into the underlying cellular, molecular, and circuit pathways in <italic>C. elegans</italic>, a strategy that could be adopted across species.</p></sec></sec><sec id="s4" sec-type="materials|methods"><title>Materials and methods</title><table-wrap id="keyresource" position="anchor"><label>Key resources table</label><table frame="hsides" rules="groups"><thead><tr><th align="left" valign="bottom">Reagent type (species) or resource</th><th align="left" valign="bottom">Designation</th><th align="left" valign="bottom">Source or reference</th><th align="left" valign="bottom">Identifiers</th><th align="left" valign="bottom">Additional information</th></tr></thead><tbody><tr><td align="left" valign="bottom">Strain, strain background (<italic>Escherichia coli</italic>)</td><td align="left" valign="bottom">OP50</td><td align="left" valign="bottom"><italic>Caenorhabditis</italic> Genetics Center</td><td align="left" valign="bottom">WBStrain00041969</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Strain, strain background (<italic>Escherichia coli</italic>)</td><td align="left" valign="bottom">OP50-GFP</td><td align="left" valign="bottom"><italic>Caenorhabditis</italic> Genetics Center</td><td align="left" valign="bottom">WBStrain00041972</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Strain, strain background (<italic>Caenorhabditis elegans</italic>)</td><td align="left" valign="bottom">N2: wild isolate</td><td align="left" valign="bottom"><italic>Caenorhabditis</italic> Genetics Center</td><td align="left" valign="bottom">WBStrain00000001</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Strain, strain background (<italic>Caenorhabditis elegans</italic>)</td><td align="left" valign="bottom">PR811: [osm-6(p811) V]</td><td align="left" valign="bottom"><italic>Caenorhabditis</italic> Genetics Center</td><td align="left" valign="bottom">WBStrain00030796</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Strain, strain background (<italic>Caenorhabditis elegans</italic>)</td><td align="left" valign="bottom">TU253: [mec-4(u253) X]</td><td align="left" valign="bottom"><italic>Caenorhabditis</italic> Genetics Center</td><td align="left" valign="bottom">WBStrain00035037</td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Software, algorithm</td><td align="left" valign="bottom">StreamPix 8</td><td align="left" valign="bottom">NorPix</td><td align="left" valign="bottom">RRID:<ext-link ext-link-type="uri" xlink:href="https://identifiers.org/RRID:SCR_015773">SCR_015773</ext-link></td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Software, algorithm</td><td align="left" valign="bottom">WormLab</td><td align="left" valign="bottom">MBF Bioscience</td><td align="left" valign="bottom">RRID:<ext-link ext-link-type="uri" xlink:href="https://identifiers.org/RRID:SCR_017669">SCR_017669</ext-link></td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Software, algorithm</td><td align="left" valign="bottom">MATLAB 2024a</td><td align="left" valign="bottom">Mathworks</td><td align="left" valign="bottom">RRID:<ext-link ext-link-type="uri" xlink:href="https://identifiers.org/RRID:SCR_001622">SCR_001622</ext-link></td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Software, algorithm</td><td align="left" valign="bottom">Photoshop 2024</td><td align="left" valign="bottom">Adobe</td><td align="left" valign="bottom">RRID:<ext-link ext-link-type="uri" xlink:href="https://identifiers.org/RRID:SCR_014199">SCR_014199</ext-link></td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Software, algorithm</td><td align="left" valign="bottom">Illustrator 2024</td><td align="left" valign="bottom">Adobe</td><td align="left" valign="bottom">RRID:<ext-link ext-link-type="uri" xlink:href="https://identifiers.org/RRID:SCR_010279">SCR_010279</ext-link></td><td align="left" valign="bottom"/></tr><tr><td align="left" valign="bottom">Software, algorithm</td><td align="left" valign="bottom">Code for analysis</td><td align="left" valign="bottom"><ext-link ext-link-type="uri" xlink:href="https://github.com/shreklab/Haley-et-al-2024">https://github.com/shreklab/Haley-et-al-2024</ext-link></td><td align="left" valign="bottom"/><td align="left" valign="bottom"/></tr></tbody></table></table-wrap><sec id="s4-1"><title>Bacterial cultures</title><p>Stock liquid cultures of the OP50 strain of <italic>E. coli</italic> were prepared via inoculation of a single colony in sterile lysogeny broth (LB) grown overnight at room temperature. Stock liquid cultures were subsequently stored at 4°C for up to 6 weeks.</p><p>Solutions of OP50 for each experiment were prepared via a series of dilutions in LB (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1A</xref>). 50 ml of OP50 stock solution was centrifuged at 3000 rpm for 5 min. After removal of the supernatant, approximately 500–1000 µl of saturated liquid culture remained. The bacterial density of this saturated solution was estimated by measuring the optical density at 600 nm (OD<sub>600</sub>) of a 1:50 dilution of the homogenized solution on a spectrophotometer (Molecular Devices SpectraMax Plus 384). The saturated solution was subsequently diluted to achieve an OD<sub>600</sub> of ~10 (<italic>μ</italic> = 10.22, <italic>σ</italic> = 0.31). Measurements of the number of colony-forming units in the ‘10’ solution estimated 13.1 × 10<sup>9</sup> cells per ml on average. Additional densities (OD<sub>600</sub> = {0.05, 0.1, 0.5, 1, 2, 3, 4, 5}) were prepared via dilution of the ‘10’ solution with LB and kept on ice to prevent bacterial growth. A ‘0’ density solution was prepared with just LB.</p><p>For all experiments, these density solutions were seeded onto cold, low-moisture nematode growth medium (NGM) plates (3% agar) to facilitate pipetting of small, circular, quick-drying patches. Unless otherwise noted, seeded plates were immediately returned to 4°C after patches dried to prevent bacterial growth. Plates were stored at 4°C for an average of 6 days before experimentation.</p><p>For experiments using an OP50 strain expressing green fluorescent protein (OP50-GFP) (<xref ref-type="bibr" rid="bib48">Labrousse et al., 2000</xref>), cultures were prepared as above, but with the addition of 100 µg/ml of carbenicillin to the liquid LB. All bacterial strains used in this study are listed in the Key Resources table.</p></sec><sec id="s4-2"><title>Nematode cultures</title><p><italic>C. elegans</italic> strains were maintained under standard conditions at 20°C on NGM plates (1.7% agar) seeded with stock liquid culture of OP50 (<xref ref-type="bibr" rid="bib7">Brenner, 1974</xref>). All experiments were performed on young adult hermaphrodites, picked as L4 larvae the day before the experiment (<italic>μ</italic> = 24.6 hr, <italic>σ</italic> = 3.4). Unless otherwise indicated, well-fed animals of the standard <italic>C. elegans</italic> strain N2 Bristol were used for experiments. Transgenic strains were always compared to matched controls tested in parallel on the same days. All <italic>C. elegans</italic> strains used in this study are listed in the Key Resources table.</p></sec><sec id="s4-3"><title>Assay preparation and recording</title><sec id="s4-3-1"><title>Single-density, multi-patch assay</title><p>Several days before the experiment, condition and acclimation plates were prepared (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1A</xref>). For the condition plates, a large circular arena (30 mm in diameter) made of clear transparency film (6 mil, PET) was cut using a computer-controlled cutting machine (Cricut Maker 3) and placed in the center of a 10-cm Petri dish filled with 25 ml of NGM (3% agar). These arenas function to corral animals with a low probability of escape (<xref ref-type="bibr" rid="bib72">Quach et al., 2024</xref>). A pipetting template made of the same material was designed and cut with an isometric grid consisting of 19 circular holes spaced 6 mm apart from center-to-center. The pipetting template was overlaid on top of the arena and 0.5 µl of OP50 solution (OD<sub>600</sub> = {0, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 10}) was pipetted into each hole. After drying, the template was immediately removed, and the Petri dish lid replaced to prevent contamination and dehydration. For two conditions (‘1 (12H)’ and ‘1 (48H)’), plates were seeded with OD<sub>600</sub> = 1 and then left at room temperature for 12 or 24 hr, respectively, prior to storage at 4°C. For all other conditions, plates were immediately stored at 4°C after drying. Acclimation plates were prepared by seeding NGM (3% agar) plates with one large patch of 200 µl of OD<sub>600</sub> = 1 grown for 24 hr at room temperature.</p><p>Approximately 24 hr before the experiment, acclimation plates and ‘1 (48H)’ condition plates were transferred from 4°C to room temperature. After plates warmed to room temperature (~1 hr), 30–60 L4 animals were picked onto the acclimation plates. Plates were then stored at 20°C until the experiment for a combined bacterial growth time of approximately 48 hr (24 hr from freshly seeded to 4°C; 24 hr from 4°C to experiment). The combined bacterial growth time for all condition plates was approximately 1 hr (<italic>μ</italic> = 1.16 hr, <italic>σ</italic> = 0.23) unless otherwise noted as ‘12’ (<italic>μ</italic> = 13.63 hr, <italic>σ</italic> = 0.50) or ‘48’ hr (<italic>μ</italic> = 49.28 hr, <italic>σ</italic> = 2.94).</p><p>On the day of the experiment, each set of condition plates was transferred from 4°C to room temperature. After 1 hr, four young adult animals were gently transferred to an empty NGM plate to limit the spread of bacteria from acclimation to condition plates. Animals were then quickly transferred to a condition plate. Animals were transferred using the flat surface of cylindrical plugs excised from clean 3% agar (<xref ref-type="bibr" rid="bib71">Quach and Chalasani, 2022</xref>; <xref ref-type="bibr" rid="bib72">Quach et al., 2024</xref>). Importantly, the use of agar as a medium to transfer animals provides minimal disruption to their environment as all physical properties (e.g., temperature, humidity, and surface tension) are maintained. Qualitatively, we observe no marked change in behavior from before to after transfer with the agar plug method, especially as compared to the often drastic changes observed when using a metal or eyelash pick.</p><p>Condition plates were subsequently placed face down on a piece of glass suspended above an edge-lit backlight (Advanced Illumination). Recordings were acquired using PixeLink cameras (PL-B741F) combined with Navitar lenses (1-60135 and 1-6044) and Streampix 8 software. Behavior was recorded for 1 hr at 1024 × 1024 pixels and 3 frames per second (fps) with spatial resolution of ~33 pixels per mm (<italic>μ</italic> = 32.68 pixels/mm, <italic>σ</italic> = 1.70).</p><p>The assay was repeated over numerous days with every condition assayed on each day when possible. The order of seeding assay plates and recording behavior was randomized for each day to compensate for the potential effects of time on animal age and bacterial density. Further, the average temperature (<italic>μ</italic> = 21.99°C, <italic>σ</italic> = 0.95) and humidity (<italic>μ</italic> = 51.39%, <italic>σ</italic> = 11.67) during each experiment were recorded. As a result of randomization, animal age, bacterial growth time, temperature, and humidity did not significantly vary between density conditions. Replication of the assay was constrained by the setup (~4 hr per day), recording (1–2 hr per animal), and analysis (0.5–1 hr per animal) time required. A maximum of 24 animals (2 cameras run for 12 hr) could be assayed per day. Given these resource constraints, we collected replicates until saturation of qualitative observations (i.e., new animals merely replicated earlier observations without adding new information) (<xref ref-type="bibr" rid="bib59">Morse, 1995</xref>) resulting in sample sizes comparable to similar studies (<xref ref-type="bibr" rid="bib44">Iwanir et al., 2016</xref>; <xref ref-type="bibr" rid="bib66">Pradhan et al., 2019</xref>).</p></sec><sec id="s4-3-2"><title>Large, single-patch assay</title><p>Plates were prepared as described for the single-density, multi-patch assay with the exception that only one large patch was created by pipetting 20 µl of OP50 solution (OD<sub>600</sub> = {0, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 10}) into the center of the 30-mm diameter arena.</p></sec><sec id="s4-3-3"><title>Small, single-patch assay</title><p>Plates were prepared as described for the single-density, multi-patch assay with the exception that only one small patch was created by pipetting 0.5 µl of OP50 solution (OD<sub>600</sub> = {0, 0.5, 1, 5, 10}) into the center of a 9-mm diameter arena. Given the smaller arena size, only one young adult animal was transferred into the arena. Behavior was recorded for 1 hr at higher spatial (<italic>μ</italic> = 104.76 pixels/mm, <italic>σ</italic> = 17.6) and temporal resolution (8 fps). The acquisition setup was otherwise unaltered except for the removal of a ×0.25 Navitar lens (1-6044) from the light path.</p></sec><sec id="s4-3-4"><title>Multi-density, multi-patch assay</title><p>Plates were prepared as described for the single-density, multi-patch assay with the exception that varying combinations of OD<sub>600</sub> = {1, 5, 10} (i.e., OD<sub>600</sub> = {1, 5, 10, 1 + 5, 1 + 10, 1 + 5 + 10}) were pipetted onto each assay plate in a patterned isometric grid of 18 0.5 µl droplets. Behavior was recorded for 2 hr. To compensate for the longer duration recordings, NGM agar plates were poured without Bacto peptone (BD 211677) to prevent bacterial growth. The result of this change was that the relative density of bacterial patches was ~30% lower as compared to comparable 0.5 µl patches in the single-density, multi-patch assay and the small, single-patch assay (<xref ref-type="fig" rid="fig2s2">Figure 2—figure supplements 2</xref> and <xref ref-type="fig" rid="fig2s3">3</xref>). Further, to prevent censorship of our data at the beginning of the recording, we formed a small droplet of S-Complete solution (<xref ref-type="bibr" rid="bib90">Sulston and Brenner, 1974</xref>) in the middle of the arena where no bacterial patch was placed. Animals were transferred to this droplet using an eyelash pick immediately prior to the assay plate being placed on the imaging setup. The recording was started once the droplet evaporated and animals were free to crawl about the arena. This process ensured that recordings began prior to an animal’s first patch encounter.</p></sec></sec><sec id="s4-4"><title>Bacterial patch location detection</title><p>Most bacterial densities tested in these experiments were too dilute to be visible under normal imaging conditions. Therefore, several strategies were employed to accurately detect the location of bacterial patches. First, a small reference dot was cut into the arena and pipetting templates enabling consistent and traceable patch placement. Further, prior to each behavior recording, a ‘contrast’ video was acquired wherein a piece of dark cardstock was passed between the light source and the condition plate (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1B–D</xref>, <xref ref-type="video" rid="video2">Video 2</xref>). This produced an effect where diffraction of light through the patches provided enough contrast to view the patches. Binary masks of the circular arena and patches were extracted from these videos in MATLAB using the Image Processing Toolbox and further refined manually in Photoshop (Adobe, 2024). Arena masks were used to calculate the scale (pixels/mm) of each image. In early experiments, the ‘contrast’ video was acquired prior to worms being added to the condition plate, which resulted in displacement of the arena within the camera’s field of view. Image registration using MATLAB’s Computer Vision Toolbox was performed to accurately map the patches detected in the ‘contrast’ video onto the behavioral recording.</p></sec><sec id="s4-5"><title>Bacterial patch density estimation</title><p>As described above (see Assay preparation and recording), we varied the relative density of bacterial solutions by diluting OP50 in LB and growing patches for different lengths of time. As a result of these procedures, the relative bacterial density throughout the assay was not known and needed to be estimated. To determine the relative density of these bacterial patches, we seeded plates with fluorescently labeled OP50-GFP under identical conditions as in our assays (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1A</xref>). We imaged these bacterial patches for several hours using a Zeiss Axio Zoom.V16. Images were analyzed using the Image Processing Toolbox in MATLAB. After correcting for inconsistent illumination across the field of view and normalizing images using matched controls (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1B, C</xref>), we detected the location of each bacterial patch and extracted a fluorescence intensity profile along each patch’s radius (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1D</xref>). Consistent with previous studies, we found that even in extremely dilute conditions, bacterial density was greater at the patch edge where actively proliferating bacteria are concentrated (<xref ref-type="bibr" rid="bib31">Gloria-Soria and Azevedo, 2008</xref>; <xref ref-type="bibr" rid="bib37">Hallatschek et al., 2007</xref>). Therefore, we detected the patch edge and computed the peak amplitude of each bacterial patch at all time points assayed (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1E</xref>). We then performed linear regression on the values for each condition to create models of peak amplitude as a function of time. For low-density conditions (i.e., OD<sub>600</sub> = {0.05, 0.1}) of small patches, fluorescent signals could not be detected. We therefore estimated these functions from a multinomial regression of values taken from OD<sub>600</sub> = {0.5, 1, 2}. Through this process, we used the total time that bacteria were allowed to grow at room temperature for each condition plate to estimate the peak amplitude at each time point (<xref ref-type="fig" rid="fig2s3">Figure 2—figure supplement 3</xref>). Finally, to minimize confusion about density conditions between experiments, we computed values for relative density by linearly scaling estimated peak amplitude values so that 0.5 µl patches seeded with OD<sub>600</sub> = 10 and grown for 1 hr at room temperature would have relative density equal to 10. We labeled each condition using the relative density rounded to one significant digit.</p></sec><sec id="s4-6"><title>Behavioral tracking</title><p>WormLab (MBF Bioscience) was used for tracking animal behavior (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1E–G</xref>, <xref ref-type="video" rid="video3">Video 3</xref>). For each video, we adjusted thresholds for pixel intensity and worm dimensions to enable automatic tracking. WormLab then fit the worm’s body at every frame and stitched together a track of each worm across frames. Subsequent manual corrections were required for instances where the software created new worm tracks. This occurred most frequently when animals: (1) encountered the arena border, (2) collided with each other, or (3) overlapped with bubbles or dust particles embedded in the agar. To correct for these discontinuities, we manually ‘stitched’ worm tracks together enabling us to keep track of each animal’s location throughout the duration of the experiment. We exported the location of each animal’s midpoint for further analysis in MATLAB (Mathworks, 2024a). For small, single-patch assays where higher spatial resolution enabled reliable distinction between the head and tail of the animal, we manually confirmed the head–tail and exported 25 points along the animal’s midline (<xref ref-type="fig" rid="fig1s2">Figure 1—figure supplement 2A–C</xref>).</p><p>Animals were excluded from analyses when (1) the animal’s location could only be tracked for less than 75% of the video due to the animal escaping the arena and when (2) the location of bacterial patches could not be reliably assessed due to missing or low-quality ‘contrast’ videos (see Bacterial patch location detection).</p></sec><sec id="s4-7"><title>Patch encounter detection</title><p>As the head position of animals in our experiments was difficult to track due to low spatial resolution and limited automated detection of head position using WormLab, we instead tracked the midpoint position of the worm’s body and estimated patch encounters using a set of measured criteria. To do this, we tracked the behavior of worms in higher resolution (~105 pixels/mm compared to ~33 pixels/mm and 8 fps compared to 3 fps), single patch assays (<xref ref-type="fig" rid="fig1s2">Figure 1—figure supplement 2A–C</xref>). We found that when the head of the animal was in contact (i.e., within 1 pixel) with the patch edge (see Bacterial patch location detection), the animal’s midpoint was on average 0.46024 mm away (<xref ref-type="fig" rid="fig1s2">Figure 1—figure supplement 2D</xref>). We therefore defined a patch encounter as the time when an animal’s midpoint came within 0.46024 mm of the patch edge. However, this definition led to two types of errors: (1) putative entry events where the animal merely passed by the patch and (2) putative leaving events where the animal did not fully leave the patch.</p><p>To remove putative entry events where the animal nearly passed by the patch, we defined an additional distance threshold based on the distance between the animal’s midpoint and the patch edge for all time points when the head was within the patch (<xref ref-type="fig" rid="fig1s2">Figure 1—figure supplement 2E</xref>). The midpoint was almost always (99% of the time) within 0.28758 mm of the patch edge. Therefore, we removed patch encounters where the midpoint never got closer than 0.28758 mm from the patch edge. Although this criterion removes most ‘near-miss’ events, some events remain where the animal approached the patch, but its head never entered. Further decreasing this threshold (e.g., midpoint must be on patch) would result in real events being excluded due to the animal taking on specific postures where the midpoint remains outside the patch while feeding within the patch. Therefore, we chose to be more liberal (i.e., more false positive patch encounters than false negatives) in our detection of patch encounters. Subsequent analysis of these putative patch encounters removed the majority of remaining false positives (see Patch encounter classification as sensing or non-responding).</p><p>To address putative leaving events and avoid splitting a single patch encounter into multiple encounters, we considered that a lawn leaving event is most frequently defined as an event where all body parts have left the patch (<xref ref-type="bibr" rid="bib79">Scheer and Bargmann, 2023</xref>). When tracking only the midpoint, it is not possible to ensure that the worm’s entire body has exited the patch. Using the criterion that an animal exits a patch when its midpoint exceeds 0.46024 mm from the patch edge accurately predicts exit events most of the time, but under certain scenarios (e.g., animals maintain an outstretched feeding posture <xref ref-type="bibr" rid="bib71">Quach and Chalasani, 2022</xref>) false leaving events were detected. To exclude these leaving events, we analyzed the variability in the distance from the midpoint to the patch edge during on- and off-patch events (<xref ref-type="fig" rid="fig1s2">Figure 1—figure supplement 2F</xref>). We found that on-patch events had low distance variability while off-patch events displayed a bimodal distribution, with some events having high variability as expected, and some events having low variability. We fit a two-component GMM to the off-patch distance variability and found that low variability leaving events could be reliably excluded when the standard deviation of off-patch distances was less than 0.22221. We subsequently combined putative patch encounters where variability was below this threshold, resulting in fewer overall encounters.</p></sec><sec id="s4-8"><title>Patch encounter classification as exploration or exploitation</title><p>To classify patch encounters as <italic>exploration</italic> or <italic>exploitation</italic> events, patch encounters were detected (see Patch encounter detection) and two features were computed: (1) duration of patch encounter and (2) average on-patch velocity. Both the duration and velocity features displayed a bimodal distribution with two visible clusters: one with short-duration encounters and high on-patch velocity and one with long-duration encounters and low on-patch velocity (<xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6A</xref>). To confirm the existence of two clusters, we conducted a modified version of Silverman’s test for bimodality (<xref ref-type="bibr" rid="bib1">Ahmed and Walther, 2012</xref>; <xref ref-type="bibr" rid="bib84">Silverman, 1981</xref>). Broadly, Silverman’s test uses kernel density estimation (KDE) to investigate the number of modes in a distribution. By solving for a critical bandwidth at which the KDE switches modality from <inline-formula><alternatives><mml:math id="inf125"><mml:mi>j</mml:mi></mml:math><tex-math id="inft125">\begin{document}$j$\end{document}</tex-math></alternatives></inline-formula> to <inline-formula><alternatives><mml:math id="inf126"><mml:mi>j</mml:mi><mml:mo>+</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft126">\begin{document}$j+1$\end{document}</tex-math></alternatives></inline-formula> modes, one is able to test the null hypothesis that a distribution has <inline-formula><alternatives><mml:math id="inf127"><mml:mi>j</mml:mi></mml:math><tex-math id="inft127">\begin{document}$j$\end{document}</tex-math></alternatives></inline-formula> modes, versus the alternative that it has more than <inline-formula><alternatives><mml:math id="inf128"><mml:mi>j</mml:mi></mml:math><tex-math id="inft128">\begin{document}$j$\end{document}</tex-math></alternatives></inline-formula> modes. Following a previously described protocol (<xref ref-type="bibr" rid="bib1">Ahmed and Walther, 2012</xref>; <xref ref-type="bibr" rid="bib84">Silverman, 1981</xref>), we tested the null hypothesis that our data set was unimodal (i.e., <inline-formula><alternatives><mml:math id="inf129"><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft129">\begin{document}$j=1$\end{document}</tex-math></alternatives></inline-formula>). We first mean-centered the matrix <inline-formula><alternatives><mml:math id="inf130"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft130">\begin{document}$\boldsymbol{z}_{k}$\end{document}</tex-math></alternatives></inline-formula> containing the log transforms of the duration and average velocity of each patch encounter <inline-formula><alternatives><mml:math id="inf131"><mml:mi>k</mml:mi></mml:math><tex-math id="inft131">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula>. We then calculated the projection of each data point onto the first principal component (PC1) of the data to get a one-dimensional distribution representing the data in <inline-formula><alternatives><mml:math id="inf132"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft132">\begin{document}$\boldsymbol{z}_{k}$\end{document}</tex-math></alternatives></inline-formula> (<xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6B</xref>). The use of principal <italic>components</italic> instead of principle <italic>curves</italic> as described previously was justified as both methods are indistinguishable when <inline-formula><alternatives><mml:math id="inf133"><mml:mi>j</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft133">\begin{document}$j=1$\end{document}</tex-math></alternatives></inline-formula> (<xref ref-type="bibr" rid="bib1">Ahmed and Walther, 2012</xref>). Two modes are visible in both the histogram and KDE of the distribution of PC1 projected data when the KDE is computed using a Gaussian kernel and Silverman’s Rule of Thumb for bandwidth (<xref ref-type="bibr" rid="bib85">Silverman, 1986</xref>) defined as <inline-formula><alternatives><mml:math id="inf134"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mrow><mml:mover><mml:mi>h</mml:mi><mml:mo stretchy="false">^</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mi>σ</mml:mi><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mfrac><mml:mn>4</mml:mn><mml:mrow><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>d</mml:mi><mml:mo>+</mml:mo><mml:mn>2</mml:mn></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mtext> </mml:mtext><mml:mi>n</mml:mi></mml:mrow></mml:mfrac><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mfrac><mml:mn>1</mml:mn><mml:mrow><mml:mi>d</mml:mi><mml:mo>+</mml:mo><mml:mn>4</mml:mn></mml:mrow></mml:mfrac></mml:mrow></mml:msup></mml:mrow></mml:mstyle></mml:math><tex-math id="inft134">\begin{document}$\hat {h}=\sigma \left (\frac{4}{\left (d+2\right)\ n}\right)^{\frac{1}{d+4}}$\end{document}</tex-math></alternatives></inline-formula> where, for this data set, <inline-formula><alternatives><mml:math id="inf135"><mml:mi>σ</mml:mi></mml:math><tex-math id="inft135">\begin{document}$\sigma $\end{document}</tex-math></alternatives></inline-formula> is the standard deviation, <inline-formula><alternatives><mml:math id="inf136"><mml:mi>d</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft136">\begin{document}$d=1$\end{document}</tex-math></alternatives></inline-formula> is the dimensionality, and <inline-formula><alternatives><mml:math id="inf137"><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn>6560</mml:mn></mml:math><tex-math id="inft137">\begin{document}$n=6560$\end{document}</tex-math></alternatives></inline-formula> is the number of observations. To test the significance of this distribution being bimodal rather than unimodal, we computed the critical bandwidth <inline-formula><alternatives><mml:math id="inf138"><mml:msup><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="inft138">\begin{document}$h^{*}$\end{document}</tex-math></alternatives></inline-formula> defined as the minimum bandwidth for which the KDE has only one mode. Following Silverman’s test procedure, we computed a smoothed bootstrap across 2000 replicates by sampling the data with replacement and adding noise such that for any data point <inline-formula><alternatives><mml:math id="inf139"><mml:msub><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft139">\begin{document}$z_{i}$\end{document}</tex-math></alternatives></inline-formula> and bootstrap resample <inline-formula><alternatives><mml:math id="inf140"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>b</mml:mi></mml:mrow></mml:mstyle></mml:math><tex-math id="inft140">\begin{document}$b$\end{document}</tex-math></alternatives></inline-formula>, we make noisy <inline-formula><alternatives><mml:math id="inf141"><mml:msub><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mo>~</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>z</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msup><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup><mml:msub><mml:mrow><mml:mi>ϵ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msqrt><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:msup><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:mfrac><mml:mrow><mml:msup><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:mrow><mml:mrow><mml:mi>σ</mml:mi></mml:mrow></mml:mfrac></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:msqrt></mml:mrow></mml:mfrac></mml:math><tex-math id="inft141">\begin{document}$\overset{\sim }{z}_{i,b}=\frac{z_{i}+h^{*}\epsilon _{i,b}}{\sqrt{1+\left (\frac{h^{*}}{\sigma }\right)^{2}}}$\end{document}</tex-math></alternatives></inline-formula> where <inline-formula><alternatives><mml:math id="inf142"><mml:msub><mml:mrow><mml:mi>ϵ</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi>b</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft142">\begin{document}$\epsilon _{i,b}$\end{document}</tex-math></alternatives></inline-formula> is a standard normal random variable independently drawn for each <inline-formula><alternatives><mml:math id="inf143"><mml:mi>i</mml:mi></mml:math><tex-math id="inft143">\begin{document}$i$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf144"><mml:mi>b</mml:mi></mml:math><tex-math id="inft144">\begin{document}$b$\end{document}</tex-math></alternatives></inline-formula>. We found that the critical bandwidth <inline-formula><alternatives><mml:math id="inf145"><mml:msup><mml:mrow><mml:mi>h</mml:mi></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="inft145">\begin{document}$h^{*}$\end{document}</tex-math></alternatives></inline-formula> of our data set was significantly (p &lt; 0.001) greater than that of the bootstrapped data sets, which allows us to reject the null hypothesis that the distribution of <inline-formula><alternatives><mml:math id="inf146"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft146">\begin{document}$\boldsymbol{z}_{k}$\end{document}</tex-math></alternatives></inline-formula> is unimodal and justifies the use of a two-cluster model in classifying these data (<xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6C</xref>).</p><p>After confirming the bimodality of the data set, we classified patch encounters using a two-component GMM to estimate <inline-formula><alternatives><mml:math id="inf147"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft147">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> where for each encounter <inline-formula><alternatives><mml:math id="inf148"><mml:mi>k</mml:mi></mml:math><tex-math id="inft148">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf149"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft149">\begin{document}$\boldsymbol{z}_{k}$\end{document}</tex-math></alternatives></inline-formula> are the log transforms of the duration and average velocity of the patch encounter, <inline-formula><alternatives><mml:math id="inf150"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft150">\begin{document}$y_{k}=1$\end{document}</tex-math></alternatives></inline-formula> indicates an <italic>exploitation</italic>, and <inline-formula><alternatives><mml:math id="inf151"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math><tex-math id="inft151">\begin{document}$y_{k}=0$\end{document}</tex-math></alternatives></inline-formula> indicates an <italic>exploration</italic> (<xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6D</xref>). We optimized the GMM across cross-validated replicates with respect to the regularization value <inline-formula><alternatives><mml:math id="inf152"><mml:mi>α</mml:mi></mml:math><tex-math id="inft152">\begin{document}$\alpha $\end{document}</tex-math></alternatives></inline-formula> to minimize the posterior variance given by<disp-formula id="equ2"><alternatives><mml:math id="m2"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:munder><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mspace width="thinmathspace"/><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:mstyle></mml:math><tex-math id="t2">\begin{document}$$\displaystyle  \sum _{k}p\left (y_{k}=1|\boldsymbol{z}_{k}\right) p\left (y_{k}=0|\,\boldsymbol{z}_{k}\right).$$\end{document}</tex-math></alternatives></disp-formula></p><p>We found that <inline-formula><alternatives><mml:math id="inf153"><mml:mi>α</mml:mi><mml:mo>=</mml:mo><mml:mn>0.025</mml:mn></mml:math><tex-math id="inft153">\begin{document}$\alpha =0.025$\end{document}</tex-math></alternatives></inline-formula> best separated the <italic>exploration</italic> and <italic>exploitation</italic> clusters (<xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6E</xref>). The posterior probability of <italic>exploitation</italic> <inline-formula><alternatives><mml:math id="inf154"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft154">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> was subsequently estimated for all encounters (<xref ref-type="fig" rid="fig2s6">Figure 2—figure supplement 6F, G</xref>).</p></sec><sec id="s4-9"><title>Patch encounter classification as sensing or non-responding</title><p>To classify patch encounters as <italic>sensing</italic> or <italic>non-responding</italic> events, we computed animals’ (1) deceleration upon encounter with the patch edge, (2) minimum velocity during the patch encounter, and (3) maximum change in velocity between the peak velocity immediately prior to the start of the patch encounter and the minimum velocity during the encounter (<xref ref-type="fig" rid="fig2s7">Figure 2—figure supplement 7A, B</xref>). Deceleration was defined as the slope of the line fit on an animal’s velocity between –1.5 s before and 6.5 s after the start of an encounter. Minimum velocity was defined as the absolute minimum velocity observed during the duration of the patch encounter. The maximum change in velocity was computed by subtracting the minimum velocity from the peak velocity within 10 s of the patch encounter. The combination of these three metrics reveals two non-Gaussian clusters confirmed by Silverman’s test (p = 0.003) as described in the previous section (<xref ref-type="fig" rid="fig2s7">Figure 2—figure supplement 7C–F</xref>). These clusters represent encounters where animals sensed the patch (i.e., slow minimum velocity, large changes in velocity) or did not respond to it (i.e., maintained fast minimum velocity, with little to no change).</p><p>We estimated the probability of <italic>sensing</italic> <inline-formula><alternatives><mml:math id="inf155"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">w</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft155">\begin{document}$p\left (v_{k}=1|\boldsymbol{w}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> where for each encounter <inline-formula><alternatives><mml:math id="inf156"><mml:mi>k</mml:mi></mml:math><tex-math id="inft156">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf157"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft157">\begin{document}$\boldsymbol{w}_{k} =\left (s_{k},t_{k},u_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> are the three velocity-related features, <inline-formula><alternatives><mml:math id="inf158"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft158">\begin{document}$v_{k}=1$\end{document}</tex-math></alternatives></inline-formula> indicates an encounter that was <italic>sensed</italic>, and <inline-formula><alternatives><mml:math id="inf159"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math><tex-math id="inft159">\begin{document}$v_{k}=0$\end{document}</tex-math></alternatives></inline-formula> indicates an encounter where <italic>no response</italic> was detected. Using a semi-supervised approach to QDA, we labeled a subset of all encounters and iteratively estimated labels on the remaining unlabeled data (<xref ref-type="fig" rid="fig2s8">Figure 2—figure supplement 8A–C</xref>, <xref ref-type="video" rid="video5">Video 5</xref>). To label the data, we made two simple assumptions: (1) animals must have sensed the patch if they exploited it and (2) animals must not have sensed the patch if there was no bacteria to sense. Therefore, all encounters with bacteria-free patches (i.e., LB only, relative density 0) were labeled as true negatives <inline-formula><alternatives><mml:math id="inf160"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math><tex-math id="inft160">\begin{document}$v_{k}=0$\end{document}</tex-math></alternatives></inline-formula> and, across 1000 replicates, we probabilistically included <italic>exploitation</italic> encounters <inline-formula><alternatives><mml:math id="inf161"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft161">\begin{document}$y_{k}=1$\end{document}</tex-math></alternatives></inline-formula> estimated from the distribution <inline-formula><alternatives><mml:math id="inf162"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mo> </mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft162">\begin{document}$y_{k}|\boldsymbol{z}_{k}\sim \text{Bern}\left (p\left (y_{k}=1|\boldsymbol{z}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> as true positives <inline-formula><alternatives><mml:math id="inf163"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft163">\begin{document}$v_{k}=1$\end{document}</tex-math></alternatives></inline-formula>. The semi-supervised QDA method then used these initial labels to iteratively fit a paraboloid that best separated the labeled data, by minimizing the posterior variance of classification. Using this approach, the conditional probability of <italic>sensing</italic> <inline-formula><alternatives><mml:math id="inf164"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">w</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft164">\begin{document}$p\left (v_{k}=1|\boldsymbol{w}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> was estimated for all encounters using QDA and averaged across replicates (<xref ref-type="fig" rid="fig2s8">Figure 2—figure supplement 8D–E</xref>).</p><p>Although we found that the two clusters were successfully discriminated by this semi-supervised QDA approach, a small subset of encounters (252 of 20109 encounters) could not be reliably classified in this manner as the onset of the patch encounter was not observed. This type of data censoring occurred when the behavioral recording was started after the animal had already entered the patch. Although we could compute deceleration-related metrics for these encounters with the assumption that the animal entered the patch at the first frame, these measurements are censored with a bias toward lower magnitudes of deceleration. Therefore, to better predict the conditional probabilities of <italic>sensing</italic> for these 252 encounters, we assumed that the minimum velocity on-patch <inline-formula><alternatives><mml:math id="inf165"><mml:msub><mml:mrow><mml:mi>s</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft165">\begin{document}$s_{k}$\end{document}</tex-math></alternatives></inline-formula> was a reliable metric and marginalized the conditional probabilities over the other two metrics (<inline-formula><alternatives><mml:math id="inf166"><mml:msub><mml:mrow><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft166">\begin{document}$t_{k}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf167"><mml:msub><mml:mrow><mml:mi>u</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft167">\begin{document}$u_{k}$\end{document}</tex-math></alternatives></inline-formula>) as defined by<disp-formula id="equ3"><alternatives><mml:math id="m3"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:msubsup><mml:mo>∫</mml:mo><mml:mrow><mml:mo>−</mml:mo><mml:mrow><mml:mi mathvariant="normal">∞</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">∞</mml:mi></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mrow><mml:msubsup><mml:mo>∫</mml:mo><mml:mrow><mml:mo>−</mml:mo><mml:mrow><mml:mi mathvariant="normal">∞</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mrow><mml:mi mathvariant="normal">∞</mml:mi></mml:mrow></mml:mrow></mml:msubsup></mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mtext> </mml:mtext><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>t</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mtext> </mml:mtext><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi>s</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mi>d</mml:mi><mml:mi>t</mml:mi><mml:mtext> </mml:mtext><mml:mi>d</mml:mi><mml:mi>u</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mstyle></mml:math><tex-math id="t3">\begin{document}$$\displaystyle p\left (v_{k}=1|s_{k}\right)={\int_{-\mathrm{\infty }}^{\mathrm{\infty }}}{\int _{-\mathrm{\infty }}^{\mathrm{\infty }}}p\left (v_{k}=1 | s_{k},t_{k},u_{k}\right)\ p\left (t_{k},u_{k}\ |s_{k}\right) dt\ du.$$\end{document}</tex-math></alternatives></disp-formula></p><p>We numerically integrated using an adaptive quadrature method over the product of the QDA estimated conditional probability distribution and the KDE of the joint probability distribution. This procedure resulted in a slight increase (<italic>μ</italic> = +0.0615, <italic>σ</italic> = 0.1832) in our estimation of the probability of <italic>sensing</italic> (<xref ref-type="fig" rid="fig2s8">Figure 2—figure supplement 8F</xref>).</p><p>Altogether, this classification approach resulted in low false positive and false negative rates. Specifically, 3.35% of the time encounters with bacteria-free patches were incorrectly identified as <italic>sensing</italic>, while 2.92% of the time <italic>exploitatory</italic> encounters were incorrectly identified as <italic>non-responding</italic>. Further, this classification removed many of the remaining near-miss patch encounters in which animals came close to but did not truly enter the patch (see Patch encounter detection). For all analyses, we excluded near-miss encounters where the animal’s midpoint never entered the patch and the probability of <italic>sensing</italic> was less than 5% (i.e., <inline-formula><alternatives><mml:math id="inf168"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>&lt;</mml:mo><mml:mn>0.05</mml:mn></mml:mrow></mml:mstyle></mml:math><tex-math id="inft168">\begin{document}$p\left (v_{k}=1|\boldsymbol{w}_{k}\right) \lt 0.05$\end{document}</tex-math></alternatives></inline-formula>).</p></sec><sec id="s4-10"><title>Models of exploitation probability</title><p>We consider that the probability of <italic>exploiting</italic> a patch upon any given encounter can be described by a logistic function:<disp-formula id="equ4"><alternatives><mml:math id="m4"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mo>=</mml:mo><mml:mfrac><mml:mn>1</mml:mn><mml:mrow><mml:mn>1</mml:mn><mml:mo>+</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mo>−</mml:mo><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:mfrac><mml:mo>,</mml:mo></mml:mrow></mml:mstyle></mml:math><tex-math id="t4">\begin{document}$$\displaystyle p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right) = \frac{1}{1 + e^{-\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}}},$$\end{document}</tex-math></alternatives></disp-formula></p><p>where <inline-formula><alternatives><mml:math id="inf169"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft169">\begin{document}$p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> represents the conditional probability that an animal exploited during patch encounter <inline-formula><alternatives><mml:math id="inf170"><mml:mi>k</mml:mi></mml:math><tex-math id="inft170">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula>; <inline-formula><alternatives><mml:math id="inf171"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∈</mml:mo><mml:msup><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="inft171">\begin{document}$\boldsymbol{x}_{k}\in R^{n}$\end{document}</tex-math></alternatives></inline-formula> is a vector of covariates; and <inline-formula><alternatives><mml:math id="inf172"><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>∈</mml:mo><mml:msup><mml:mrow><mml:mi>R</mml:mi></mml:mrow><mml:mrow><mml:mi>n</mml:mi></mml:mrow></mml:msup></mml:math><tex-math id="inft172">\begin{document}$\boldsymbol{\beta }\in R^{n}$\end{document}</tex-math></alternatives></inline-formula> is a vector of weights that describes how much each covariate influences the animal’s choice. In models compared here, <inline-formula><alternatives><mml:math id="inf173"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft173">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> includes a combination of a constant element as well as covariates that may empirically influence the decision to exploit: (1) the log-transformed relative density of the encountered patch <inline-formula><alternatives><mml:math id="inf174"><mml:mi>k</mml:mi></mml:math><tex-math id="inft174">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula> (<inline-formula><alternatives><mml:math id="inf175"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft175">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>), (2) the duration of time spent off food since departing the last <italic>exploited</italic> patch (<inline-formula><alternatives><mml:math id="inf176"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft176">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>), (3) the log-transformed relative density of the patch encountered immediately before encounter <inline-formula><alternatives><mml:math id="inf177"><mml:mi>k</mml:mi></mml:math><tex-math id="inft177">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula> (<inline-formula><alternatives><mml:math id="inf178"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft178">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula>), and (4) the log-transformed relative density of the last <italic>exploited</italic> patch (<inline-formula><alternatives><mml:math id="inf179"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft179">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>).</p><p>The observations of <italic>exploitation</italic> and <italic>sensation</italic> for our data are derived predictions from classification models rather than direct measurements (see Patch encounter classification as exploration or exploitation and Patch encounter classification as sensing or non-responding). As such, the labels for both whether a patch encounter was <italic>sensed</italic> by the animal <inline-formula><alternatives><mml:math id="inf180"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">w</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft180">\begin{document}$p\left (v_{k}=1|\boldsymbol{w}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> and whether the animal <italic>exploited</italic> the patch <inline-formula><alternatives><mml:math id="inf181"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft181">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula>, are both reported as probabilities rather than binary, deterministic variables.</p><p>To account for uncertainty in <italic>sensation</italic>, we produced 100 sets of ‘encounter sampled’ observations wherein we probabilistically included <italic>sensed</italic> encounters <inline-formula><alternatives><mml:math id="inf182"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft182">\begin{document}$v_{k}=1$\end{document}</tex-math></alternatives></inline-formula> estimated from the distribution <inline-formula><alternatives><mml:math id="inf183"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mo> </mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft183">\begin{document}$v_{k}|\boldsymbol{w}_{k}\sim \text{Bern}\left (p\left (v_{k}=1|\boldsymbol{w}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula>. In doing so, we assume that only patch encounters recognized by the animal guide the decision to <italic>exploit</italic> (<xref ref-type="fig" rid="fig4">Figure 4B</xref>). After removing <italic>non-responding</italic> encounters where <inline-formula><alternatives><mml:math id="inf184"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math><tex-math id="inft184">\begin{document}$v_{k}=0$\end{document}</tex-math></alternatives></inline-formula>, we defined observations of all covariates (i.e., <inline-formula><alternatives><mml:math id="inf185"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft185">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf186"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft186">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf187"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft187">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula>, and <inline-formula><alternatives><mml:math id="inf188"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft188">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>) using only <italic>sensed</italic> encounters.</p><p>To account for uncertainty in <italic>exploitation</italic>, we modified the standard maximum likelihood. To understand our approach, consider that standard logistic regression models binary observations as realizations of the Bernoulli distribution <inline-formula><alternatives><mml:math id="inf189"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mo> </mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft189">\begin{document}$y_{k}|\boldsymbol{x}_{k}\sim \text{Bern}\left (p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula> and that the likelihood for this model is given by<disp-formula id="equ5"><alternatives><mml:math id="m5"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:munder><mml:mo>∏</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:munder><mml:mi>p</mml:mi><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup><mml:mo>.</mml:mo></mml:mrow></mml:mstyle></mml:math><tex-math id="t5">\begin{document}$$\displaystyle \prod _{k}p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)^{y_{k}} \left (1-p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\right)^{1-y_{k}}.$$\end{document}</tex-math></alternatives></disp-formula></p><p>However, we do not have direct observations of <inline-formula><alternatives><mml:math id="inf190"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft190">\begin{document}$y_{k}$\end{document}</tex-math></alternatives></inline-formula> and cannot evaluate the logistic likelihood directly. Rather, we have posterior probabilities of <italic>exploitation</italic> determined by a classifier, denoted by <inline-formula><alternatives><mml:math id="inf191"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft191">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula>, where <inline-formula><alternatives><mml:math id="inf192"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft192">\begin{document}$\boldsymbol{z}_{k}$\end{document}</tex-math></alternatives></inline-formula> are a set of velocity-related features that are distinct from <inline-formula><alternatives><mml:math id="inf193"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft193">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> (see Patch encounter classification as exploration or exploitation). Thus, rather than maximizing the Bernoulli likelihood, we accommodate our uncertainty about <inline-formula><alternatives><mml:math id="inf194"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft194">\begin{document}$y_{k}$\end{document}</tex-math></alternatives></inline-formula> by learning the regression parameters that minimize the Kullback–Leibler (KL) divergence between <inline-formula><alternatives><mml:math id="inf195"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft195">\begin{document}$p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> and the reference probability distribution <inline-formula><alternatives><mml:math id="inf196"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft196">\begin{document}$p\left (y_{k}|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> as given by<disp-formula id="equ6"><alternatives><mml:math id="m6"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"><mml:mtr><mml:mtd><mml:msub><mml:mrow><mml:mi mathvariant="normal">D</mml:mi></mml:mrow><mml:mrow><mml:mi>K</mml:mi><mml:mi>L</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>≡</mml:mo></mml:mtd><mml:mtd><mml:mspace width="thinmathspace"/><mml:mstyle displaystyle="true" scriptlevel="0"><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mfrac><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mfrac><mml:mo>]</mml:mo></mml:mrow></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mspace width="thinmathspace"/><mml:mstyle displaystyle="true" scriptlevel="0"><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mspace width="thinmathspace"/><mml:mstyle displaystyle="true" scriptlevel="0"><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:munder><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup><mml:mtext> </mml:mtext><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mspace width="thinmathspace"/><mml:mstyle displaystyle="true" scriptlevel="0"><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi></mml:mrow></mml:msub><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mtext> </mml:mtext></mml:mrow><mml:mrow><mml:mtext> </mml:mtext></mml:mrow><mml:mo>−</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>]</mml:mo></mml:mrow></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mo>=</mml:mo></mml:mtd><mml:mtd><mml:mspace width="thinmathspace"/><mml:mstyle displaystyle="true" scriptlevel="0"><mml:msub><mml:mi>C</mml:mi><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi></mml:mrow></mml:msub></mml:mstyle></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mo>−</mml:mo><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>,</mml:mo></mml:mstyle></mml:mtd></mml:mtr></mml:mtable></mml:mstyle></mml:mrow></mml:mstyle></mml:math><tex-math id="t6">\begin{document}$$\displaystyle  \begin {aligned} \mathrm{D}_{KL}\left [p\left (y_{k}|\boldsymbol{z}_{k}\right )||p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right )\right ] \equiv &amp;\,  \sum _{y_{k}}p\left (y_{k}|\boldsymbol{z}_{k}\right )\log \left [\frac{p\left (y_{k}|\boldsymbol{z}_{k}\right )}{p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right )}\right ]\\ = &amp;\,  C_{\boldsymbol{\beta }}-\sum _{y_{k}}p\left (y_{k}|\boldsymbol{z}_{k}\right )\log \left [p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right )\right ]\\ = &amp;\,  C_{\boldsymbol{\beta }}-\sum _{y_{k}}p\left (y_{k}|\boldsymbol{z}_{k}\right )\log \left [p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right )^{y_{k}}\ \left (1-p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right )\right )^{1-y_{k}}\right ]\\ =&amp;\,  C_{\boldsymbol{\beta }}-p\left (y_{k}=1|\boldsymbol{z}_{k}\right )\log \left [p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right )\right ]\\ &amp;  \mathrm{\ }\mathrm{\ }-\left (1-p\left (y_{k}=1|\boldsymbol{z}_{k}\right )\right )\log \left [1-p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right )\right ]\\ = &amp;\,  C_{\boldsymbol{\beta }}\\ &amp;  -\log \left [p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)^{p\left (y_{k}=1|\boldsymbol{z}_{k}\right)}\left (1-p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\right)^{1-p\left (y_{k}=1|\boldsymbol{z}_{k}\right)}\right ], \end {aligned}$$\end{document}</tex-math></alternatives></disp-formula></p><p>where <inline-formula><alternatives><mml:math id="inf197"><mml:msub><mml:mrow><mml:mi>C</mml:mi></mml:mrow><mml:mrow><mml:mi>β</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft197">\begin{document}$C_{\beta }$\end{document}</tex-math></alternatives></inline-formula> is a term that is constant with respect to <inline-formula><alternatives><mml:math id="inf198"><mml:mi mathvariant="bold-italic">β</mml:mi></mml:math><tex-math id="inft198">\begin{document}$\boldsymbol{\beta }$\end{document}</tex-math></alternatives></inline-formula>, and the second term is equivalent to the logarithm of the logistic likelihood with <inline-formula><alternatives><mml:math id="inf199"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft199">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> replacing <inline-formula><alternatives><mml:math id="inf200"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft200">\begin{document}$y_{k}$\end{document}</tex-math></alternatives></inline-formula>. Put plainly, minimizing the sum of the KL divergence between our classifier probabilities and logistic regression probabilities over all encounters <inline-formula><alternatives><mml:math id="inf201"><mml:mi>k</mml:mi></mml:math><tex-math id="inft201">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula> is equivalent to maximizing the logistic likelihood with our classifier-based <italic>exploitation</italic> probabilities <inline-formula><alternatives><mml:math id="inf202"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft202">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> as observations instead of direct measurements of <italic>exploitation</italic> <inline-formula><alternatives><mml:math id="inf203"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft203">\begin{document}$y_{k}$\end{document}</tex-math></alternatives></inline-formula> as given by<disp-formula id="equ7"><alternatives><mml:math id="m7"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:munder><mml:mo>∑</mml:mo><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:munder><mml:mi>log</mml:mi><mml:mo>⁡</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn>1</mml:mn><mml:mo>−</mml:mo><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:msup></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:mstyle></mml:math><tex-math id="t7">\begin{document}$$\displaystyle  \sum _{k}\log \left [p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)^{p\left (y_{k}=1|\boldsymbol{z}_{k}\right)}\left (1-p\left (y_{k}|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\right)^{1-p\left (y_{k}=1|\boldsymbol{z}_{k}\right)}\right].$$\end{document}</tex-math></alternatives></disp-formula></p><p>Notably, when there is no observation uncertainty, <inline-formula><alternatives><mml:math id="inf204"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft204">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> collapses to a delta function on <inline-formula><alternatives><mml:math id="inf205"><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft205">\begin{document}$y_{k}=1$\end{document}</tex-math></alternatives></inline-formula> and we recover the standard likelihood function. Thus, our method is a generalization of maximum likelihood. To train our model, we therefore fit a standard logistic regression GLM where we provided sets of observations of covariates <inline-formula><alternatives><mml:math id="inf206"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft206">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> and response variables <inline-formula><alternatives><mml:math id="inf207"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft207">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> for <italic>sensed</italic> encounters.</p><p>The covariates <inline-formula><alternatives><mml:math id="inf208"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft208">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> included the relative density of the encountered patch <inline-formula><alternatives><mml:math id="inf209"><mml:mi>k</mml:mi></mml:math><tex-math id="inft209">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula> (<inline-formula><alternatives><mml:math id="inf210"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft210">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>), the duration of time spent off food since departing the last <italic>exploited</italic> patch (<inline-formula><alternatives><mml:math id="inf211"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft211">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>), the relative density of the patch encountered immediately before encounter <inline-formula><alternatives><mml:math id="inf212"><mml:mi>k</mml:mi></mml:math><tex-math id="inft212">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula> (<inline-formula><alternatives><mml:math id="inf213"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft213">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula>), and the relative density of the last <italic>exploited</italic> patch (<inline-formula><alternatives><mml:math id="inf214"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft214">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>). For every encounter <inline-formula><alternatives><mml:math id="inf215"><mml:mi>k</mml:mi></mml:math><tex-math id="inft215">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf216"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft216">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula> is the log-transformed relative density of the encounter patch as estimated from experiments using a fluorescent bacterial strain, OP50-GFP (as described in Bacterial patch density estimation). <inline-formula><alternatives><mml:math id="inf217"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft217">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula> is the duration of time spent off food since the beginning of the recorded experiment (i.e., total time elapsed minus duration of time on patch). For the first patch encounter (i.e., <inline-formula><alternatives><mml:math id="inf218"><mml:mi>k</mml:mi><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:math><tex-math id="inft218">\begin{document}$k=1$\end{document}</tex-math></alternatives></inline-formula>), this is equivalent to the total time elapsed. <inline-formula><alternatives><mml:math id="inf219"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft219">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> is the log-transformed relative density of the patch encountered immediately before encounter <inline-formula><alternatives><mml:math id="inf220"><mml:mi>k</mml:mi></mml:math><tex-math id="inft220">\begin{document}$k$\end{document}</tex-math></alternatives></inline-formula>. For the first patch encounter, we initialized this parameter using the approximated relative density of the bacterial patch on the acclimation plates (see Assay preparation and recording in Methods). Acclimation plates contained one large 200 µl patch seeded with OD<sub>600</sub> = 1 and grown for a total of ~48 hr. The relative density of these acclimation plates was estimated using the same procedure used to estimate values of <inline-formula><alternatives><mml:math id="inf221"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft221">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula> (see Bacterial patch density estimation). <inline-formula><alternatives><mml:math id="inf222"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft222">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula> is the log-transformed relative density of the most recently <italic>exploited</italic> patch. For the first patch encounter as well as every encounter prior to the first observed <italic>exploitation</italic>, we assume that animals must have <italic>exploited</italic> within the last 24 hr while on the acclimation plates and thus initialized <inline-formula><alternatives><mml:math id="inf223"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft223">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula> using the approximated relative density of the bacterial patch on the acclimation plates.</p><sec id="s4-10-1"><title>Exploitation of single-density, multi-patch environments</title><p>As described above, we used an ‘encounter sampling’ protocol to generate 100 replicate observations of only <italic>sensed</italic> encounters by removing all encounters where <italic>sensing</italic> could not be determined (i.e., <inline-formula><alternatives><mml:math id="inf224"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math><tex-math id="inft224">\begin{document}$v_{k}=0$\end{document}</tex-math></alternatives></inline-formula>) as randomly estimated from the distribution <inline-formula><alternatives><mml:math id="inf225"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mo> </mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">w</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft225">\begin{document}$v_{k}|\boldsymbol{w}_{k}\sim \text{Bern}\left (p\left (v_{k}=1|\boldsymbol{w}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula>. For example, we can consider an animal foraging in the single-density, multi-patch environment (<xref ref-type="fig" rid="fig4">Figure 4B</xref>). Although we detected 10 total encounters <inline-formula><alternatives><mml:math id="inf226"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>K</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft226">\begin{document}$K=k_{1},k_{2},...,k_{10}$\end{document}</tex-math></alternatives></inline-formula>, several of these encounters had low probabilities of <italic>sensing</italic> <inline-formula><alternatives><mml:math id="inf227"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">w</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft227">\begin{document}$p\left (v_{k}=1|\boldsymbol{w}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> (<xref ref-type="fig" rid="fig4">Figure 4B</xref>). We use our ‘encounter sampling’ protocol to simulate the <italic>sensation</italic> of the patch during each of these 10 encounters and find that <inline-formula><alternatives><mml:math id="inf228"><mml:msub><mml:mrow><mml:mi>v</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0</mml:mn></mml:math><tex-math id="inft228">\begin{document}$v_{k}=0$\end{document}</tex-math></alternatives></inline-formula> for <inline-formula><alternatives><mml:math id="inf229"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>6</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft229">\begin{document}$k_{1},k_{3},k_{6}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf230"><mml:msub><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mrow><mml:mn>8</mml:mn></mml:mrow></mml:msub></mml:math><tex-math id="inft230">\begin{document}$k_{8}$\end{document}</tex-math></alternatives></inline-formula>. By removing these four no response encounters, we generate a new observation comprised of the six <italic>sensed</italic> encounters <inline-formula><alternatives><mml:math id="inf231"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mi>K</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>4</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>5</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>7</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>9</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>10</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>1</mml:mn><mml:mo>∗</mml:mo></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>2</mml:mn><mml:mo>∗</mml:mo></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>6</mml:mn><mml:mo>∗</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft231">\begin{document}$K_{1}^{*}=k_{2},k_{4},k_{5},k_{7},k_{9},k_{10}=k_{1*},k_{2*},...,k_{6*}$\end{document}</tex-math></alternatives></inline-formula>. Using only the data related to this new sequence of encounters <inline-formula><alternatives><mml:math id="inf232"><mml:msubsup><mml:mrow><mml:mi>K</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi>*</mml:mi></mml:mrow></mml:msubsup></mml:math><tex-math id="inft232">\begin{document}$K_{1}^{*}$\end{document}</tex-math></alternatives></inline-formula>, we generated a vector of covariates (i.e., <inline-formula><alternatives><mml:math id="inf233"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft233">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf234"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft234">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf235"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft235">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula>, and <inline-formula><alternatives><mml:math id="inf236"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft236">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>). Importantly, this procedure considers time spent during the <italic>no response</italic> encounters <inline-formula><alternatives><mml:math id="inf237"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mrow><mml:mn>6</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft237">\begin{document}$k_{1},k_{3},k_{6}$\end{document}</tex-math></alternatives></inline-formula>, and <inline-formula><alternatives><mml:math id="inf238"><mml:msub><mml:mrow><mml:mi>k</mml:mi></mml:mrow><mml:mrow><mml:mn>7</mml:mn></mml:mrow></mml:msub></mml:math><tex-math id="inft238">\begin{document}$k_{7}$\end{document}</tex-math></alternatives></inline-formula> the same as time spent searching off patch. We repeated this process 100 times to generate new observations of encounter sequences (i.e., <inline-formula><alternatives><mml:math id="inf239"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mi>K</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi>K</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>,</mml:mo><mml:msubsup><mml:mi>K</mml:mi><mml:mrow><mml:mn>100</mml:mn></mml:mrow><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msubsup></mml:mrow></mml:mstyle></mml:math><tex-math id="inft239">\begin{document}$K_{1}^{*},K_{2}^{*},...,K_{100}^{*}$\end{document}</tex-math></alternatives></inline-formula>). In doing so, we reduced the number of encounters from 6560 total encounters (as defined in Patch encounter detection) to 2604–2698 (<italic>μ</italic> = 2659.8, <italic>σ</italic> = 15.9) <italic>sensed</italic> encounters for each of the 100 replicates.</p><p>Additionally, we used a ‘worm sampling’ protocol to generate 500 hierarchically bootstrapped replicates (<xref ref-type="bibr" rid="bib77">Saravanan et al., 2020</xref>). Specifically, we took our vector of 443 animals <inline-formula><alternatives><mml:math id="inf240"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>A</mml:mi><mml:mo>=</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>443</mml:mn></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft240">\begin{document}$A = a_{1},a_{2},...,a_{443}$\end{document}</tex-math></alternatives></inline-formula> and resampled with replacement (e.g., <inline-formula><alternatives><mml:math id="inf241"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mi>A</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msubsup><mml:mo>=</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>317</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>88</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>130</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>1</mml:mn><mml:mo>∗</mml:mo></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>2</mml:mn><mml:mo>∗</mml:mo></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>,</mml:mo><mml:msub><mml:mi>a</mml:mi><mml:mrow><mml:mn>443</mml:mn><mml:mo>∗</mml:mo></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft241">\begin{document}$A_{1}^{*} = a_{317},a_{88},...,a_{130}= a_{1*},a_{2*},...,a_{443*}$\end{document}</tex-math></alternatives></inline-formula>) to generate 500 new samples <inline-formula><alternatives><mml:math id="inf242"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msubsup><mml:mi>A</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi>A</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msubsup><mml:mo>,</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>.</mml:mo><mml:mo>,</mml:mo><mml:msubsup><mml:mi>A</mml:mi><mml:mrow><mml:mn>500</mml:mn></mml:mrow><mml:mrow><mml:mo>∗</mml:mo></mml:mrow></mml:msubsup></mml:mrow></mml:mstyle></mml:math><tex-math id="inft242">\begin{document}$A_{1}^{*},A_{2}^{*},...,A_{500}^{*}$\end{document}</tex-math></alternatives></inline-formula>. When combined, the ‘encounter sampling’ and ‘worm sampling’ protocols created 50,000 unique replicates of observations of the covariates <inline-formula><alternatives><mml:math id="inf243"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft243">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> and response variables <inline-formula><alternatives><mml:math id="inf244"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft244">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> which were used to estimate the coefficients <italic>β</italic> (<xref ref-type="fig" rid="fig4">Figure 4C</xref>). A null distribution of coefficients <italic>β</italic><sup>∗</sup> was estimated by shuffling the response variable vector (<xref ref-type="fig" rid="fig4s1">Figure 4—figure supplement 1C</xref>). A two-tailed, one-sample bootstrap hypothesis test was used to assess whether our covariate estimates were significantly greater than or less than 0 (i.e., <inline-formula><alternatives><mml:math id="inf245"><mml:mi mathvariant="bold-italic">p</mml:mi><mml:mo>=</mml:mo><mml:mn>2</mml:mn><mml:mo>×</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mi mathvariant="normal">i</mml:mi><mml:mi mathvariant="normal">n</mml:mi><mml:mfenced open="[" close="]" separators="|"><mml:mrow><mml:mi>P</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>≤</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mfenced><mml:mo>,</mml:mo><mml:mi>P</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>≥</mml:mo><mml:mn>0</mml:mn></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:math><tex-math id="inft245">\begin{document}$\boldsymbol{p}=2\times \mathrm{m}\mathrm{i}\mathrm{n}\left [P\left (\boldsymbol{\beta }\leq 0\right),P\left (\boldsymbol{\beta }\geq 0\right)\right ]$\end{document}</tex-math></alternatives></inline-formula>).</p></sec><sec id="s4-10-2"><title>Exploitation of food-deprived animals in single-density, multi-patch environments</title><p>To validate model predictions related to the satiety signal covariate <inline-formula><alternatives><mml:math id="inf246"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft246">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>, a novel data set of well-fed and 3-hr food-deprived animals foraging in single-density, multi-patch environments of relative density 5 was generated (<xref ref-type="fig" rid="fig4s3">Figure 4—figure supplement 3A, B</xref>). The ‘encounter sampling’ protocol described above was used to generate 100 replicates of observations of the covariates <inline-formula><alternatives><mml:math id="inf247"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mstyle></mml:math><tex-math id="inft247">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> and response variables <inline-formula><alternatives><mml:math id="inf248"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft248">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> for this data set. As a result of ‘encounter sampling’, we reduced the number of encounters from 42 total encounters to 30–37 (<italic>μ</italic> = 34.6, <italic>σ</italic> = 1.3) <italic>sensed</italic> encounters for food-deprived animals and 235 total encounters to 94–107 (<italic>μ</italic> = 99.8, <italic>σ</italic> = 2.1) <italic>sensed</italic> encounters for well-fed animals. Coefficient values <italic>β</italic> were re-estimated in the absence of the satiety signal <inline-formula><alternatives><mml:math id="inf249"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft249">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula> (<xref ref-type="fig" rid="fig4s3">Figure 4—figure supplement 3C</xref>) using the original single-density, multi-patch data set. Using the mean coefficient values <italic>β</italic> for both models (with and without satiety), we predicted the conditional probabilities of exploiting <inline-formula><alternatives><mml:math id="inf250"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft250">\begin{document}$p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> for the new data set for well-fed and food-deprived animals. We subsequently simulated a series of <italic>exploitation</italic> events from a Bernoulli distribution using the estimated (i.e., <inline-formula><alternatives><mml:math id="inf251"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft251">\begin{document}$y_{k}|\boldsymbol{x}_{k}\sim \text{Bern}\left (p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula>) and observed (i.e., <inline-formula><alternatives><mml:math id="inf252"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>∼</mml:mo><mml:mo> </mml:mo><mml:mtext>Bern</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:msub><mml:mi>y</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn><mml:mrow><mml:mo stretchy="false">|</mml:mo></mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow></mml:mstyle></mml:math><tex-math id="inft252">\begin{document}$y_{k}|\boldsymbol{z}_{k}\sim \text{Bern}\left (p\left (y_{k}=1|\boldsymbol{z}_{k}\right)\right)$\end{document}</tex-math></alternatives></inline-formula>) <italic>exploitation</italic> probabilities. These simulated <italic>exploitations</italic> were used to generate distributions of the probability of an <italic>exploitation</italic> occurring for the first time as a function of the number of encounters (<xref ref-type="fig" rid="fig4s3">Figure 4—figure supplement 3D</xref>).</p></sec><sec id="s4-10-3"><title>Exploitation of multi-density, multi-patch environments</title><p>To investigate the individual contributions of a satiety-related signal and transfer-induced stress, a novel data set of animals foraging on multi-density, multi-patch environments was generated (<xref ref-type="fig" rid="fig4">Figure 4E</xref>, <xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4A–C</xref>). The ‘encounter sampling’ protocol described above was used to generate 100 replicates of observations of the covariates <inline-formula><alternatives><mml:math id="inf253"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft253">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> and response variables <inline-formula><alternatives><mml:math id="inf254"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft254">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> for this data set. As a result of ‘encounter sampling’, we reduced the number of encounters from 4296 total encounters (350–984 total encounters per condition) to 1702–1745 (<italic>μ</italic> = 1724.6, <italic>σ</italic> = 9.9) <italic>sensed</italic> encounters. Coefficient values <italic>β</italic> were estimated for models including combinations of <inline-formula><alternatives><mml:math id="inf255"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft255">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula>, the duration of time an animal spent searching off-food since the last <italic>exploitation</italic> event, and <inline-formula><alternatives><mml:math id="inf256"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft256">\begin{document}$\tau _{t}$\end{document}</tex-math></alternatives></inline-formula>, the duration of time since transfer (i.e., the time elapsed in the experiment) (<xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4D</xref>) using the new multi-density, multi-patch data set. While all coefficients were significant in models containing only <inline-formula><alternatives><mml:math id="inf257"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft257">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula> or <inline-formula><alternatives><mml:math id="inf258"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft258">\begin{document}$\tau _{t}$\end{document}</tex-math></alternatives></inline-formula>, only <inline-formula><alternatives><mml:math id="inf259"><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft259">\begin{document}$\tau _{s}$\end{document}</tex-math></alternatives></inline-formula> was significant in a model containing both terms (i.e., <inline-formula><alternatives><mml:math id="inf260"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>τ</mml:mi></mml:mrow><mml:mrow><mml:mi>t</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft260">\begin{document}$p\left (y_{k}=1|\beta _{0}+\beta _{k}\rho _{k}+\beta _{s}\tau _{s}+\beta _{t}\tau _{t}+\beta _{h}\rho _{h}+\beta _{e}\rho _{e}\right)$\end{document}</tex-math></alternatives></inline-formula>).</p><p>Further, to validate model predictions related to the prior experience covariates <inline-formula><alternatives><mml:math id="inf261"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft261">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf262"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft262">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula>, coefficient values <italic>β</italic> were re-estimated in the absence of the recently encountered and <italic>exploited</italic> patch density terms <inline-formula><alternatives><mml:math id="inf263"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft263">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf264"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft264">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula> (<xref ref-type="fig" rid="fig4s4">Figure 4—figure supplement 4E</xref>) using the original single-density, multi-patch data set. Using the mean coefficient values <italic>β</italic> for both models (with and without prior experience), we predicted the probabilities of <italic>exploiting</italic> <inline-formula><alternatives><mml:math id="inf265"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:mi mathvariant="bold-italic">β</mml:mi><mml:mo>⋅</mml:mo><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft265">\begin{document}$p\left (y_{k}=1|\boldsymbol{\beta }\cdot \boldsymbol{x}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> for the new data set. To generate the heat maps of predicted behavior (<xref ref-type="fig" rid="fig4">Figure 4F</xref>), we varied <inline-formula><alternatives><mml:math id="inf266"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft266">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf267"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft267">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> as well as <inline-formula><alternatives><mml:math id="inf268"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft268">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf269"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft269">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula> across a range of values and set the remaining covariate terms to the average values observed in the data set. To generate the heat maps of observed behavior (<xref ref-type="fig" rid="fig4">Figure 4F</xref>), we averaged the observed probabilities of <italic>exploiting</italic> <inline-formula><alternatives><mml:math id="inf270"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft270">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> for each pairing of <inline-formula><alternatives><mml:math id="inf271"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft271">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf272"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft272">\begin{document}$\rho _{h}$\end{document}</tex-math></alternatives></inline-formula> as well as <inline-formula><alternatives><mml:math id="inf273"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft273">\begin{document}$\rho _{k}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf274"><mml:msub><mml:mrow><mml:mi>ρ</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft274">\begin{document}$\rho _{e}$\end{document}</tex-math></alternatives></inline-formula> and linearly interpolated values between these nine points.</p></sec><sec id="s4-10-4"><title>Exploitation of sensory mutants in single-density, multi-patch environments</title><p>To test the utility of our model in identifying covariate-specific phenotypes in animals with varied genotypes, a novel data set of wild-type animals and sensory mutants foraging on single-density, multi-patch environments was generated (<xref ref-type="fig" rid="fig4s5">Figure 4—figure supplement 5A, B</xref>). The ‘encounter sampling’ and ‘worm sampling’ protocols described above were used to generate 50,000 replicates of observations of the covariates <inline-formula><alternatives><mml:math id="inf275"><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">x</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft275">\begin{document}$\boldsymbol{x}_{k}$\end{document}</tex-math></alternatives></inline-formula> and response variables <inline-formula><alternatives><mml:math id="inf276"><mml:mi>p</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:msub><mml:mrow><mml:mi>y</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>1</mml:mn></mml:mrow><mml:mrow><mml:msub><mml:mrow><mml:mi mathvariant="bold-italic">z</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced></mml:math><tex-math id="inft276">\begin{document}$p\left (y_{k}=1|\boldsymbol{z}_{k}\right)$\end{document}</tex-math></alternatives></inline-formula> for this data set. As a result of ‘encounter sampling’, we reduced the number of encounters from 1352 total encounters (27–193 total encounters per condition) to 862–894 (<italic>μ</italic> = 879.4, <italic>σ</italic> = 7.4) <italic>sensed</italic> encounters. As the number of encounters was significantly less in these data sets as compared to the original single-density, multi-patch data set, we used ridge regression to regularize the magnitude of the covariates. We optimized each model across cross-validated replicates by varying the regularization value λ. We found that <inline-formula><alternatives><mml:math id="inf277"><mml:msub><mml:mrow><mml:mi>λ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">N</mml:mi><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0.0175</mml:mn></mml:math><tex-math id="inft277">\begin{document}$\lambda _{\mathrm{N}2}=0.0175$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf278"><mml:msub><mml:mrow><mml:mi>λ</mml:mi></mml:mrow><mml:mrow><mml:mi>m</mml:mi><mml:mi>e</mml:mi><mml:mi>c</mml:mi><mml:mo>-</mml:mo><mml:mn>4</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0.0223</mml:mn></mml:math><tex-math id="inft278">\begin{document}$\lambda _{mec-4}=0.0223$\end{document}</tex-math></alternatives></inline-formula>, and <inline-formula><alternatives><mml:math id="inf279"><mml:msub><mml:mrow><mml:mi>λ</mml:mi></mml:mrow><mml:mrow><mml:mi>o</mml:mi><mml:mi>s</mml:mi><mml:mi>m</mml:mi><mml:mo>-</mml:mo><mml:mn>6</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>0.0614</mml:mn></mml:math><tex-math id="inft279">\begin{document}$\lambda _{osm-6}=0.0614$\end{document}</tex-math></alternatives></inline-formula> maximized the mean log-likelihood of each model (<xref ref-type="fig" rid="fig4s5">Figure 4—figure supplement 5E</xref>). Coefficient values <italic>β</italic> were estimated for each of the three strains tested using these values (<xref ref-type="fig" rid="fig4s5">Figure 4—figure supplement 5D</xref>). To assess whether the magnitude of coefficients significantly differed between wild-type and mutant models, we conducted a two-sample test of the mean of differences as given by<disp-formula id="equ8"><alternatives><mml:math id="m8"><mml:mi>Z</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:msub><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">m</mml:mi><mml:mi mathvariant="normal">u</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mi mathvariant="normal">n</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:mrow></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mrow><mml:mi>μ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">N</mml:mi><mml:mn>2</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:msqrt><mml:msubsup><mml:mrow><mml:mi>σ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">m</mml:mi><mml:mi mathvariant="normal">u</mml:mi><mml:mi mathvariant="normal">t</mml:mi><mml:mi mathvariant="normal">a</mml:mi><mml:mi mathvariant="normal">n</mml:mi><mml:mi mathvariant="normal">t</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msubsup><mml:mo>+</mml:mo><mml:msubsup><mml:mrow><mml:mi>σ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">N</mml:mi><mml:mn>2</mml:mn></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msubsup></mml:msqrt></mml:mrow></mml:mfrac></mml:math><tex-math id="t8">\begin{document}$$\displaystyle Z=\frac{\mu _{\mathrm{m}\mathrm{u}\mathrm{t}\mathrm{a}\mathrm{n}\mathrm{t}}-\mu _{\mathrm{N}2}}{\sqrt{\sigma _{\mathrm{m}\mathrm{u}\mathrm{t}\mathrm{a}\mathrm{n}\mathrm{t}}^{2}+\sigma _{\mathrm{N}2}^{2}}}$$\end{document}</tex-math></alternatives></disp-formula></p><p>where <italic>µ</italic> and <italic>σ</italic> are the mean and standard deviation, respectively, of the distribution of a covariate across replicates. Statistical significance was calculated as a left-tailed test <inline-formula><alternatives><mml:math id="inf280"><mml:mi>ϕ</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>Z</mml:mi></mml:mrow></mml:mfenced></mml:math><tex-math id="inft280">\begin{document}$\phi \left (Z\right)$\end{document}</tex-math></alternatives></inline-formula> for the density coefficients (<inline-formula><alternatives><mml:math id="inf281"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>k</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft281">\begin{document}$\beta _{k}$\end{document}</tex-math></alternatives></inline-formula>, <inline-formula><alternatives><mml:math id="inf282"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>h</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft282">\begin{document}$\beta _{h}$\end{document}</tex-math></alternatives></inline-formula>, and <inline-formula><alternatives><mml:math id="inf283"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>e</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft283">\begin{document}$\beta _{e}$\end{document}</tex-math></alternatives></inline-formula>) and a two-tailed test <inline-formula><alternatives><mml:math id="inf284"><mml:mi>ϕ</mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mo>-</mml:mo><mml:mfenced open="|" close="|" separators="|"><mml:mrow><mml:mi>Z</mml:mi></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:math><tex-math id="inft284">\begin{document}$\phi \left (-\left |Z\right |\right)$\end{document}</tex-math></alternatives></inline-formula> for the other coefficients (<inline-formula><alternatives><mml:math id="inf285"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mn>0</mml:mn></mml:mrow></mml:msub></mml:math><tex-math id="inft285">\begin{document}$\beta _{0}$\end{document}</tex-math></alternatives></inline-formula> and <inline-formula><alternatives><mml:math id="inf286"><mml:msub><mml:mrow><mml:mi>β</mml:mi></mml:mrow><mml:mrow><mml:mi>s</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft286">\begin{document}$\beta _{s}$\end{document}</tex-math></alternatives></inline-formula>) where <inline-formula><alternatives><mml:math id="inf287"><mml:mi>ϕ</mml:mi></mml:math><tex-math id="inft287">\begin{document}$\phi $\end{document}</tex-math></alternatives></inline-formula> is the standard normal cumulative distribution function.</p></sec></sec></sec></body><back><sec sec-type="additional-information" id="s5"><title>Additional information</title><fn-group content-type="competing-interest"><title>Competing interests</title><fn fn-type="COI-statement" id="conf1"><p>No competing interests declared</p></fn></fn-group><fn-group content-type="author-contribution"><title>Author contributions</title><fn fn-type="con" id="con1"><p>Conceptualization, Resources, Data curation, Software, Formal analysis, Supervision, Funding acquisition, Validation, Investigation, Visualization, Methodology, Writing – original draft, Project administration, Writing – review and editing</p></fn><fn fn-type="con" id="con2"><p>Data curation, Investigation, Writing – review and editing</p></fn><fn fn-type="con" id="con3"><p>Formal analysis, Supervision, Visualization, Methodology, Writing – review and editing</p></fn><fn fn-type="con" id="con4"><p>Conceptualization, Resources, Supervision, Funding acquisition, Writing – review and editing</p></fn></fn-group></sec><sec sec-type="supplementary-material" id="s6"><title>Additional files</title><supplementary-material id="mdar"><label>MDAR checklist</label><media xlink:href="elife-103191-mdarchecklist1-v1.docx" mimetype="application" mime-subtype="docx"/></supplementary-material></sec><sec sec-type="data-availability" id="s7"><title>Data availability</title><p>Source data files containing summarized data have been provided for all figures. All raw (e.g., behavior videos and fluorescence microscopy images) and processed (e.g., animal and bacterial patch locations over time) data reported in this paper is publicly available at NDI Cloud (<ext-link ext-link-type="uri" xlink:href="https://doi.org/10.63884/ndic.2025.pb77mj2s">https://doi.org/10.63884/ndic.2025.pb77mj2s</ext-link>). All original code is publicly available at GitHub (<ext-link ext-link-type="uri" xlink:href="https://github.com/shreklab/Haley-et-al-2024">https://github.com/shreklab/Haley-et-al-2024</ext-link>, copy archived at <xref ref-type="bibr" rid="bib82">shreklab, 2025</xref>).</p><p>The following dataset was generated:</p><p><element-citation publication-type="data" specific-use="isSupplementedBy" id="dataset1"><person-group person-group-type="author"><name><surname>Haley</surname><given-names>JA</given-names></name><name><surname>Chen</surname><given-names>T</given-names></name><name><surname>Aoi</surname><given-names>M</given-names></name><name><surname>Chalasani</surname><given-names>SH</given-names></name></person-group><year iso-8601-date="2025">2025</year><data-title>Dataset: Accept-reject decision-making revealed via a quantitative and ethological study of <italic>C. elegans</italic> foraging</data-title><source>NDI Cloud</source><pub-id pub-id-type="doi">10.63884/ndic.2025.pb77mj2s</pub-id></element-citation></p></sec><ack id="ack"><title>Acknowledgements</title><p>We thank members of the Chalasani lab for comments on the manuscript and James Fitzgerald for advice on modeling. This research was funded by grants from the National Science Foundation (J.A.H.), UCSD Undergraduate Summer Research Award (T.C.), NIH RO1 MH096881, Dorsett Brown Foundation, and Salk Innovation Grant (S.H.C.).</p></ack><ref-list><title>References</title><ref id="bib1"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ahmed</surname><given-names>MO</given-names></name><name><surname>Walther</surname><given-names>G</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Investigating the multimodality of multivariate data with principal curves</article-title><source>Computational Statistics &amp; Data Analysis</source><volume>56</volume><fpage>4462</fpage><lpage>4469</lpage><pub-id pub-id-type="doi">10.1016/j.csda.2012.02.020</pub-id></element-citation></ref><ref id="bib2"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Anderson</surname><given-names>JL</given-names></name><name><surname>Albergotti</surname><given-names>L</given-names></name><name><surname>Ellebracht</surname><given-names>B</given-names></name><name><surname>Huey</surname><given-names>RB</given-names></name><name><surname>Phillips</surname><given-names>PC</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Does thermoregulatory behavior maximize reproductive fitness of natural isolates of <italic>Caenorhabditis elegans</italic>?</article-title><source>BMC Evolutionary Biology</source><volume>11</volume><elocation-id>157</elocation-id><pub-id pub-id-type="doi">10.1186/1471-2148-11-157</pub-id><pub-id pub-id-type="pmid">21645395</pub-id></element-citation></ref><ref id="bib3"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ardiel</surname><given-names>EL</given-names></name><name><surname>Rankin</surname><given-names>CH</given-names></name></person-group><year iso-8601-date="2010">2010</year><article-title>An elegant mind: Learning and memory in <italic>Caenorhabditis elegans</italic></article-title><source>Learning &amp; Memory</source><volume>17</volume><fpage>191</fpage><lpage>201</lpage><pub-id pub-id-type="doi">10.1101/lm.960510</pub-id></element-citation></ref><ref id="bib4"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Barrios</surname><given-names>A</given-names></name><name><surname>Nurrish</surname><given-names>S</given-names></name><name><surname>Emmons</surname><given-names>SW</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>Sensory regulation of <italic>C. elegans</italic> male mate-searching behavior</article-title><source>Current Biology</source><volume>18</volume><fpage>1865</fpage><lpage>1871</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2008.10.050</pub-id><pub-id pub-id-type="pmid">19062284</pub-id></element-citation></ref><ref id="bib5"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bendesky</surname><given-names>A</given-names></name><name><surname>Tsunozaki</surname><given-names>M</given-names></name><name><surname>Rockman</surname><given-names>MV</given-names></name><name><surname>Kruglyak</surname><given-names>L</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Catecholamine receptor polymorphisms affect decision-making in <italic>C. elegans</italic></article-title><source>Nature</source><volume>472</volume><fpage>313</fpage><lpage>318</lpage><pub-id pub-id-type="doi">10.1038/nature09821</pub-id><pub-id pub-id-type="pmid">21412235</pub-id></element-citation></ref><ref id="bib6"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Boulin</surname><given-names>T</given-names></name><name><surname>Hobert</surname><given-names>O</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>From genes to function: the <italic>C. elegans</italic> genetic toolbox</article-title><source>Wiley Interdisciplinary Review Developmental Biology</source><volume>1</volume><fpage>114</fpage><lpage>137</lpage><pub-id pub-id-type="doi">10.1002/wdev.1</pub-id><pub-id pub-id-type="pmid">23801671</pub-id></element-citation></ref><ref id="bib7"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Brenner</surname><given-names>S</given-names></name></person-group><year iso-8601-date="1974">1974</year><article-title>The genetics of <italic>Caenorhabditis elegans</italic></article-title><source>Genetics</source><volume>77</volume><fpage>71</fpage><lpage>94</lpage><pub-id pub-id-type="doi">10.1093/genetics/77.1.71</pub-id><pub-id pub-id-type="pmid">4366476</pub-id></element-citation></ref><ref id="bib8"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Budaev</surname><given-names>S</given-names></name><name><surname>Jørgensen</surname><given-names>C</given-names></name><name><surname>Mangel</surname><given-names>M</given-names></name><name><surname>Eliassen</surname><given-names>S</given-names></name><name><surname>Giske</surname><given-names>J</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Decision-making from the animal perspective: bridging ecology and subjective cognition</article-title><source>Frontiers in Ecology and Evolution</source><volume>7</volume><elocation-id>164</elocation-id><pub-id pub-id-type="doi">10.3389/fevo.2019.00164</pub-id></element-citation></ref><ref id="bib9"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Busch</surname><given-names>KE</given-names></name><name><surname>Olofsson</surname><given-names>B</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Should I stay or should I go?</article-title><source>Worm</source><volume>1</volume><fpage>182</fpage><lpage>186</lpage><pub-id pub-id-type="doi">10.4161/worm.20464</pub-id><pub-id pub-id-type="pmid">24058845</pub-id></element-citation></ref><ref id="bib10"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Calhoun</surname><given-names>AJ</given-names></name><name><surname>Chalasani</surname><given-names>SH</given-names></name><name><surname>Sharpee</surname><given-names>TO</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Maximally informative foraging by <italic>Caenorhabditis elegans</italic></article-title><source>eLife</source><volume>3</volume><elocation-id>e04220</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.04220</pub-id><pub-id pub-id-type="pmid">25490069</pub-id></element-citation></ref><ref id="bib11"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Calhoun</surname><given-names>AJ</given-names></name><name><surname>Hayden</surname><given-names>BY</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>The foraging brain</article-title><source>Current Opinion in Behavioral Sciences</source><volume>5</volume><fpage>24</fpage><lpage>31</lpage><pub-id pub-id-type="doi">10.1016/j.cobeha.2015.07.003</pub-id></element-citation></ref><ref id="bib12"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Calhoun</surname><given-names>AJ</given-names></name><name><surname>Tong</surname><given-names>A</given-names></name><name><surname>Pokala</surname><given-names>N</given-names></name><name><surname>Fitzpatrick</surname><given-names>JAJ</given-names></name><name><surname>Sharpee</surname><given-names>TO</given-names></name><name><surname>Chalasani</surname><given-names>SH</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Neural mechanisms for evaluating environmental variability in <italic>Caenorhabditis elegans</italic></article-title><source>Neuron</source><volume>86</volume><fpage>428</fpage><lpage>441</lpage><pub-id pub-id-type="doi">10.1016/j.neuron.2015.03.026</pub-id><pub-id pub-id-type="pmid">25864633</pub-id></element-citation></ref><ref id="bib13"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Carter</surname><given-names>EC</given-names></name><name><surname>Pedersen</surname><given-names>EJ</given-names></name><name><surname>McCullough</surname><given-names>ME</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Reassessing intertemporal choice: human decision-making is more optimal in a foraging task than in a self-control task</article-title><source>Frontiers in Psychology</source><volume>6</volume><elocation-id>95</elocation-id><pub-id pub-id-type="doi">10.3389/fpsyg.2015.00095</pub-id><pub-id pub-id-type="pmid">25774140</pub-id></element-citation></ref><ref id="bib14"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Charnov</surname><given-names>EL</given-names></name></person-group><year iso-8601-date="1976">1976</year><article-title>Optimal foraging, the marginal value theorem</article-title><source>Theoretical Population Biology</source><volume>9</volume><fpage>129</fpage><lpage>136</lpage><pub-id pub-id-type="doi">10.1016/0040-5809(76)90040-x</pub-id><pub-id pub-id-type="pmid">1273796</pub-id></element-citation></ref><ref id="bib15"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Colbert</surname><given-names>HA</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="1995">1995</year><article-title>Odorant-specific adaptation pathways generate olfactory plasticity in <italic>C. elegans</italic></article-title><source>Neuron</source><volume>14</volume><fpage>803</fpage><lpage>812</lpage><pub-id pub-id-type="doi">10.1016/0896-6273(95)90224-4</pub-id><pub-id pub-id-type="pmid">7718242</pub-id></element-citation></ref><ref id="bib16"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Constantino</surname><given-names>SM</given-names></name><name><surname>Daw</surname><given-names>ND</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Learning the opportunity cost of time in a patch-foraging task</article-title><source>Cognitive, Affective, &amp; Behavioral Neuroscience</source><volume>15</volume><fpage>837</fpage><lpage>853</lpage><pub-id pub-id-type="doi">10.3758/s13415-015-0350-y</pub-id></element-citation></ref><ref id="bib17"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Croll</surname><given-names>NA</given-names></name></person-group><year iso-8601-date="1975">1975a</year><article-title>Behavioural analysis of nematode movement</article-title><source>Advances in Parasitology</source><volume>13</volume><fpage>71</fpage><lpage>122</lpage><pub-id pub-id-type="doi">10.1016/s0065-308x(08)60319-x</pub-id><pub-id pub-id-type="pmid">1169872</pub-id></element-citation></ref><ref id="bib18"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Croll</surname><given-names>NA</given-names></name></person-group><year iso-8601-date="1975">1975b</year><article-title>Components and patterns in the behaviour of the nematode <italic>Caenorhabditis elegans</italic></article-title><source>Journal of Zoology</source><volume>176</volume><fpage>159</fpage><lpage>176</lpage><pub-id pub-id-type="doi">10.1111/j.1469-7998.1975.tb03191.x</pub-id></element-citation></ref><ref id="bib19"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Davidson</surname><given-names>JD</given-names></name><name><surname>El Hady</surname><given-names>A</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Foraging as an evidence accumulation process</article-title><source>PLOS Computational Biology</source><volume>15</volume><elocation-id>e1007060</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pcbi.1007060</pub-id><pub-id pub-id-type="pmid">31339878</pub-id></element-citation></ref><ref id="bib20"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>de Bono</surname><given-names>M</given-names></name><name><surname>Maricq</surname><given-names>AV</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>Neuronal substrates of complex behaviors in <italic>C. elegans</italic></article-title><source>Annual Review of Neuroscience</source><volume>28</volume><fpage>451</fpage><lpage>501</lpage><pub-id pub-id-type="doi">10.1146/annurev.neuro.27.070203.144259</pub-id><pub-id pub-id-type="pmid">16022603</pub-id></element-citation></ref><ref id="bib21"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ding</surname><given-names>SS</given-names></name><name><surname>Muhle</surname><given-names>LS</given-names></name><name><surname>Brown</surname><given-names>AEX</given-names></name><name><surname>Schumacher</surname><given-names>LJ</given-names></name><name><surname>Endres</surname><given-names>RG</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Comparison of solitary and collective foraging strategies of <italic>Caenorhabditis elegans</italic> in patchy food distributions</article-title><source>Philosophical Transactions of the Royal Society B</source><volume>375</volume><elocation-id>20190382</elocation-id><pub-id pub-id-type="doi">10.1098/rstb.2019.0382</pub-id></element-citation></ref><ref id="bib22"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Dirksen P</surname><given-names>P</given-names></name><name><surname>Assié A</surname><given-names>A</given-names></name><name><surname>Zimmerman J</surname><given-names>J</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>CeMbio - The <italic>Caenorhabiditis elegans</italic> microbiome resource</article-title><source>G3: Genes, Genomes, Genetics</source><volume>10</volume><fpage>3025</fpage><lpage>3039</lpage><pub-id pub-id-type="doi">10.1534/g3.120.401309</pub-id></element-citation></ref><ref id="bib23"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ezcurra</surname><given-names>M</given-names></name><name><surname>Tanizawa</surname><given-names>Y</given-names></name><name><surname>Swoboda</surname><given-names>P</given-names></name><name><surname>Schafer</surname><given-names>WR</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Food sensitizes <italic>C. elegans</italic> avoidance behaviours through acute dopamine signalling</article-title><source>The EMBO Journal</source><volume>30</volume><fpage>1110</fpage><lpage>1122</lpage><pub-id pub-id-type="doi">10.1038/emboj.2011.22</pub-id><pub-id pub-id-type="pmid">21304491</pub-id></element-citation></ref><ref id="bib24"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Faumont</surname><given-names>S</given-names></name><name><surname>Lockery</surname><given-names>SR</given-names></name></person-group><year iso-8601-date="2006">2006</year><article-title>The awake behaving worm: simultaneous imaging of neuronal activity and behavior in intact animals at millimeter scale</article-title><source>Journal of Neurophysiology</source><volume>95</volume><fpage>1976</fpage><lpage>1981</lpage><pub-id pub-id-type="doi">10.1152/jn.01050.2005</pub-id><pub-id pub-id-type="pmid">16319197</pub-id></element-citation></ref><ref id="bib25"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Faumont</surname><given-names>S</given-names></name><name><surname>Lindsay</surname><given-names>TH</given-names></name><name><surname>Lockery</surname><given-names>SR</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Neuronal microcircuits for decision making in <italic>C. elegans</italic></article-title><source>Current Opinion in Neurobiology</source><volume>22</volume><fpage>580</fpage><lpage>591</lpage><pub-id pub-id-type="doi">10.1016/j.conb.2012.05.005</pub-id><pub-id pub-id-type="pmid">22699037</pub-id></element-citation></ref><ref id="bib26"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Fawcett</surname><given-names>TW</given-names></name><name><surname>McNamara</surname><given-names>JM</given-names></name><name><surname>Houston</surname><given-names>AI</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>When is it adaptive to be patient? A general framework for evaluating delayed rewards</article-title><source>Behavioural Processes</source><volume>89</volume><fpage>128</fpage><lpage>136</lpage><pub-id pub-id-type="doi">10.1016/j.beproc.2011.08.015</pub-id><pub-id pub-id-type="pmid">21920413</pub-id></element-citation></ref><ref id="bib27"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Ferguson</surname><given-names>TS</given-names></name></person-group><year iso-8601-date="1967">1967</year><chapter-title>Sequential decision problems</chapter-title><person-group person-group-type="editor"><name><surname>Birnbaum</surname><given-names>ZW</given-names></name><name><surname>Lukacs</surname><given-names>E</given-names></name></person-group><source>In Mathematical Statistics: A Decision Theoretic Approach</source><publisher-name>Academic Press</publisher-name><fpage>309</fpage><lpage>387</lpage><pub-id pub-id-type="doi">10.1016/B978-1-4831-8253-7.50011-X</pub-id></element-citation></ref><ref id="bib28"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Fraune</surname><given-names>S</given-names></name><name><surname>Bosch</surname><given-names>TCG</given-names></name></person-group><year iso-8601-date="2010">2010</year><article-title>Why bacteria matter in animal development and evolution</article-title><source>BioEssays</source><volume>32</volume><fpage>571</fpage><lpage>580</lpage><pub-id pub-id-type="doi">10.1002/bies.200900192</pub-id><pub-id pub-id-type="pmid">20544735</pub-id></element-citation></ref><ref id="bib29"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Frézal</surname><given-names>L</given-names></name><name><surname>Félix</surname><given-names>MA</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title><italic>C. elegans</italic> outside the Petri dish</article-title><source>eLife</source><volume>4</volume><elocation-id>e05849</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.05849</pub-id><pub-id pub-id-type="pmid">25822066</pub-id></element-citation></ref><ref id="bib30"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Fujiwara</surname><given-names>M</given-names></name><name><surname>Sengupta</surname><given-names>P</given-names></name><name><surname>McIntire</surname><given-names>SL</given-names></name></person-group><year iso-8601-date="2002">2002</year><article-title>Regulation of body size and behavioral state of <italic>C. elegans</italic> by sensory perception and the EGL-4 cGMP-dependent protein kinase</article-title><source>Neuron</source><volume>36</volume><fpage>1091</fpage><lpage>1102</lpage><pub-id pub-id-type="doi">10.1016/s0896-6273(02)01093-0</pub-id><pub-id pub-id-type="pmid">12495624</pub-id></element-citation></ref><ref id="bib31"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gloria-Soria</surname><given-names>A</given-names></name><name><surname>Azevedo</surname><given-names>RBR</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>npr-1 Regulates foraging and dispersal strategies in <italic>Caenorhabditis elegans</italic></article-title><source>Current Biology</source><volume>18</volume><fpage>1694</fpage><lpage>1699</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2008.09.043</pub-id><pub-id pub-id-type="pmid">18993077</pub-id></element-citation></ref><ref id="bib32"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gold</surname><given-names>JI</given-names></name><name><surname>Shadlen</surname><given-names>MN</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>The neural basis of decision making</article-title><source>Annual Review of Neuroscience</source><volume>30</volume><fpage>535</fpage><lpage>574</lpage><pub-id pub-id-type="doi">10.1146/annurev.neuro.29.051605.113038</pub-id><pub-id pub-id-type="pmid">17600525</pub-id></element-citation></ref><ref id="bib33"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gray</surname><given-names>J</given-names></name><name><surname>Lissmann</surname><given-names>HW</given-names></name></person-group><year iso-8601-date="1964">1964</year><article-title>The locomotion of nematodes</article-title><source>The Journal of Experimental Biology</source><volume>41</volume><fpage>135</fpage><lpage>154</lpage><pub-id pub-id-type="doi">10.1242/jeb.41.1.135</pub-id><pub-id pub-id-type="pmid">14161604</pub-id></element-citation></ref><ref id="bib34"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gray</surname><given-names>JM</given-names></name><name><surname>Hill</surname><given-names>JJ</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>A circuit for navigation in <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>102</volume><fpage>3184</fpage><lpage>3191</lpage><pub-id pub-id-type="doi">10.1073/pnas.0409009101</pub-id><pub-id pub-id-type="pmid">15689400</pub-id></element-citation></ref><ref id="bib35"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Guisnet</surname><given-names>A</given-names></name><name><surname>Maitra</surname><given-names>M</given-names></name><name><surname>Pradhan</surname><given-names>S</given-names></name><name><surname>Hendricks</surname><given-names>M</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>A three-dimensional habitat for <italic>C. elegans</italic> environmental enrichment</article-title><source>PLOS ONE</source><volume>16</volume><elocation-id>e0245139</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pone.0245139</pub-id><pub-id pub-id-type="pmid">33428657</pub-id></element-citation></ref><ref id="bib36"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Haley</surname><given-names>JA</given-names></name><name><surname>Chalasani</surname><given-names>SH</given-names></name></person-group><year iso-8601-date="2024">2024</year><article-title><italic>C. elegans</italic> foraging as a model for understanding the neuronal basis of decision-making</article-title><source>Cellular and Molecular Life Sciences</source><volume>81</volume><elocation-id>252</elocation-id><pub-id pub-id-type="doi">10.1007/s00018-024-05223-1</pub-id><pub-id pub-id-type="pmid">38849591</pub-id></element-citation></ref><ref id="bib37"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hallatschek</surname><given-names>O</given-names></name><name><surname>Hersen</surname><given-names>P</given-names></name><name><surname>Ramanathan</surname><given-names>S</given-names></name><name><surname>Nelson</surname><given-names>DR</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>Genetic drift at expanding frontiers promotes gene segregation</article-title><source>PNAS</source><volume>104</volume><fpage>19926</fpage><lpage>19930</lpage><pub-id pub-id-type="doi">10.1073/pnas.0710150104</pub-id><pub-id pub-id-type="pmid">18056799</pub-id></element-citation></ref><ref id="bib38"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hallinen</surname><given-names>KM</given-names></name><name><surname>Dempsey</surname><given-names>R</given-names></name><name><surname>Scholz</surname><given-names>M</given-names></name><name><surname>Yu</surname><given-names>X</given-names></name><name><surname>Linder</surname><given-names>AN</given-names></name><name><surname>Randi</surname><given-names>F</given-names></name><name><surname>Sharma</surname><given-names>AK</given-names></name><name><surname>Shaevitz</surname><given-names>JW</given-names></name><name><surname>Leifer</surname><given-names>AM</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Decoding locomotion from population neural activity in moving <italic>C. elegans</italic></article-title><source>eLife</source><volume>10</volume><elocation-id>e66135</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.66135</pub-id><pub-id pub-id-type="pmid">34323218</pub-id></element-citation></ref><ref id="bib39"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hall McMaster</surname><given-names>S</given-names></name><name><surname>Luyckx</surname><given-names>F</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Revisiting foraging approaches in neuroscience</article-title><source>Cognitive, Affective, &amp; Behavioral Neuroscience</source><volume>19</volume><fpage>225</fpage><lpage>230</lpage><pub-id pub-id-type="doi">10.3758/s13415-018-00682-z</pub-id></element-citation></ref><ref id="bib40"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hayden</surname><given-names>BY</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Why has evolution not selected for perfect self-control?</article-title><source>Philosophical Transactions of the Royal Society B</source><volume>374</volume><elocation-id>20180139</elocation-id><pub-id pub-id-type="doi">10.1098/rstb.2018.0139</pub-id></element-citation></ref><ref id="bib41"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hillemann</surname><given-names>F</given-names></name><name><surname>Bugnyar</surname><given-names>T</given-names></name><name><surname>Kotrschal</surname><given-names>K</given-names></name><name><surname>Wascher</surname><given-names>CAF</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Waiting for better, not for more: corvids respond to quality in two delay maintenance tasks</article-title><source>Animal Behaviour</source><volume>90</volume><fpage>1</fpage><lpage>10</lpage><pub-id pub-id-type="doi">10.1016/j.anbehav.2014.01.007</pub-id><pub-id pub-id-type="pmid">25892738</pub-id></element-citation></ref><ref id="bib42"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hills</surname><given-names>T</given-names></name><name><surname>Brockie</surname><given-names>PJ</given-names></name><name><surname>Maricq</surname><given-names>AV</given-names></name></person-group><year iso-8601-date="2004">2004</year><article-title>Dopamine and glutamate control area-restricted search behavior in <italic>Caenorhabditis elegans</italic></article-title><source>The Journal of Neuroscience</source><volume>24</volume><fpage>1217</fpage><lpage>1225</lpage><pub-id pub-id-type="doi">10.1523/JNEUROSCI.1569-03.2004</pub-id><pub-id pub-id-type="pmid">14762140</pub-id></element-citation></ref><ref id="bib43"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hills</surname><given-names>TT</given-names></name></person-group><year iso-8601-date="2006">2006</year><article-title>Animal foraging and the evolution of goal-directed cognition</article-title><source>Cognitive Science</source><volume>30</volume><fpage>3</fpage><lpage>41</lpage><pub-id pub-id-type="doi">10.1207/s15516709cog0000_50</pub-id><pub-id pub-id-type="pmid">21702807</pub-id></element-citation></ref><ref id="bib44"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Iwanir</surname><given-names>S</given-names></name><name><surname>Brown</surname><given-names>AS</given-names></name><name><surname>Nagy</surname><given-names>S</given-names></name><name><surname>Najjar</surname><given-names>D</given-names></name><name><surname>Kazakov</surname><given-names>A</given-names></name><name><surname>Lee</surname><given-names>KS</given-names></name><name><surname>Zaslaver</surname><given-names>A</given-names></name><name><surname>Levine</surname><given-names>E</given-names></name><name><surname>Biron</surname><given-names>D</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Serotonin promotes exploitation in complex environments by accelerating decision-making</article-title><source>BMC Biology</source><volume>14</volume><elocation-id>9</elocation-id><pub-id pub-id-type="doi">10.1186/s12915-016-0232-y</pub-id><pub-id pub-id-type="pmid">26847342</pub-id></element-citation></ref><ref id="bib45"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ji</surname><given-names>N</given-names></name><name><surname>Madan</surname><given-names>GK</given-names></name><name><surname>Fabre</surname><given-names>GI</given-names></name><name><surname>Dayan</surname><given-names>A</given-names></name><name><surname>Baker</surname><given-names>CM</given-names></name><name><surname>Kramer</surname><given-names>TS</given-names></name><name><surname>Nwabudike</surname><given-names>I</given-names></name><name><surname>Flavell</surname><given-names>SW</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>A neural circuit for flexible control of persistent behavioral states</article-title><source>eLife</source><volume>10</volume><elocation-id>e62889</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.62889</pub-id><pub-id pub-id-type="pmid">34792019</pub-id></element-citation></ref><ref id="bib46"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kempermann</surname><given-names>G</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Environmental enrichment, new neurons and the neurobiology of individuality</article-title><source>Nature Reviews. Neuroscience</source><volume>20</volume><fpage>235</fpage><lpage>245</lpage><pub-id pub-id-type="doi">10.1038/s41583-019-0120-x</pub-id><pub-id pub-id-type="pmid">30723309</pub-id></element-citation></ref><ref id="bib47"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Krebs</surname><given-names>JR</given-names></name><name><surname>Inman</surname><given-names>AJ</given-names></name></person-group><year iso-8601-date="1992">1992</year><article-title>Learning and foraging: individuals, groups, and populations</article-title><source>The American Naturalist</source><volume>140 Suppl 1</volume><fpage>S63</fpage><lpage>S84</lpage><pub-id pub-id-type="doi">10.1086/285397</pub-id><pub-id pub-id-type="pmid">19426027</pub-id></element-citation></ref><ref id="bib48"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Labrousse</surname><given-names>A</given-names></name><name><surname>Chauvet</surname><given-names>S</given-names></name><name><surname>Couillault</surname><given-names>C</given-names></name><name><surname>Kurz</surname><given-names>CL</given-names></name><name><surname>Ewbank</surname><given-names>JJ</given-names></name></person-group><year iso-8601-date="2000">2000</year><article-title><italic>Caenorhabditis elegans</italic> is a model host for Salmonella typhimurium</article-title><source>Current Biology</source><volume>10</volume><fpage>1543</fpage><lpage>1545</lpage><pub-id pub-id-type="doi">10.1016/s0960-9822(00)00833-2</pub-id><pub-id pub-id-type="pmid">11114526</pub-id></element-citation></ref><ref id="bib49"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lee</surname><given-names>D</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>Decision making: from neuroscience to psychiatry</article-title><source>Neuron</source><volume>78</volume><fpage>233</fpage><lpage>248</lpage><pub-id pub-id-type="doi">10.1016/j.neuron.2013.04.008</pub-id><pub-id pub-id-type="pmid">23622061</pub-id></element-citation></ref><ref id="bib50"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lipton</surname><given-names>J</given-names></name><name><surname>Kleemann</surname><given-names>G</given-names></name><name><surname>Ghosh</surname><given-names>R</given-names></name><name><surname>Lints</surname><given-names>R</given-names></name><name><surname>Emmons</surname><given-names>SW</given-names></name></person-group><year iso-8601-date="2004">2004</year><article-title>Mate searching in <italic>Caenorhabditis elegans</italic>: a genetic model for sex drive in a simple invertebrate</article-title><source>The Journal of Neuroscience</source><volume>24</volume><fpage>7427</fpage><lpage>7434</lpage><pub-id pub-id-type="doi">10.1523/JNEUROSCI.1746-04.2004</pub-id><pub-id pub-id-type="pmid">15329389</pub-id></element-citation></ref><ref id="bib51"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Madirolas</surname><given-names>G</given-names></name><name><surname>Al-Asmar</surname><given-names>A</given-names></name><name><surname>Gaouar</surname><given-names>L</given-names></name><name><surname>Marie-Louise</surname><given-names>L</given-names></name><name><surname>Garza-Enríquez</surname><given-names>A</given-names></name><name><surname>Rodríguez-Rada</surname><given-names>V</given-names></name><name><surname>Khona</surname><given-names>M</given-names></name><name><surname>Dal Bello</surname><given-names>M</given-names></name><name><surname>Ratzke</surname><given-names>C</given-names></name><name><surname>Gore</surname><given-names>J</given-names></name><name><surname>Pérez-Escudero</surname><given-names>A</given-names></name></person-group><year iso-8601-date="2023">2023</year><article-title><italic>Caenorhabditis elegans</italic> foraging patterns follow a simple rule of thumb</article-title><source>Communications Biology</source><volume>6</volume><elocation-id>841</elocation-id><pub-id pub-id-type="doi">10.1038/s42003-023-05220-3</pub-id><pub-id pub-id-type="pmid">37580527</pub-id></element-citation></ref><ref id="bib52"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Matsuura</surname><given-names>T</given-names></name><name><surname>Sato</surname><given-names>T</given-names></name><name><surname>Shingai</surname><given-names>R</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>Interactions between <italic>Caenorhabditis elegans</italic> individuals during chemotactic response</article-title><source>Zoological Science</source><volume>22</volume><fpage>1095</fpage><lpage>1103</lpage><pub-id pub-id-type="doi">10.2108/zsj.22.1095</pub-id></element-citation></ref><ref id="bib53"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Matty</surname><given-names>MA</given-names></name><name><surname>Lau</surname><given-names>HE</given-names></name><name><surname>Haley</surname><given-names>JA</given-names></name><name><surname>Singh</surname><given-names>A</given-names></name><name><surname>Chakraborty</surname><given-names>A</given-names></name><name><surname>Kono</surname><given-names>K</given-names></name><name><surname>Reddy</surname><given-names>KC</given-names></name><name><surname>Hansen</surname><given-names>M</given-names></name><name><surname>Chalasani</surname><given-names>SH</given-names></name></person-group><year iso-8601-date="2022">2022</year><article-title>Intestine-to-neuronal signaling alters risk-taking behaviors in food-deprived <italic>Caenorhabditis elegans</italic></article-title><source>PLOS Genetics</source><volume>18</volume><elocation-id>e1010178</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.1010178</pub-id><pub-id pub-id-type="pmid">35511794</pub-id></element-citation></ref><ref id="bib54"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Melo</surname><given-names>JA</given-names></name><name><surname>Ruvkun</surname><given-names>G</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>Inactivation of conserved <italic>C. elegans</italic> genes engages pathogen- and xenobiotic-associated defenses</article-title><source>Cell</source><volume>149</volume><fpage>452</fpage><lpage>466</lpage><pub-id pub-id-type="doi">10.1016/j.cell.2012.02.050</pub-id><pub-id pub-id-type="pmid">22500807</pub-id></element-citation></ref><ref id="bib55"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Miller</surname><given-names>R</given-names></name><name><surname>Frohnwieser</surname><given-names>A</given-names></name><name><surname>Schiestl</surname><given-names>M</given-names></name><name><surname>McCoy</surname><given-names>DE</given-names></name><name><surname>Gray</surname><given-names>RD</given-names></name><name><surname>Taylor</surname><given-names>AH</given-names></name><name><surname>Clayton</surname><given-names>NS</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Delayed gratification in New Caledonian crows and young children: influence of reward type and visibility</article-title><source>Animal Cognition</source><volume>23</volume><fpage>71</fpage><lpage>85</lpage><pub-id pub-id-type="doi">10.1007/s10071-019-01317-7</pub-id><pub-id pub-id-type="pmid">31630344</pub-id></element-citation></ref><ref id="bib56"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Milward</surname><given-names>K</given-names></name><name><surname>Busch</surname><given-names>KE</given-names></name><name><surname>Murphy</surname><given-names>RJ</given-names></name><name><surname>de Bono</surname><given-names>M</given-names></name><name><surname>Olofsson</surname><given-names>B</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Neuronal and molecular substrates for optimal foraging in <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>108</volume><fpage>20672</fpage><lpage>20677</lpage><pub-id pub-id-type="doi">10.1073/pnas.1106134109</pub-id><pub-id pub-id-type="pmid">22135454</pub-id></element-citation></ref><ref id="bib57"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Mischel</surname><given-names>W</given-names></name><name><surname>Ebbesen</surname><given-names>EB</given-names></name></person-group><year iso-8601-date="1970">1970</year><article-title>Attention in delay of gratification</article-title><source>Journal of Personality and Social Psychology</source><volume>16</volume><fpage>329</fpage><lpage>337</lpage><pub-id pub-id-type="doi">10.1037/h0029815</pub-id></element-citation></ref><ref id="bib58"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Mobbs</surname><given-names>D</given-names></name><name><surname>Trimmer</surname><given-names>PC</given-names></name><name><surname>Blumstein</surname><given-names>DT</given-names></name><name><surname>Dayan</surname><given-names>P</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>Foraging for foundations in decision neuroscience: insights from ethology</article-title><source>Nature Reviews. Neuroscience</source><volume>19</volume><fpage>419</fpage><lpage>427</lpage><pub-id pub-id-type="doi">10.1038/s41583-018-0010-7</pub-id><pub-id pub-id-type="pmid">29752468</pub-id></element-citation></ref><ref id="bib59"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Morse</surname><given-names>JM</given-names></name></person-group><year iso-8601-date="1995">1995</year><article-title>The significance of saturation</article-title><source>Qualitative Health Research</source><volume>5</volume><fpage>147</fpage><lpage>149</lpage><pub-id pub-id-type="doi">10.1177/104973239500500201</pub-id></element-citation></ref><ref id="bib60"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Nguyen</surname><given-names>JP</given-names></name><name><surname>Shipley</surname><given-names>FB</given-names></name><name><surname>Linder</surname><given-names>AN</given-names></name><name><surname>Plummer</surname><given-names>GS</given-names></name><name><surname>Liu</surname><given-names>M</given-names></name><name><surname>Setru</surname><given-names>SU</given-names></name><name><surname>Shaevitz</surname><given-names>JW</given-names></name><name><surname>Leifer</surname><given-names>AM</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Whole-brain calcium imaging with cellular resolution in freely behaving <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>113</volume><fpage>E1074</fpage><lpage>E1081</lpage><pub-id pub-id-type="doi">10.1073/pnas.1507110112</pub-id><pub-id pub-id-type="pmid">26712014</pub-id></element-citation></ref><ref id="bib61"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Nonacs</surname><given-names>P</given-names></name></person-group><year iso-8601-date="2001">2001</year><article-title>State dependent behavior and the Marginal Value Theorem</article-title><source>Behavioral Ecology</source><volume>12</volume><fpage>71</fpage><lpage>83</lpage><pub-id pub-id-type="doi">10.1093/oxfordjournals.beheco.a000381</pub-id></element-citation></ref><ref id="bib62"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Olofsson</surname><given-names>B</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>The olfactory neuron AWC promotes avoidance of normally palatable food following chronic dietary restriction</article-title><source>The Journal of Experimental Biology</source><volume>217</volume><fpage>1790</fpage><lpage>1798</lpage><pub-id pub-id-type="doi">10.1242/jeb.099929</pub-id><pub-id pub-id-type="pmid">24577446</pub-id></element-citation></ref><ref id="bib63"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Petersen</surname><given-names>C</given-names></name><name><surname>Dirksen</surname><given-names>P</given-names></name><name><surname>Prahl</surname><given-names>S</given-names></name><name><surname>Strathmann</surname><given-names>EA</given-names></name><name><surname>Schulenburg</surname><given-names>H</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>The prevalence of <italic>Caenorhabditis elegans</italic> across 1.5 years in selected North German locations: the importance of substrate type, abiotic parameters, and Caenorhabditis competitors</article-title><source>BMC Ecology</source><volume>14</volume><elocation-id>4</elocation-id><pub-id pub-id-type="doi">10.1186/1472-6785-14-4</pub-id><pub-id pub-id-type="pmid">24502455</pub-id></element-citation></ref><ref id="bib64"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Petersen</surname><given-names>C</given-names></name><name><surname>Dirksen</surname><given-names>P</given-names></name><name><surname>Schulenburg</surname><given-names>H</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Why we need more ecology for genetic models such as <italic>C. elegans</italic></article-title><source>Trends in Genetics</source><volume>31</volume><fpage>120</fpage><lpage>127</lpage><pub-id pub-id-type="doi">10.1016/j.tig.2014.12.001</pub-id><pub-id pub-id-type="pmid">25577479</pub-id></element-citation></ref><ref id="bib65"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pradel</surname><given-names>E</given-names></name><name><surname>Zhang</surname><given-names>Y</given-names></name><name><surname>Pujol</surname><given-names>N</given-names></name><name><surname>Matsuyama</surname><given-names>T</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name><name><surname>Ewbank</surname><given-names>JJ</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>Detection and avoidance of a natural product from the pathogenic bacterium Serratia marcescens by <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>104</volume><fpage>2295</fpage><lpage>2300</lpage><pub-id pub-id-type="doi">10.1073/pnas.0610281104</pub-id><pub-id pub-id-type="pmid">17267603</pub-id></element-citation></ref><ref id="bib66"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pradhan</surname><given-names>S</given-names></name><name><surname>Quilez</surname><given-names>S</given-names></name><name><surname>Homer</surname><given-names>K</given-names></name><name><surname>Hendricks</surname><given-names>M</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Environmental programming of adult foraging behavior in <italic>C. elegans</italic></article-title><source>Current Biology</source><volume>29</volume><fpage>2867</fpage><lpage>2879</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2019.07.045</pub-id><pub-id pub-id-type="pmid">31422888</pub-id></element-citation></ref><ref id="bib67"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Prevedel</surname><given-names>R</given-names></name><name><surname>Yoon</surname><given-names>YG</given-names></name><name><surname>Hoffmann</surname><given-names>M</given-names></name><name><surname>Pak</surname><given-names>N</given-names></name><name><surname>Wetzstein</surname><given-names>G</given-names></name><name><surname>Kato</surname><given-names>S</given-names></name><name><surname>Schrödel</surname><given-names>T</given-names></name><name><surname>Raskar</surname><given-names>R</given-names></name><name><surname>Zimmer</surname><given-names>M</given-names></name><name><surname>Boyden</surname><given-names>ES</given-names></name><name><surname>Vaziri</surname><given-names>A</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Simultaneous whole-animal 3D imaging of neuronal activity using light-field microscopy</article-title><source>Nature Methods</source><volume>11</volume><fpage>727</fpage><lpage>730</lpage><pub-id pub-id-type="doi">10.1038/nmeth.2964</pub-id><pub-id pub-id-type="pmid">24836920</pub-id></element-citation></ref><ref id="bib68"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pribadi</surname><given-names>A</given-names></name><name><surname>Rieger</surname><given-names>MA</given-names></name><name><surname>Rosales</surname><given-names>K</given-names></name><name><surname>Reddy</surname><given-names>KC</given-names></name><name><surname>Chalasani</surname><given-names>SH</given-names></name></person-group><year iso-8601-date="2023">2023</year><article-title>Dopamine signaling regulates predator-driven changes in <italic>Caenorhabditis elegans’</italic> egg laying behavior</article-title><source>eLife</source><volume>12</volume><elocation-id>e83957</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.83957</pub-id><pub-id pub-id-type="pmid">37431892</pub-id></element-citation></ref><ref id="bib69"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pujol</surname><given-names>N</given-names></name><name><surname>Link</surname><given-names>EM</given-names></name><name><surname>Liu</surname><given-names>LX</given-names></name><name><surname>Kurz</surname><given-names>CL</given-names></name><name><surname>Alloing</surname><given-names>G</given-names></name><name><surname>Tan</surname><given-names>MW</given-names></name><name><surname>Ray</surname><given-names>KP</given-names></name><name><surname>Solari</surname><given-names>R</given-names></name><name><surname>Johnson</surname><given-names>CD</given-names></name><name><surname>Ewbank</surname><given-names>JJ</given-names></name></person-group><year iso-8601-date="2001">2001</year><article-title>A reverse genetic analysis of components of the Toll signaling pathway in <italic>Caenorhabditis elegans</italic></article-title><source>Current Biology</source><volume>11</volume><fpage>809</fpage><lpage>821</lpage><pub-id pub-id-type="doi">10.1016/s0960-9822(01)00241-x</pub-id><pub-id pub-id-type="pmid">11516642</pub-id></element-citation></ref><ref id="bib70"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pyke</surname><given-names>GH</given-names></name><name><surname>Pulliam</surname><given-names>HR</given-names></name><name><surname>Charnov</surname><given-names>EL</given-names></name></person-group><year iso-8601-date="1977">1977</year><article-title>Optimal foraging: a selective review of theory and tests</article-title><source>The Quarterly Review of Biology</source><volume>52</volume><fpage>137</fpage><lpage>154</lpage><pub-id pub-id-type="doi">10.1086/409852</pub-id></element-citation></ref><ref id="bib71"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Quach</surname><given-names>KT</given-names></name><name><surname>Chalasani</surname><given-names>SH</given-names></name></person-group><year iso-8601-date="2022">2022</year><article-title>Flexible reprogramming of Pristionchus pacificus motivation for attacking <italic>Caenorhabditis elegans</italic> in predator-prey competition</article-title><source>Current Biology</source><volume>32</volume><fpage>1675</fpage><lpage>1688</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2022.02.033</pub-id><pub-id pub-id-type="pmid">35259340</pub-id></element-citation></ref><ref id="bib72"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Quach</surname><given-names>KT</given-names></name><name><surname>Hughes</surname><given-names>GA</given-names></name><name><surname>Chalasani</surname><given-names>SH</given-names></name></person-group><year iso-8601-date="2024">2024</year><article-title>Interdependence between SEB-3 receptor and NLP-49 peptides shifts across predator-induced defensive behavioral modes in <italic>Caenorhabditis elegans</italic></article-title><source>eLife</source><volume>13</volume><elocation-id>RP98262</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.98262.2</pub-id></element-citation></ref><ref id="bib73"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Range</surname><given-names>F</given-names></name><name><surname>Brucks</surname><given-names>D</given-names></name><name><surname>Virányi</surname><given-names>Z</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Dogs wait longer for better rewards than wolves in a delay of gratification task: but why?</article-title><source>Animal Cognition</source><volume>23</volume><fpage>443</fpage><lpage>453</lpage><pub-id pub-id-type="doi">10.1007/s10071-020-01346-7</pub-id><pub-id pub-id-type="pmid">32060750</pub-id></element-citation></ref><ref id="bib74"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Robbins</surname><given-names>H</given-names></name></person-group><year iso-8601-date="1970">1970</year><article-title>Optimal Stopping</article-title><source>The American Mathematical Monthly</source><volume>77</volume><fpage>333</fpage><lpage>343</lpage><pub-id pub-id-type="doi">10.1080/00029890.1970.11992487</pub-id></element-citation></ref><ref id="bib75"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Rosati</surname><given-names>AG</given-names></name><name><surname>Stevens</surname><given-names>JR</given-names></name><name><surname>Hare</surname><given-names>B</given-names></name><name><surname>Hauser</surname><given-names>MD</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>The evolutionary origins of human patience: temporal preferences in chimpanzees, bonobos, and human adults</article-title><source>Current Biology</source><volume>17</volume><fpage>1663</fpage><lpage>1668</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2007.08.033</pub-id><pub-id pub-id-type="pmid">17900899</pub-id></element-citation></ref><ref id="bib76"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Samuel</surname><given-names>BS</given-names></name><name><surname>Rowedder</surname><given-names>H</given-names></name><name><surname>Braendle</surname><given-names>C</given-names></name><name><surname>Félix</surname><given-names>MA</given-names></name><name><surname>Ruvkun</surname><given-names>G</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title><italic>Caenorhabditis elegans</italic> responses to bacteria from its natural habitats</article-title><source>PNAS</source><volume>113</volume><fpage>E3941</fpage><lpage>E3949</lpage><pub-id pub-id-type="doi">10.1073/pnas.1607183113</pub-id><pub-id pub-id-type="pmid">27317746</pub-id></element-citation></ref><ref id="bib77"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Saravanan</surname><given-names>V</given-names></name><name><surname>Berman</surname><given-names>GJ</given-names></name><name><surname>Sober</surname><given-names>SJ</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Application of the hierarchical bootstrap to multi-level data in neuroscience</article-title><source>Neurons, Behavior, Data Analysis, and Theory</source><volume>3</volume><pub-id pub-id-type="pmid">33644783</pub-id></element-citation></ref><ref id="bib78"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sawin</surname><given-names>ER</given-names></name><name><surname>Ranganathan</surname><given-names>R</given-names></name><name><surname>Horvitz</surname><given-names>HR</given-names></name></person-group><year iso-8601-date="2000">2000</year><article-title><italic>C. elegans</italic> locomotory rate is modulated by the environment through a dopaminergic pathway and by experience through a serotonergic pathway</article-title><source>Neuron</source><volume>26</volume><fpage>619</fpage><lpage>631</lpage><pub-id pub-id-type="doi">10.1016/s0896-6273(00)81199-x</pub-id><pub-id pub-id-type="pmid">10896158</pub-id></element-citation></ref><ref id="bib79"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Scheer</surname><given-names>E</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2023">2023</year><article-title>Sensory neurons couple arousal and foraging decisions in <italic>Caenorhabditis elegans</italic></article-title><source>eLife</source><volume>12</volume><elocation-id>RP88657</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.88657</pub-id><pub-id pub-id-type="pmid">38149996</pub-id></element-citation></ref><ref id="bib80"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Schnell</surname><given-names>AK</given-names></name><name><surname>Boeckle</surname><given-names>M</given-names></name><name><surname>Rivera</surname><given-names>M</given-names></name><name><surname>Clayton</surname><given-names>NS</given-names></name><name><surname>Hanlon</surname><given-names>RT</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Cuttlefish exert self-control in a delay of gratification task</article-title><source>Proceedings. Biological Sciences</source><volume>288</volume><elocation-id>20203161</elocation-id><pub-id pub-id-type="doi">10.1098/rspb.2020.3161</pub-id><pub-id pub-id-type="pmid">33653135</pub-id></element-citation></ref><ref id="bib81"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Schoener</surname><given-names>TW</given-names></name></person-group><year iso-8601-date="1971">1971</year><article-title>Theory of feeding strategies</article-title><source>Annual Review of Ecology and Systematics</source><volume>2</volume><fpage>369</fpage><lpage>404</lpage><pub-id pub-id-type="doi">10.1146/annurev.es.02.110171.002101</pub-id></element-citation></ref><ref id="bib82"><element-citation publication-type="software"><person-group person-group-type="author"><collab>shreklab</collab></person-group><year iso-8601-date="2025">2025</year><data-title>Haley-et-al-2024</data-title><version designator="swh:1:rev:fd564615460f57f29887c96f3baa9c1347538953">swh:1:rev:fd564615460f57f29887c96f3baa9c1347538953</version><source>Software Heritage</source><ext-link ext-link-type="uri" xlink:href="https://archive.softwareheritage.org/swh:1:dir:b3a40b411facb8f77e49da683f5ee49971e86a11;origin=https://github.com/shreklab/Haley-et-al-2024;visit=swh:1:snp:ff26ad3faf4389ab7126ab4d53a0b68fc570e17c;anchor=swh:1:rev:fd564615460f57f29887c96f3baa9c1347538953">https://archive.softwareheritage.org/swh:1:dir:b3a40b411facb8f77e49da683f5ee49971e86a11;origin=https://github.com/shreklab/Haley-et-al-2024;visit=swh:1:snp:ff26ad3faf4389ab7126ab4d53a0b68fc570e17c;anchor=swh:1:rev:fd564615460f57f29887c96f3baa9c1347538953</ext-link></element-citation></ref><ref id="bib83"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Shtonda</surname><given-names>BB</given-names></name><name><surname>Avery</surname><given-names>L</given-names></name></person-group><year iso-8601-date="2006">2006</year><article-title>Dietary choice behavior in <italic>Caenorhabditis elegans</italic></article-title><source>The Journal of Experimental Biology</source><volume>209</volume><fpage>89</fpage><lpage>102</lpage><pub-id pub-id-type="doi">10.1242/jeb.01955</pub-id><pub-id pub-id-type="pmid">16354781</pub-id></element-citation></ref><ref id="bib84"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Silverman</surname><given-names>BW</given-names></name></person-group><year iso-8601-date="1981">1981</year><article-title>Using kernel density estimates to investigate multimodality</article-title><source>Journal of the Royal Statistical Society Series B</source><volume>43</volume><fpage>97</fpage><lpage>99</lpage><pub-id pub-id-type="doi">10.1111/j.2517-6161.1981.tb01155.x</pub-id></element-citation></ref><ref id="bib85"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Silverman</surname><given-names>BW</given-names></name></person-group><year iso-8601-date="1986">1986</year><source>Density Estimation for Statistics and Data Analysis</source><publisher-name>Chapman &amp; Hall</publisher-name><pub-id pub-id-type="doi">10.1201/9781315140919</pub-id></element-citation></ref><ref id="bib86"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Stephens</surname><given-names>DW</given-names></name><name><surname>Krebs</surname><given-names>JR</given-names></name></person-group><year iso-8601-date="1986">1986</year><source>Foraging Theory</source><publisher-name>Princeton University Press</publisher-name><pub-id pub-id-type="doi">10.1515/9780691206790</pub-id></element-citation></ref><ref id="bib87"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Stephens</surname><given-names>DW</given-names></name><name><surname>Anderson</surname><given-names>D</given-names></name></person-group><year iso-8601-date="2001">2001</year><article-title>The adaptive value of preference for immediacy: when shortsighted rules have farsighted consequences</article-title><source>Behavioral Ecology</source><volume>12</volume><fpage>330</fpage><lpage>339</lpage><pub-id pub-id-type="doi">10.1093/beheco/12.3.330</pub-id></element-citation></ref><ref id="bib88"><element-citation publication-type="book"><person-group person-group-type="author"><name><surname>Stephens</surname><given-names>DW</given-names></name><name><surname>Brown</surname><given-names>JS</given-names></name><name><surname>Ydenberg</surname><given-names>RC</given-names></name></person-group><year iso-8601-date="2007">2007</year><source>Foraging: Behavior and Ecology</source><publisher-name>University of Chicago Press</publisher-name><pub-id pub-id-type="doi">10.7208/9780226772653</pub-id></element-citation></ref><ref id="bib89"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Stephens</surname><given-names>DW</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>Decision ecology: foraging and the ecology of animal decision making</article-title><source>Cognitive, Affective, &amp; Behavioral Neuroscience</source><volume>8</volume><fpage>475</fpage><lpage>484</lpage><pub-id pub-id-type="doi">10.3758/CABN.8.4.475</pub-id></element-citation></ref><ref id="bib90"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sulston</surname><given-names>JE</given-names></name><name><surname>Brenner</surname><given-names>S</given-names></name></person-group><year iso-8601-date="1974">1974</year><article-title>The DNA of <italic>Caenorhabditis elegans</italic></article-title><source>Genetics</source><volume>77</volume><fpage>95</fpage><lpage>104</lpage><pub-id pub-id-type="doi">10.1093/genetics/77.1.95</pub-id><pub-id pub-id-type="pmid">4858229</pub-id></element-citation></ref><ref id="bib91"><element-citation publication-type="preprint"><person-group person-group-type="author"><name><surname>Susini</surname><given-names>I</given-names></name><name><surname>Safryghin</surname><given-names>A</given-names></name><name><surname>Hillemann</surname><given-names>F</given-names></name><name><surname>Wascher</surname><given-names>CAF</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Delay of Gratification in Non-Human Animals: A Review of Inter-Specific Variation in Performance</article-title><source>bioRxiv</source><pub-id pub-id-type="doi">10.1101/2020.05.05.078659</pub-id></element-citation></ref><ref id="bib92"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Tanimoto</surname><given-names>Y</given-names></name><name><surname>Yamazoe-Umemoto</surname><given-names>A</given-names></name><name><surname>Fujita</surname><given-names>K</given-names></name><name><surname>Kawazoe</surname><given-names>Y</given-names></name><name><surname>Miyanishi</surname><given-names>Y</given-names></name><name><surname>Yamazaki</surname><given-names>SJ</given-names></name><name><surname>Fei</surname><given-names>X</given-names></name><name><surname>Busch</surname><given-names>KE</given-names></name><name><surname>Gengyo-Ando</surname><given-names>K</given-names></name><name><surname>Nakai</surname><given-names>J</given-names></name><name><surname>Iino</surname><given-names>Y</given-names></name><name><surname>Iwasaki</surname><given-names>Y</given-names></name><name><surname>Hashimoto</surname><given-names>K</given-names></name><name><surname>Kimura</surname><given-names>KD</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>Calcium dynamics regulating the timing of decision-making in <italic>C. elegans</italic></article-title><source>eLife</source><volume>6</volume><elocation-id>e21629</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.21629</pub-id><pub-id pub-id-type="pmid">28532547</pub-id></element-citation></ref><ref id="bib93"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Venkatachalam</surname><given-names>V</given-names></name><name><surname>Ji</surname><given-names>N</given-names></name><name><surname>Wang</surname><given-names>X</given-names></name><name><surname>Clark</surname><given-names>C</given-names></name><name><surname>Mitchell</surname><given-names>JK</given-names></name><name><surname>Klein</surname><given-names>M</given-names></name><name><surname>Tabone</surname><given-names>CJ</given-names></name><name><surname>Florman</surname><given-names>J</given-names></name><name><surname>Ji</surname><given-names>H</given-names></name><name><surname>Greenwood</surname><given-names>J</given-names></name><name><surname>Chisholm</surname><given-names>AD</given-names></name><name><surname>Srinivasan</surname><given-names>J</given-names></name><name><surname>Alkema</surname><given-names>M</given-names></name><name><surname>Zhen</surname><given-names>M</given-names></name><name><surname>Samuel</surname><given-names>ADT</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Pan-neuronal imaging in roaming <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>113</volume><fpage>E1082</fpage><lpage>E1088</lpage><pub-id pub-id-type="doi">10.1073/pnas.1507109113</pub-id><pub-id pub-id-type="pmid">26711989</pub-id></element-citation></ref><ref id="bib94"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Voleti</surname><given-names>V</given-names></name><name><surname>Patel</surname><given-names>KB</given-names></name><name><surname>Li</surname><given-names>W</given-names></name><name><surname>Perez Campos</surname><given-names>C</given-names></name><name><surname>Bharadwaj</surname><given-names>S</given-names></name><name><surname>Yu</surname><given-names>H</given-names></name><name><surname>Ford</surname><given-names>C</given-names></name><name><surname>Casper</surname><given-names>MJ</given-names></name><name><surname>Yan</surname><given-names>RW</given-names></name><name><surname>Liang</surname><given-names>W</given-names></name><name><surname>Wen</surname><given-names>C</given-names></name><name><surname>Kimura</surname><given-names>KD</given-names></name><name><surname>Targoff</surname><given-names>KL</given-names></name><name><surname>Hillman</surname><given-names>EMC</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Real-time volumetric microscopy of in vivo dynamics and large-scale samples with SCAPE 2.0</article-title><source>Nature Methods</source><volume>16</volume><fpage>1054</fpage><lpage>1062</lpage><pub-id pub-id-type="doi">10.1038/s41592-019-0579-4</pub-id><pub-id pub-id-type="pmid">31562489</pub-id></element-citation></ref><ref id="bib95"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Volgin</surname><given-names>AD</given-names></name><name><surname>Yakovlev</surname><given-names>OV</given-names></name><name><surname>Demin</surname><given-names>KA</given-names></name><name><surname>de Abreu</surname><given-names>MS</given-names></name><name><surname>Rosemberg</surname><given-names>DB</given-names></name><name><surname>Meshalkina</surname><given-names>DA</given-names></name><name><surname>Alekseeva</surname><given-names>PA</given-names></name><name><surname>Friend</surname><given-names>AJ</given-names></name><name><surname>Amstislavskaya</surname><given-names>TG</given-names></name><name><surname>Kalueff</surname><given-names>AV</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>Understanding the role of environmental enrichment in zebrafish neurobehavioral models</article-title><source>Zebrafish</source><volume>15</volume><fpage>425</fpage><lpage>432</lpage><pub-id pub-id-type="doi">10.1089/zeb.2018.1592</pub-id><pub-id pub-id-type="pmid">30133416</pub-id></element-citation></ref><ref id="bib96"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>White</surname><given-names>JG</given-names></name><name><surname>Southgate</surname><given-names>E</given-names></name><name><surname>Thomson</surname><given-names>JN</given-names></name><name><surname>Brenner</surname><given-names>S</given-names></name></person-group><year iso-8601-date="1986">1986</year><article-title>The structure of the nervous system of the nematode <italic>Caenorhabditis elegans</italic></article-title><source>Philisophical Transactions of the Royal Society B</source><volume>314</volume><fpage>1</fpage><lpage>340</lpage><pub-id pub-id-type="doi">10.1098/rstb.1986.0056</pub-id></element-citation></ref><ref id="bib97"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>You</surname><given-names>Y</given-names></name><name><surname>Kim</surname><given-names>J</given-names></name><name><surname>Raizen</surname><given-names>DM</given-names></name><name><surname>Avery</surname><given-names>L</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>Insulin, cGMP, and TGF-β signals regulate food intake and quiescence in <italic>C. elegans</italic>: a model for satiety</article-title><source>Cell Metabolism</source><volume>7</volume><fpage>249</fpage><lpage>257</lpage><pub-id pub-id-type="doi">10.1016/j.cmet.2008.01.005</pub-id></element-citation></ref><ref id="bib98"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zhang</surname><given-names>Y</given-names></name><name><surname>Lu</surname><given-names>H</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>Pathogenic bacteria induce aversive olfactory learning in <italic>Caenorhabditis elegans</italic></article-title><source>Nature</source><volume>438</volume><fpage>179</fpage><lpage>184</lpage><pub-id pub-id-type="doi">10.1038/nature04216</pub-id><pub-id pub-id-type="pmid">16281027</pub-id></element-citation></ref></ref-list></back><sub-article article-type="editor-report" id="sa0"><front-stub><article-id pub-id-type="doi">10.7554/eLife.103191.4.sa0</article-id><title-group><article-title>eLife Assessment</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>Portman</surname><given-names>Douglas</given-names></name><role specific-use="editor">Reviewing Editor</role><aff><institution>University of Rochester</institution><country>United States</country></aff></contrib></contrib-group><kwd-group kwd-group-type="evidence-strength"><kwd>Convincing</kwd></kwd-group><kwd-group kwd-group-type="claim-importance"><kwd>Important</kwd></kwd-group></front-stub><body><p>Understanding how neural circuits mediate decision-making is a core problem in neuroscience. In this interesting and <bold>important</bold> work, the authors use detailed behavioral analysis and rigorous quantitative modeling to <bold>convincingly</bold> support the idea that the nematode <italic>C. elegans</italic> uses an &quot;accept-reject&quot; behavioral strategy, based on learned features of its environment, to make decisions upon encountering food patches. The work expands our understanding of the behavioral repertoire of this species, providing a foundation for future mechanistic studies in this powerful model system.</p></body></sub-article><sub-article article-type="referee-report" id="sa1"><front-stub><article-id pub-id-type="doi">10.7554/eLife.103191.4.sa1</article-id><title-group><article-title>Reviewer #1 (Public review):</article-title></title-group><contrib-group><contrib contrib-type="author"><anonymous/><role specific-use="referee">Reviewer</role></contrib></contrib-group></front-stub><body><p>Summary:</p><p>This work uses a novel, ethologically relevant behavioral task to explore decision-making paradigms in <italic>C. elegans</italic> foraging behavior. By rigorously quantifying multiple features of animal behavior as they navigate in a patch food environment, the authors provide strong evidence that worms exhibit one of three qualitatively distinct behavioral responses upon encountering a patch: (1) &quot;search&quot;, in which the encountered patch is below the detection threshold; (2) &quot;sample&quot;, in which animals detect a patch encounter and reduce their motor speed, but do not stay to exploit the resource and are therefore considered to have &quot;rejected&quot; it; and (3) &quot;exploit&quot;, in which animals &quot;accept&quot; the patch and exploit the resource for tens of minutes. Interestingly, the probability of these outcomes varies with the density of the patch as well as the prior experience of the animal. Together, these experiments provide an interesting new framework for understanding the ability of the <italic>C. elegans</italic> nervous system to use sensory information and internal state to implement behavioral state decisions.</p><p>Strengths:</p><p>The work uses a novel, neuroethologically-inspired approach to studying foraging behavior</p><p>The studies are carried out with an exceptional level of quantitative rigor and attention to detail</p><p>Powerful quantitative modeling approaches including GLMs are used to study the behavioral states that worms enter upon encountering food, and the parameters that govern the decision about which state to enter</p><p>The work provides strong evidence that <italic>C. elegans</italic> can make 'accept-reject' decisions upon encountering a food resource</p><p>Accept-reject decisions depend on the quality of the food resource encountered as well as on internally represented features that provide measurements of multiple dimensions of internal state, including feeding status and time.</p></body></sub-article><sub-article article-type="referee-report" id="sa2"><front-stub><article-id pub-id-type="doi">10.7554/eLife.103191.4.sa2</article-id><title-group><article-title>Reviewer #2 (Public review):</article-title></title-group><contrib-group><contrib contrib-type="author"><anonymous/><role specific-use="referee">Reviewer</role></contrib></contrib-group></front-stub><body><p>This study provides an experimental and computational framework to examine and understand how <italic>C. elegans</italic> make decisions while foraging environments with patches of food. The authors show that <italic>C. elegans</italic> reject or accept food patches depending on a number of internal and external factors.</p><p>The key novelty of this paper is the explicit demonstration of behavior analysis and quantitative modeling to elucidate decision-making processes. In particular, the description of the exploring vs. exploiting phases, and sensing vs. non-sensing categories of foraging behavior based on the clustering of behavioral states defined in a multi-dimensional behavior-metrics space, and the implementation of a generalized linear model (GLM) whose parameters can provide quantitative biological interpretations.</p><p>The work builds on the literature of <italic>C. elegans</italic> foraging by adding the reject/accept framework.</p></body></sub-article><sub-article article-type="referee-report" id="sa3"><front-stub><article-id pub-id-type="doi">10.7554/eLife.103191.4.sa3</article-id><title-group><article-title>Reviewer #3 (Public review):</article-title></title-group><contrib-group><contrib contrib-type="author"><anonymous/><role specific-use="referee">Reviewer</role></contrib></contrib-group></front-stub><body><p>Summary:</p><p>In this study by Haley et al, the authors investigated explore-exploit foraging using <italic>C. elegans</italic> as a model system. Through an elegant set of patchy environment assays, the authors built a GLM based on past experience that predicts whether an animal will decide to stay on a patch to feed and exploit that resource, instead of choosing to leave and explore other patches.</p><p>Strengths:</p><p>I really enjoyed reading this paper. The experiments are simple and elegant, and address fundamental questions of foraging theory in a well-defined system. The experimental design is thoroughly vetted, and the authors provide a considerable volume of data to prove their points.</p><p>Weakness:</p><p>History-dependence of the GLM. The logistic GLM seems like a logical way to model a binary choice, and I think the parameters you chose are certainly important. However, the framing of them seem odd to me. I do not doubt the animals are assessing the current state of the patch with an assessment of past experience; that makes perfect logical sense. However, it seems odd to reduce past experience to the categories of recently exploited patch, recently encountered patch, and time since last exploitation. This implies the animals have some way of discriminating these past patch experiences and committing them to memory. Also, it seems logical that the time on these patches, not just their density, should also matter, just as the time without food matters. Time is inherent to memory. This model also imposes a prior categorization in trying to distinguish between sensed vs. not-sensed patches, which I criticized earlier. Only &quot;sensed&quot; patches are used in the model, but it is questionable whether worms genuinely do not &quot;sense&quot; these patches.</p><p>It seems more likely the worm simply has some memory of chemosensation and relative satiety, both of which increase on patches, and decrease while off of patches. The magnitudes are likely a function of patch density. That being said, I leave it up to the reader to decide how best to interpret the data.</p><p>Impact:</p><p>I think this work will have a solid impact on the field, as it provides tangible variables to test how animals assess their environment and decide to exploit resources. I think the strength of this research could be strengthened by a reassessment of their model that would both simplify it and provide testable timescales of satiety/starvation memory.</p></body></sub-article><sub-article article-type="author-comment" id="sa4"><front-stub><article-id pub-id-type="doi">10.7554/eLife.103191.4.sa4</article-id><title-group><article-title>Author response</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>Haley</surname><given-names>Jessica A</given-names></name><role specific-use="author">Author</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/0168r3w48</institution-id><institution>Neurosciences Graduate Program, University of California, San Diego</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/03xez1567</institution-id><institution>Molecular Neurobiology Laboratory, Salk Institute for Biological Studies</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff></contrib><contrib contrib-type="author"><name><surname>Chen</surname><given-names>Tianyi</given-names></name><role specific-use="author">Author</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/03xez1567</institution-id><institution>Molecular Neurobiology Laboratory, Salk Institute for Biological Studies</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff></contrib><contrib contrib-type="author"><name><surname>Aoi</surname><given-names>Mikio</given-names></name><role specific-use="author">Author</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/0168r3w48</institution-id><institution>Halıcıoğlu Data Science Institute, University of California, San Diego</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/0168r3w48</institution-id><institution>Department of Neurobiology, University of California, San Diego</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff></contrib><contrib contrib-type="author"><name><surname>Chalasani</surname><given-names>Sreekanth H</given-names></name><role specific-use="author">Author</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/03xez1567</institution-id><institution>Molecular Neurobiology Laboratory, Salk Institute for Biological Studies</institution></institution-wrap><addr-line><named-content content-type="city">La Jolla</named-content></addr-line><country>United States</country></aff></contrib></contrib-group></front-stub><body><p>The following is the authors’ response to the previous reviews.</p><disp-quote content-type="editor-comment"><p><bold>Reviewer #1 (Public review):</bold></p><p>Summary:</p><p>This work uses a novel, ethologically relevant behavioral task to explore decision-making paradigms in <italic>C. elegans</italic> foraging behavior. By rigorously quantifying multiple features of animal behavior as they navigate in a patch food environment, the authors provide strong evidence that worms exhibit one of three qualitatively distinct behavioral responses upon encountering a patch: (1) &quot;search&quot;, in which the encountered patch is below the detection threshold; (2) &quot;sample&quot;, in which animals detect a patch encounter and reduce their motor speed, but do not stay to exploit the resource and are therefore considered to have &quot;rejected&quot; it; and (3) &quot;exploit&quot;, in which animals &quot;accept&quot; the patch and exploit the resource for tens of minutes. Interestingly, the probability of these outcomes varies with the density of the patch as well as the prior experience of the animal. Together, these experiments provide an interesting new framework for understanding the ability of the <italic>C. elegans</italic> nervous system to use sensory information and internal state to implement behavioral state decisions.</p><p>Strengths:</p><p>The work uses a novel, neuroethologically-inspired approach to studying foraging behavior</p><p>The studies are carried out with an exceptional level of quantitative rigor and attention to detail</p><p>Powerful quantitative modeling approaches including GLMs are used to study the behavioral states that worms enter upon encountering food, and the parameters that govern the decision about which state to enter</p><p>The work provides strong evidence that <italic>C. elegans</italic> can make 'accept-reject' decisions upon encountering a food resource</p><p>Accept-reject decisions depend on the quality of the food resource encountered as well as on internally represented features that provide measurements of multiple dimensions of internal state, including feeding status and time</p><p><bold>Reviewer #2 (Public review):</bold></p><p>This study provides an experimental and computational framework to examine and understand how <italic>C. elegans</italic> make decisions while foraging environments with patches of food. The authors show that <italic>C. elegans</italic> reject or accept food patches depending on a number of internal and external factors.</p><p>The key novelty of this paper is the explicit demonstration of behavior analysis and quantitative modeling to elucidate decision-making processes. In particular, the description of the exploring vs. exploiting phases, and sensing vs. non-sensing categories of foraging behavior based on the clustering of behavioral states defined in a multi-dimensional behavior-metrics space, and the implementation of a generalized linear model (GLM) whose parameters can provide quantitative biological interpretations.</p><p>The work builds on the literature of <italic>C. elegans</italic> foraging by adding the reject/accept framework.</p><p><bold>Reviewer #3 (Public review):</bold></p><p>Summary:</p><p>In this study by Haley et al, the authors investigated explore-exploit foraging using <italic>C. elegans</italic> as a model system. Through an elegant set of patchy environment assays, the authors built a GLM based on past experience that predicts whether an animal will decide to stay on a patch to feed and exploit that resource, instead of choosing to leave and explore other patches.</p><p>Strengths:</p><p>I really enjoyed reading this paper. The experiments are simple and elegant, and address fundamental questions of foraging theory in a well-defined system. The experimental design is thoroughly vetted, and the authors provide a considerable volume of data to prove their points. My only criticisms have to do with the data interpretation, which I think are easily addressable.</p><p>Weaknesses:</p><p>History-dependence of the GLM</p><p>The logistic GLM seems like a logical way to model a binary choice, and I think the parameters you chose are certainly important. However, the framing of them seem odd to me. I do not doubt the animals are assessing the current state of the patch with an assessment of past experience; that makes perfect logical sense. However, it seems odd to reduce past experience to the categories of recently exploited patch, recently encountered patch, and time since last exploitation. This implies the animals have some way of discriminating these past patch experiences and committing them to memory. Also, it seems logical that the time on these patches, not just their density, should also matter, just as the time without food matters. Time is inherent to memory. This model also imposes a prior categorization in trying to distinguish between sensed vs. not-sensed patches, which I criticized earlier. Only &quot;sensed&quot; patches are used in the model, but it is questionable whether worms genuinely do not &quot;sense&quot; these patches.</p><p>It seems more likely that the worm simply has some memory of chemosensation and relative satiety, both of which increase on patches and decrease while off of patches. The magnitudes are likely a function of patch density. That being said, I leave it up to the reader to decide how best to interpret the data.</p></disp-quote><p>Model design: We agree with the reviewer that past experience is not likely to be discretized into the exact parameters of our model. We have added to our manuscript to further clarify this point (lines 645-647). Investigating the mechanisms behind this behavior is beyond the scope of this project but is certainly an exciting trajectory for future <italic>C. elegans</italic> research.</p><disp-quote content-type="editor-comment"><p>osm-6</p><p>The argument is that osm-6 animals can't sense food very well, so when they sense it, they enter the exploitation state by default. That is what they appear to do, but why? Clearly they are sensing the food in some other way, correct? Are ciliated neurons the only way worms can sense food? Don't they also actively pump on food, and can therefore sense the food entering their pharynx? I think you could provide further insight by commenting on this. Perhaps your decision model is dependent on comparing environmental sensing with pharyngeal sensing? Food intake certainly influences their decision, no? Perhaps food intake triggers exploitation behavior, which can be over-run by chemo/mechanosensory information?</p></disp-quote><p>osm-6 behavior: We thank the reviewer for pointing out the need to further elaborate on a mechanistic hypothesis to explain the behavior of osm-6 sensory mutants. We agree with the reviewer’s speculation that post-ingestive and other non-ciliary sensory cues likely drive detection of food. We have added additional commentary to our manuscript to state this (lines 529-538).</p><disp-quote content-type="editor-comment"><p>Impact</p><p>I think this work will have a solid impact on the field, as it provides tangible variables to test how animals assess their environment and decide to exploit resources. I think the strength of this research could be strengthened by a reassessment of their model that would both simplify it and provide testable timescales of satiety/starvation memory.</p><p><bold>Reviewer #2 (Recommendations for the authors):</bold></p><p>The authors have addressed most of my concerns.</p><p><bold>Reviewer #3 (Recommendations for the authors):</bold></p><p>The authors provide a considerable amount of processed data (great, thank you!), but it would be even better if they provided the raw data of the worm coordinates, and when and where these coordinates overlapped with patches. This is the raw data that was ultimately used for all the quantifications in the paper, and would be incredibly useful to readers who are interested in modeling the data themselves.</p><p>This should not be prohibitive.</p></disp-quote><p>Data Availability: We thank the reviewer for pointing out this need. We are uploading all processed data (e.g. worm coordinates relative to the arena and patches) to a curated data storage server. We have updated our data availability statement to state this (lines 684-688).</p><disp-quote content-type="editor-comment"><p>Search vs. sample &amp; sensing vs. non-sensing.</p><p>The different definitions of behaviors in Figures 2H-K are a bit confusing. I think the confusion stems in part from the changing terms and color associations in Figures 2 H-K. Essentially the explore density in Figure 2 H is split into two densities based on the two densities (sensing vs. non-responding) observed in Figure 2I. In turn, the sensing density in Figure 2I is split into two densities (explore vs exploit) based on the two densities observed in Figure 2 H. But the way the figures are colored, yellow means search (Figure 2H) and non-responding (Figure 2I), green means exploit (Figure 2H) which includes sensing and non-responding, but also exclusively sensing (Figure 2I), and blue consistently means exploit in both figures. It might help to use two different color codes for Figures 2H and 2I, and then in 2J you define search as explore AND non-responding, sample as explore AND sensing, and exploit as exploit.</p></disp-quote><p>Color schema: While we understand the confusion, we believe that introducing additional colors may also present some misunderstandings. We have decided to leave the figure as it is.</p></body></sub-article></article>