[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ordering events in a swarm ....
From: |
xueyue |
Subject: |
Re: ordering events in a swarm .... |
Date: |
Tue, 08 Jun 1999 10:50:33 +0000 |
Dear All,
I would like to further clarify the problem which I presented
earlier. I think Schedule class definition coming from Swarm
should allow event to be scheduled in random order.
(1) tm is current time, schedulerSwarm is a Swarm object of class
SchedulerSwarm, in which buildActions has an object schedule:
-buildActions {
....
schedule=[Schedule create: self];
[schedule setAutoDrop: 1];
...
}
and
-newScheduleAt: (timeval_t) t target: (id) tg message: (SEL) msg {
[schedule at: t createActionTo: target message: msg];
return self;
}
(2) I tested:
(2a) [schedulerSwarm newScheduleAt: tm+5 target: tgA message:
M(testA)];
will work;
(2b) [schedulerSwarm newScheduleAt: tm+5 target: tgB message: M(testB)];
will work;
(2c) [schedulerSwarm newScheduleAt: tm+5 target: tgA message:
M(testA)];
[schedulerSwarm newScheduleAt: tm+5+dt target: tgB message: M(testB)];
will work (dt>=0);
BUT, WILL NOT WORK if (dt < 0);
So, this is unlikely, there is any coding problem in my programme. I
think Schedule class can only schedule events
in their order of excuting. In other words, it seems in Schedule class
there is a queue Q of events:
Q=[e1(t1), e2(t2), ..., en(tn)]; (ti > t(i-1));
where ei is an event, ti is the time at which the event will
be excuted. Now, if there is event e(t), if t>=tn, then
it can be scheduled (inserted into Q), otherwise it can not
scheduled by schedule. If this is the case, Schedule class
will have its disadvantage.
Before I tested my programme, I always assume Schedule allows
random scheduling, but it doesn't. I need the function, can
anyone suggest a solution?
Many thanks!
vcard.vcf
Description: Card for Xueyue Huang
- ordering events in a swarm ...., xueyue, 1999/06/06
- Re: ordering events in a swarm ...., Ken Cline, 1999/06/06
- Re: ordering events in a swarm ...., xueyue, 1999/06/08
- Re: ordering events in a swarm ...., Marcus G. Daniels, 1999/06/11
- Re: ordering events in a swarm ...., xueyue, 1999/06/13
- Re: ordering events in a swarm ...., Marcus G. Daniels, 1999/06/13
- Re: ordering events in a swarm ...., xueyue, 1999/06/13
- Re: ordering events in a swarm ...., Marcus G. Daniels, 1999/06/13
- Re: ordering events in a swarm ...., Paul E. Johnson, 1999/06/14