<commit_before>;
; Demand updaters
;
; @author <NAME> <EMAIL>
; @date   2011-05-17
;

(define (EnergyDemandUpdater)
    (get_latest_predicate_truth_value_mean "energy") 
) 

(define (WaterDemandUpdater)
    (- 1
       (get_latest_predicate_truth_value_mean "thirst") 
    ) 
)    

(define (IntegrityDemandUpdater)
    (get_latest_predicate_truth_value_mean "fitness")
)

(define (AffiliationDemandUpdater)
    (let* ( (proximity
                 (get_proximity (get_owner) (get_self) )
            )

            (fitness
                (get_latest_predicate_truth_value_mean "fitness") 
            )
          )

         ; Note: We take fitness into consideration, because when you are in bad
         ; situation, you would probably miss your family and friends
          (* (expt proximity 0.5) 
             (expt fitness 0.5)  
          )   
    )
)

(define (CertaintyDemandUpdater)
    (let* ( (curious_about_evaluation_link_list
                (query_atom_space (find_evaluation_link "curious_about") ) 
            )

            (familiar_with_evaluation_link_list 
                (query_atom_space (find_evaluation_link "familiar_with") )
            )   

            (know_evaluation_link_list
                (query_atom_space (find_evaluation_link "know") ) 
            )

            (curious_about_level 0)
            (familiar_with_level 0)<commit_msg>relate affiliation demand with pending questions<commit_after>;
; Demand updaters
;
; @author <NAME> <EMAIL>
; @date   2011-10-28
;

(define (EnergyDemandUpdater)
    (get_latest_predicate_truth_value_mean "energy") 
) 

(define (WaterDemandUpdater)
    (- 1
       (get_latest_predicate_truth_value_mean "thirst") 
    ) 
)    

(define (IntegrityDemandUpdater)
    (get_latest_predicate_truth_value_mean "fitness")
)

;(define (AffiliationDemandUpdater)
;    (let* ( (proximity
;                 (get_proximity (get_owner) (get_self) )
;            )
;
;            (fitness
;                (get_latest_predicate_truth_value_mean "fitness") 
;            )
;          )
;
;         ; Note: We take fitness into consideration, because when you are in bad
;         ; situation, you would probably miss your family and friends
;          (* (expt proximity 0.5) 
;             (expt fitness 0.5)  
;          )   
;    )
;)

(define (AffiliationDemandUpdater)
    (let ( (eval_has_unanswered_question
               (EvaluationLink (PredicateNode "has_unanswered_question") )
           )
         ) 

        (- 1 (get_truth_value_mean (cog-tv eval_has_unanswered_question) ) )
    )
)

; TODO: Think about how to connect certainty demand with dialog system? 
;       A possible question might be evaluate how much infomaton the agent knows
;       about the world, objects and agents. And then it can ask questions on that stuff.
(define (CertaintyDemandUpdater)
    (let* ( (curious_about_evaluation_link_list
                (query_atom_space (find_evaluation_link "curious_about") ) 
            )

            (familiar_with_evaluation_link_list 
                (query_atom_space (find_evaluation_link "familiar_with") )
            )   

            (know_evaluation_link_list
                (query_atom_space (find_evaluation_link "know") ) 
            )

            (curious_about_level 0)
            (familiar_with_level 0)
{'fraction_non_alphanumeric': 0.08406146429647485, 'fraction_numerical': 0.009340162699608317, 'mean_word_length': 2.267716535433071, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '657229', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1036, 'n_words': 207}