Skip to main content
. 2017 Nov 2;17(11):2514. doi: 10.3390/s17112514
Algorithm 4 Generate_Environments(T)
  • Require: 

    Noise function T

  • Ensure: 

    set of environments

  • 1:

    Q

  • 2:

    for all RNG seed i from 1 to N do

  • 3:

    for all coordinates (x,y) in the environment do

  • 4:

      Ei[x,y]T(x,y,i)

  • 5:

    end for

  • 6:

     Threshold Ei such that 66% of the workspace is collision free.

  • 7:

     Select the largest connected component and set it as free space. Make all other regions obstacles.

  • 8:

    if amount of free space is within tolerance then

  • 9:

      Remove obstacles below the minimum size threshold in pixels in Ei.

  • 10:

      add Ei to Q

  • 11:

    end if

  • 12:

    end for

  • 13:

    return Q