jacamo-lang / jacamo

This project aims to promote the MultiAgent Oriented Programming (MAOP) approach by providing a suitable integration of tools and languages for programming agents, their environment and organisation.
https://jacamo-lang.github.io
GNU Lesser General Public License v3.0
77 stars 31 forks source link

Ttd eventually #44

Closed cleberjamaral closed 1 year ago

cleberjamaral commented 1 year ago

Using a jacamoTest task that prints the report twice. The first printing is not colored, but it happens step by step, showing reports even partially. The second is the colored version. It is not elegant but at least is handling the situation, showing partial reports, which is crucial to understand the situation when a test is crashing.

Regarding the "eventually" approach, the new version is using .wait. In summary, we are replacing the .at by the .wait approach.

//Using .at
+!some_plan <-
    .at("now +200 ms", {+!timeout});
    !eventually.
+!timeout <- +timeout.
+!eventually: timeout | condition.
+!eventually: not timeout <-
  //some action
  !eventually.
//Using .wait
+!some_plan <-
    !!pollVariable;
    .wait(condition, 200, EventTime);
    .drop_desire(pollVariable).
+!pollVariable: condition.
+!pollVariable  <-
    //do some action
    !pollVariable.