From: Alassane &
Subject: LOOKING FOR A SCHEDULER
Date: 
Message-ID: <NDIAYE.92Sep22140733@sol.cs.uni-sb.de>
Dear Netters,
I'm writing in CLOS a multi-agent system. The agents are modelised as
classes, that communicate through messages realised as CLOS-methods.
I wouldn't codify the processing of the message -content while
sending the message. Thus, I need a scheduler, which looks
periodically if there is some task in the task-queue of each agent
(class-instance). The scheduler muss also be able to simulate
parallelism. Has someone already done this?
Any hints? please e-mail me.
Thanks -- alassane
-------------------------------------------------------------
|NET: ······@cs.uni-sb.de				    |
|-----------------------------------------------------------|
|POST: Alassane NDIAYE   	   |                        |
|      FB 14 - Informatik IV	   | PHONE: +49-681-302-4135|
|      Universitaet des Saarlandes |                        |
|      Im Stadtwald 15		   |------------------------|
|      D-6600 Saarbruecken 11	   | FAX:   +49-681-302-4421|
|      Federal Republic of Germany |			    |
-------------------------------------------------------------
--
-------------------------------------------------------------
|NET: ······@cs.uni-sb.de				    |
|-----------------------------------------------------------|
|POST: Alassane NDIAYE   	   |                        |
|      FB 14 - Informatik IV	   | PHONE: +49-681-302-4135|
|      Universitaet des Saarlandes |                        |
|      Im Stadtwald 15		   |------------------------|
|      D-6600 Saarbruecken 11	   | FAX:   +49-681-302-4421|
|      Federal Republic of Germany |			    |
-------------------------------------------------------------
From: Gregor Kiczales
Subject: Re: LOOKING FOR A SCHEDULER
Date: 
Message-ID: <GREGOR.92Sep22144746@tracer-bullet.parc.xerox.com>
I know you are asking for just a scheduler, but before being able to say
anything about that, a number of other questions came up.


   From: ······@sol.cs.uni-sb.de (Alassane &)
   Date: 22 Sep 92 12:07:33 GMT

   I'm writing in CLOS a multi-agent system. The agents are modelised as
   classes, that communicate through messages realised as CLOS-methods.

I'm having a hard time understanding your goal.  It may be that you are
using the terms "class" and "method" in not quite the usual CLOS way.
Does the following rewrite of your sentence capture what you are wanting
to do:

 I'm writing in CLOS a multi-agent system. The agents are modelised as
 objects, that communicate through messages realised as CLOS generic
 functions (or generic functions plus arguments).

Assuming that's correct, there's still a couple of questions I have
about what you want to do.  In particular, what kind of control do you
want over what kinds of work is deferred?  Three things that come to
mind are:
  
  (i) Be able to say of a given class, that whenever any message
      is sent to them (generic function is called on them), the
      execution of whatever methods are run should be put in a
      queue, and run at some later point.

 (ii) Be able to say of a given generic function that whenever it
      is called (that message is sent to an object) execution of
      whatever methods are run...

(iii) Be able to say of a given method that whenever it is run,
      its actual execution should be deferred.

In CLOS, which is a generic-function centric rather than object-centric
language, case ii and iii works much better than case i.  Given the
current MOP, it's hard (but not impossible) to make case (i) work at
all.  A class of generic function that works the way you suggest can be
defined by:

(defclass scheduled-gf (standard-generic-function)
     ()
  (:metaclass funcallable-standard-class))

(defmethod compute-discriminating-function ((gf scheduled-gf))
  (let ((regular (call-next-method)))
    #'(lambda (&rest args)
        (schedule-event (car args)
                        #'(lambda () (apply regular args))))))

Then there is a question of what kind of scheduling policy you want and
the like.

All of which is just to say that if this is what you want, you might
want to take a look at ABCL, and/or ABCL/R.  I believe there are
publicly available implementations, that run in Common Lisp.  An email
address that might be useful for getting more info about it is:
·····@is.s.u-tokyo.ac.jp.