Skip to main content
. 2023 Jan 19;23(3):1140. doi: 10.3390/s23031140
Algorithm 1 Algorithms switching framework

     Data: agent, source                           ▹ Location of agent and odor source

           gridMap, obstacle                        ▹ Given environmental components

  • 1:

    procedureOSL

  • 2:

        sourceFound← false

  • 3:

        for all cij in gridMap do

  • 4:

            p(cij)←1/size(gridMap)                           ▹ Initialize uniform distribution

  • 5:

        end for

  • 6:

        Lenv← decompose(gridMap,obstacle)                                   ▹Lenv={E1,E2,⋯,EK}

  • 7:

        while sourceFound = false do

  • 8:

            Ek*← max(Lenv)

  • 9:

            if agent in Ek* then                                                  ▹ Switch to Infotaxis algorithm

  • 10:

               action←argmaxa∈A′E[ΔS(a)]

  • 11:

               agent← move(agent, action)

  • 12:

            else                                                                             ▹ Switch to Dijkstra algorithm

  • 13:

               jumpTarget←argmaxcij∈Ek*p(cij)

  • 14:

               path← dijkstra(agent, jumpTarget)

  • 15:

               agent← move(agent, path)

  • 16:

            end if

  • 17:

            sensorValue← sampling()

  • 18:

            gridMap← update(agent,sensorValue,gridMap)

  • 19:

            if ∥agent−source∥<targetRadii then

  • 20:

               sourceFound← true.

  • 21:

            end if

  • 22:

        end while

  • 23:

    end procedure