| Algorithm 1 Needs learning algorithm |
| Initialize the independent variable of basic needs and the one of growth needs Initialize the maximum exploration probability Initialize M tables of basic needs and growth needs Initialize c = 1 Repeat (for each episode): r ← ← ← c ← 1+ɑ If > then Dominant Need ← growth needs Else Dominant Need ← basic needs Choose , from A at random Choose randomly from the interval [0, 1) If < r then = {,} Save into A Else If s in M table of dominant need then Take with the largest M value from the M table of dominant need Else ← Execute action to obtain the environmental improvement amount Update M table of dominant need with , s, |