trueagi-io / metta-examples

Discussion of MeTTa programming with examples
MIT License
20 stars 18 forks source link

in child_ai.py hard to understand the curiosity_behavior function #21

Open aymeric75 opened 1 year ago

aymeric75 commented 1 year ago

Hi,

From child_ai.py

we have


# Initial data preparation
data_motivation = {
    'Time': [1], 
    'Motivation': ['Reflex'],
    'Need': ['Pay Attention on Unusual Event'],
    'Action': ['Research Unusual Event'],
    'Result': ['Understand Unusual Event'], 
    'Status': [[['Visual', 'Other'],['Hearing', 'Other'],['Touch', 'Other']]]
    }
Motivation_Global = pd.DataFrame(data_motivation)

then


# Business logic of curiosity behaviour of Child
def curiosity_behavior(Start, End):
    for t in range(Start, End+1):
        Motivation_item = Motivation_Global[Motivation_Global['Time']==t]
        if Motivation_item.size != 0:
            Is_Result_Achieved = PDCA_func(Motivation_item)
            if Is_Result_Achieved:
                print("Result is achieved! Time: ", t)
            t = t + 1
    print("curiosity_behavior ends.")

Motivation_Global['Time'] is equal to [1] , so basically [1] will never be equal to 1 or 2 or 3 etc. that's why I don't understand this line: Motivation_item = Motivation_Global[Motivation_Global['Time']==t]

Furthermore, Motivation_Global['Time']==t will return either True or False, but Motivation_Global[True] or Motivation_Global[False]does not exists...

Thanks