swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: floating point time scheduling


From: Andre Costa
Subject: Re: floating point time scheduling
Date: Thu, 23 Nov 2000 12:20:48 +1030 (CST)

Hi all,

thanks Marcus for your description of the Schedule/Activity machinery and
its relation to floating-point time (FPT) scheduling.

I have a related scheduling problem which i don't know how to solve:

I have a ModelSwarm, which creates two instances of SwarmObject, call them 
A and B. 
All Swarms have their own FPT schedule (as in the DoubleSchedule.java
example in the mailing-list archives).

In the ModelSwarm, A is created at "startup" at the same schedule time
(t=0) of the ModelSwarm as B, although in the code, A is created (one
line) before B.

During the running of the simulation, A and B are both synchronized with 
each other and the ModelSwarm in terms of the integer part of their
schedules, but A executes all of its fractional-time events _before_ those
of B, even when events of the different SwarmObject should be
"interspersed" within an integer time interval, eg: a screen printout
within the integer-part time interval [1,2] gives something like


A::action executing at time 1.1
A::action executing at time 1.5
A::action exectuing at time 1.9

B::action executing at time 1.1
B::action executing at time 1.2
B::action executing at time 1.8

When I schedule A and B's actions onto the ModelSwarm's FPT schedule
, I get the correct ordering of event execution, ie: 

{1.1,1.1}, {1.2}, {1.5}, {1.8}, {1.9}.

which is what i would like to achieve with each SwarmObject having its own
FPT schedule.

I have tried making calls of the form
topLevelActivity->SwarmActivity->getCurrentTime

but I can't seem to get the fractional-time ordering right across
SwarmObjects ...

any suggestions ?

thanks,
Andre.


On 14 Nov 2000, Marcus G. Daniels wrote:

> >>>>> "AC" == Andre Costa <address@hidden> writes:
> 
> AC> My question is: what is the relation between the times returned by
> 
> AC>   (int) Globals.env.getCurrentTime()
> 
> AC> and the time returned by
> 
> AC>   (int) scheduleActivity.getCurrentTime()
> 
> The former returns the current time of the current activity. 
> 
> In the case of a Schedule configured with a concurrent group type of
> ConcurrentSchedule, and an action scheduled and run from that
> schedule, the `current' activity will be the [inner] one dynamically created
> for groups of fractionally-scheduled actions.  So in this context, the
> former call will print out fractional timesteps.
> 
> scheduleActivity (the variable used in the DoubleSchedule.java
> example), is the activity returned by activating the main schedule.
> When you ask for the current time for this activity, you'll get the
> time associated with the current position of the activity on the
> primary schedule; the coarser non-fractional timesteps.
> 
> Keep in mind that an activity tracks a particular schedule, and that
> the current time for that activity can only reflect what is in that
> particular schedule.  If you want to see what time it is across 
> a set of schedules/activities, you need to go `up' in the tree
> of activities.  You can do that by using calls like getTopLevelActivity 
> (top of activity tree) or getSwarmActivity (the most immediate Swarm),
> and then sending getCurrentTime to the returned activity.
> 
>                   ==================================
>    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.
> 
> 


                  ==================================
   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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]