You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
I've found out that FirstToScore behaves not how I thought it should.
Here's a code snippet:
// Define a multistep action of moving and drinkinglet move_and_drink = Steps::build().label("MoveAndDrink").step(MoveToWaterSource).step(Drink);// Define a multistep action of moving and eatinglet move_and_eat = Steps::build().label("MoveAndEat").step(MoveToFoodSource).step(Eat);// Define the thinkerlet thinker = Thinker::build().label("Thinker").picker(FirstToScore{threshold:0.8}).when(Hungry, move_and_eat).when(Thirsty, move_and_drink);
Situation:
Thirsty is 0.6, Hungry is 0.8
Thinker starts executing move and eat action.
Meanwhile doing the MoveToFoodSource part of the action, Thirsty reaches the threshold of 0.8.
Expected Behavior: Since the score calculation is FirstToScore, the move_and_eat action is continuing execution because it reached the threshold first.
Actual Behavior: MoveToFoodSource gets cancelled and MoveAndDrink starts executing.
In this exact case it this happens because move_and_eat is defined first in the thinker and move_and_drink second. It prioritizes the firstly defined action.
I've found out that
FirstToScorebehaves not how I thought it should.Here's a code snippet:
Situation:
MoveToFoodSourcepart of the action,Thirstyreaches the threshold of 0.8.Expected Behavior: Since the score calculation is
FirstToScore, themove_and_eataction is continuing execution because it reached the threshold first.Actual Behavior:
MoveToFoodSourcegets cancelled andMoveAndDrinkstarts executing.In this exact case it this happens because
move_and_eatis defined first in the thinker andmove_and_drinksecond. It prioritizes the firstly defined action.