OK. So here's a puzzle.
My mental model of Tinderbox is that an Agent performs a query, returns results, and then executes the Agent Action against the results.
As mentioned elsewhere, I initially had code of the form:
Code:Field1(agent) = count(collect_if(child,$TextFrom="Number1",$Name));
Field2(agent) = count(collect_if(child,$TextFrom="Number2",$Name));
Field3(agent) = count(collect_if(child,$TextFrom="Number3",$Name));
TermScore(agent) = ($Field1*2) + ($Field2*1) + ($Field3*0.5)
I then added a guard capability to limit execution of the code.
Code:if( !(ComputedCount(agent)=$ChildCount(agent) | ComputedTotal(TermScoreTotaller)=$ComputedTotal(agent)) )
{
Field1(agent) = count(collect_if(child,$TextFrom="Number1",$Name));
Field2(agent) = count(collect_if(child,$TextFrom="Number2",$Name));
Field3(agent) = count(collect_if(child,$TextFrom="Number3",$Name));
TermScore(agent) = ($Field1*2) + ($Field2*1) + ($Field3*0.5);
ComputedCount(agent)=$ChildCount(agent); ComputedTotal(agent)=$ComputedTotal(TermScoreTotaller);
}
At first, I was elated at the speedup. Alas, I found that the use of this code made
all but the first agent fail to
query.
I think I could figure out what was going wrong if all but the first agent action failed to execute. But I can't understand how what I've written in this agent action could possibly prevent subsequent agents from querying.
:'(