[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Randomising ActionGroup
From: |
Axel von Kamp |
Subject: |
Re: Randomising ActionGroup |
Date: |
Sat, 27 Feb 1999 10:10:40 +0000 |
Marcus G. Daniels wrote:
> AVK> If you've got a randomized ActionGroup working, could you please
> AVK> send me an excerpt from your program which shows how to do it?
>
> When there is a technical problem, excerpts are not that helpful
> because they tend to reflect more the author's intent, and often, even
> though the intent is reasonable, details or context are broken in some
> obscure way. Reproducability is God!
>
[program deleted]
Ok, your example program works. But now consider the following program
where I put the randomized ActionGroupt onto a schedule:
int
main (int argc, const char ** argv)
{
id actionGroupTest;
id modelSchedule;
id obj;
initSwarmBatch (argc, argv);
modelSchedule = [Schedule createBegin: globalZone];
[modelSchedule setRepeatInterval: 1];
modelSchedule = [modelSchedule createEnd];
actionGroupTest = [ActionGroup createBegin: globalZone];
obj = [Responder create: globalZone];
[actionGroupTest setDefaultOrder: Randomized];
actionGroupTest = [actionGroupTest createEnd];
[actionGroupTest createActionTo: obj message: M(m1)];
[actionGroupTest createActionTo: obj message: M(m2)];
[actionGroupTest createActionTo: obj message: M(m3)];
[modelSchedule at: 0 createAction: actionGroupTest];
[[modelSchedule activateIn: nil] run];
}
Everything else stays as it was before. When I run this program, the
actionGroupTest ActionGroup will be executed once and even in random
order but after that the program crashes with a segmentation fault. If I
set the defaultOrder to Concurrent instead of Randomized, the program
runs as expected.
Can you reproduce this behaviour? Have I done anyting illegal or unusual
in this program?
Thanks for you help,
Axel
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.