swarm-support
[Top][All Lists]
Advanced

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

Argument passing in Schedule


From: Ho-Sheng Hsiao
Subject: Argument passing in Schedule
Date: Sat, 8 Feb 1997 18:56:15 -0500 (EST)

I've gotten to the point where rehashing the docs and the demoes is
driving me nuts, so would someone please kindly help me on this.

The way I coded my model, I have a two schedules under one ModelSwarm. One
is the regular repeating schedule, and the other holds a discrete event
"scratch schedule" a la mousetraps.

The repeating schedule controls the model's interval -- and since I'm
using multiple model swarms, I can produce different interval ratios. But
I still require a discrete event portion of the model, so I used a
seperate (non-repeating, autodropping) schedule to handle that. 

The repeating schedule works fine; however, the scratch schedule doesn't.

Specifically, I defined a function,

-(void) modelDeliverRouterMessage: (RouterMessage *) msg To: (id) target {

   [modelScratchSchedule at: (getCurrentTime() + 1
    createActionTo: target
    message: M(eventReceiveMessage:):msg];
}

Here is the problem: I don't know if the message is being passed, or if
the argument is being passed. I looked through a hard-copy of NeXT's ObjC
manual, and they were pretty vague on the selector names. 

The definition for eventReceiveMessage is

-(int) eventReceiveMessage: (RouterMessage *) msg;

And looking through the manual and the demoes, I think what you put into
the M() macro makes a difference. The runtime environment kicks out
whenever an receiving object doesn't respond to a message, so I assume for
the schedules, it is the same. (Is it?) If it is, then I'm doing something
wrong with passing the argument; if it isn't, then I'm doing something
wrong in naming the selector.

In any case, please respond as soon as possible... I'm kinda under
pressure to get a demo up and running soon. :)


---hhh     






reply via email to

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