|
From: Nick C. <nic...@ve...> - 2002-01-08 15:10:34
|
Anybody have any ideas on how to hide the reference to the space? Tom and I have been over this several times, but I'm keen to see what others think? Nick On Tue, 2002-01-08 at 10:00, th...@sr... wrote: > Yes, MoveableAgent is only a marker interface in a manner of speaking. > That is, from the point of view of the user no code need be implemented. > Now, as I have it written, the interface does have declarations. > This could easily be changed. However, I did this in order to document the > operations that would be available to the agent. If they weren't in the > interface they would only be listed in the aspect and I fear that would be > really confusing. I guess that is my primary concern: That the user > understand what's available from MoveableAgent, but not have to worry about > the implementation. > > As for the (general) architecture (And I emphasize, general), the > interface Moveable agent contains methods called move and several overloaded > getNeighbor functions. All of these methods take a reference to the space > object as a parameter. This is kind of a pain because we don't really have a > root space element, so I've separated it into Discrete2D and everyting else. > Point being that the agent passes a reference to Object which then has to be > casted in the aspect. Oh well. In order to use this, the user needs declare > that the agent implements MoveableAgent. Then, through the magic of aop, these > methods are available for use. This is a very loose description. > > Unfortunately, I think that it will be impossible for the agent to have no > reference to it's space (Sorry Gulya :) ). > > -Tom > > > On Tue, Jan 08, 2002 at 08:53:39AM -0500, Nick Collier wrote: > > I'm a bit confused. Is MoveableAgent a marker interface? And if it > > isn't, why not? That is, what sort of client code requires agents to be > > MoveableAgents? I'm not asking this to be annoying, but rather to get a > > sense of the big picture. (I know we've talked about this, but it would > > be good to have something documented). Can you sketch the architecture > > (perhaps too grand a notion here for a prototyping experiment), and walk > > through the steps that a user has to do to get a MoveableAgent and what > > they can do with it once they've got it. > > > > thanks, > > > > Nick > > > > > > > > On Mon, 2002-01-07 at 17:37, Laszlo Gulyas wrote: > > > Hi, > > > > > > This is just off the top of my head, but I don't think having a > > > flag- or identity interface should confuse the user. (As a > > > matter of fact, they might get much more confused by > > > aspects in general, but as I said before, I'd take the challenge.) > > > > > > In fact, repast already has identity interfaces (e.g. Torus > > > in the space lib), but it might well be true that a user > > > has never had to use them up to this point. > > > > > > Just my two cents. > > > > > > Gulya > > > > > > PS: I began to think that I should submit all my dreams > > > to this list, given the response time by which, e.g. this > > > independent-of-space dream of mine seems to be getting > > > into shape... ;-) > > > > > > At 10:59 AM 1/7/02 -0600, Thomas Howe wrote: > > > >Hi, > > > >I am currently working on implement movement behaviour using aspect > > > >oriented programming, so that the agent doesn't have to make calls > > > >directly to the space. We have discussed this a little on this list, and > > > >I'm just checking the feasibility. > > > > > > > >Here's where I stand. I am using aspectj as my aop language I have an > > > >"introduction aspect" as aspectj calls it, that adds a move method to the > > > >class. Basically, an introduction aspect adds new code to an existing > > > >class. This way the user never has to see the code, and we don't have > > > >issues of multiple inheritence. That's all fine and dandy. Here's the > > > >question. In order to use this, the aspect has to be able to determine > > > >which classes should have the added behaviour. The best way that I can > > > >think of to implement this is with interfaces. For example, a class would > > > >declare that it implements MoveableAgent and then the aspect adds the code > > > >as appropriate. I wonder, though, if this may be a problem. From the > > > >point of view of a user, when you declare that you implement an interface, > > > >you always have to implement the methods yourself. Will it be too > > > >confusing to declare that you implement an interface without actually > > > >writing any code? > > > > > > > >This was not the clearest note I've written, but I hope my point is > > > >somewhat understandable. Please let me know if it is not. > > > > > > > >Thanks, > > > >Tom > > > > > > > >_______________________________________________ > > > >Repast-developer mailing list > > > >Rep...@li... > > > >https://lists.sourceforge.net/lists/listinfo/repast-developer > > > > > > -- > > > Laszlo Gulyas, MSc Phone: (617) > > > 384-9216 > > > Government Department Weatherhead Center for International Affairs > > > Harvard University 602C Coolidge Hall > > > 1737 Cambridge street Cambridge, MA-02138 > > > > > > > > > _______________________________________________ > > > Repast-developer mailing list > > > Rep...@li... > > > https://lists.sourceforge.net/lists/listinfo/repast-developer > > -- > > Nick Collier > > Social Science Research Computing > > University of Chicago > > http://repast.sourceforge.net > > > > > > > > _______________________________________________ > > Repast-developer mailing list > > Rep...@li... > > https://lists.sourceforge.net/lists/listinfo/repast-developer > > -- > Tom Howe > Software Developer > SRC > University of Chicago > 773-834-3382 -- Nick Collier Social Science Research Computing University of Chicago http://repast.sourceforge.net |