[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hypothetical Question
From: |
Doug Donalson |
Subject: |
Re: Hypothetical Question |
Date: |
Mon, 9 Oct 2000 21:41:04 -0700 |
You're using the latest swarm.dll, yes?
I don't really know, I'm using the 2.1.1 install. Are there any Objc
updates to that?
I realized that I had a tool that you showed me that I wasn't using when I
printed the schedule, xprint. I added that to my "schedule printer" and got
an interesting result. First the basic code of printSchedule (note that it
is just a version of the asynchronous schedule code Roger wrote for me) and
then the results of a schedule print.
The Code:
- printSchedule
{
timeval_t timeOfAction,actionAtTime;
double presentTime;
id index,groupIndex;
timeval_t nextSuperEvent,nextSubEvent;
int eventCount=0;
// return NULL;
index = [eventSchedule begin: [self getZone] ];
while ( (actionAtTime = [index next]) )
{
puts("Group break");
timeOfAction = (timeval_t) [index getKey]; // key of member is
time value
if ( [actionAtTime getClass] == id_ActionConcurrent_c )
{
groupIndex = [((ActionConcurrent_c
*)actionAtTime)->concurrentGroup
begin: [self getZone]];
while ( (actionAtTime = [groupIndex next]) )
{
printf("at time: %u.%u action is: %0#8x \n"
,timeOfAction,[groupIndex getKey],actionAtTime);
fflush(stdout);
xprint(actionAtTime);
fflush(stdout);
eventCount++;
if( eventCount > 20 )
return NULL;
}
[groupIndex drop];
}
else
{
printf( "at time: %u action is:
%0#8x\n",timeOfAction,actionAtTime );
}
}
[index drop];
return NULL;
}
Here is a snipit of the schedule print containing the errent action:
Group break
at time: 1262.234155772 action is: 0x479a310
[0x4662e90: MusselModelSwarm addNewMussel]
at time: 1262.245354635 action is: 0x4d9aa50
[0x48c6f00: Mussel stopGrowing]
at time: 1262.250615077 action is: 0x4a8ab88
[0x47222c0: Mussel die]
// Below is the bad boy. (Comment added in email, not code.)
at time: 1262.256553438 action is: 0x4c491e8
[ActionConcurrent_c 0x4c491e8: ActionConcurrent_c concurrentGroup:0x4c491c8:
ConcurrentGroup_c]
at time: 1262.264746017 action is: 0x49daa20
[ActionConcurrent_c 0x49daa20: ActionConcurrent_c concurrentGroup:0x4eb66b0:
ConcurrentGroup_c]
at time: 1262.267642317 action is: 0x4a71a50
[0x47b1c80: Mussel die]
at time: 1262.268432030 action is: 0x510ee00
[0x4f7c1d0: Mussel die]
at time: 1262.276827167 action is: 0x4fd42e8
[0x4884138: Mussel die]
at time: 1262.281510679 action is: 0x4bc7f28
[ActionConcurrent_c 0x4bc7f28: ActionConcurrent_c concurrentGroup:0x518f718:
ConcurrentGroup_c]
Are the xprints that have the form [ActionConcurrent...] concurrent groups
in the subschedule? If so is there a way to modify my printSchedule code to
print out actions contained in a concurrent group in a subschedule?
Otherwise, what is xprint telling me?
I have just made a text document of the execution of events leading up to
the error
and am attaching it. It shows where the error is occuring and I annotated
it as best I
could. It was cut and pasted from the schedule print format from above. I
f I can
get into what I am assuming is the concurrent group in the subschedule then
I can probably figure out what is going on. (This email has been in work
for
about 3 hours. [grin])
Cheers,
D4
debug1.txt
Description: Text document