diff --git a/dist/awareness.c b/dist/awareness.c index 2ec0dce..c4eca5c 100644 --- a/dist/awareness.c +++ b/dist/awareness.c @@ -240,9 +240,11 @@ el_val_t emit_heartbeat(void) { el_val_t proactive_curiosity(void) { el_val_t ts = time_now(); - el_val_t minute_block = (ts / 60000); - EL_NULL; - 4; + el_val_t ts_minutes = (ts / 60000); + el_val_t minute_q = (ts_minutes / 4); + el_val_t minute_q2 = (minute_q + minute_q); + el_val_t minute_q4 = (minute_q2 + minute_q2); + el_val_t minute_block = (ts_minutes - minute_q4); state_set(EL_STR("cseed_a"), EL_STR("memory")); state_set(EL_STR("cseed_b"), EL_STR("knowledge")); state_set(EL_STR("cseed_c"), EL_STR("context")); @@ -473,21 +475,16 @@ el_val_t awareness_run(void) { if (curiosity_interval < 1) { curiosity_interval = 1; } - el_val_t should_scan = ((!did_work && (idle_n > 0)) && idle_n); - EL_NULL; - ((curiosity_interval == 0) && !idle_n); - (beat_interval == 0); - EL_NULL; - if (should_scan) { - el_val_t found_something = proactive_curiosity(); - } - el_val_t should_beat = ((!did_work && (idle_n > 0)) && idle_n); - EL_NULL; - (beat_interval == 0); + el_val_t should_beat = ((!did_work && (idle_n > 0)) && (idle_n >= beat_interval)); if (should_beat) { emit_heartbeat(); idle_reset(); } + el_val_t should_scan = (((!did_work && (idle_n > 0)) && (idle_n >= curiosity_interval)) && !should_beat); + if (should_scan) { + el_val_t found_something = proactive_curiosity(); + idle_reset(); + } sleep_ms(tick_ms); } return 0;