Skip to main content
. 2022 Sep 26;22(19):7302. doi: 10.3390/s22197302
Algorithm 1 Needs learning algorithm
 Initialize the independent variable of basic needs xBNS and the one of growth needs
xGNS
 Initialize the maximum exploration probability rmax
 Initialize M tables of basic needs and growth needs
 Initialize c = 1
 Repeat (for each episode):
  r ← rmax2l1
  xBNS11+e10cfBNSs
  xGNS11+e10cfGNSs5xBNS
  c ← 1+ɑxGNS
  If xGNS>xBNS then
    Dominant Need ← growth needs
  Else
    Dominant Need ← basic needs
  Choose Am,An from A at random
  Choose r0 randomly from the interval [0, 1)
  If r0 < r then
    Ak = {Am,An}
    Save Ak into A
  Else
    If s in M table of dominant need then
      Take Ak with the largest M value from the M table of dominant need
    Else
     AkAn
  Execute action Ak to obtain the environmental improvement amount Ms
  Update M table of dominant need with Ak, s, Ms