|
From: Miles P. <mil...@gm...> - 2009-07-07 21:05:41
|
John, One quick idea is to copy your score file, and use a different one for each model you load. I'm not sure if you are referring to using the Groovy pieces or hand-coding your Java implementations and I don't know if that would work for the generated Groovy classes? I have to put in my customary plug ;) and note that you can use a metaabm (works just like score) to define your model and then have the default scenario files and implementing model.score files generated automatically -- you can also create bare interfaces and base implementations from that that you could use for any of your implementations. See http://metaabm.org/docs/customizing_java.html. You can load your existing Java classes into metaabm so it shouldn't require too much additional effort. It isn't a perfect answer to your connundrum as it isn't entirely automatic, but it should help. The only annoying part of that is that I think you will have to manually change your implementing classes so that they will implement the appropriate interfaces. I think it would be a really good idea to allow an SAgent to implement and/or inherit from any arbitrary class and I'll try to put that into Acore as early as possible. (Ecore no does that that for ItemProviders and its a really useful feature.) Miles On Jul 7, 2009, at 10:00 AM, John Tranier wrote: > Hi, > > In order to improve the flexibility of my models, I like to make use > of interfaces to abstract from different possible implementations. > Thus, I define agents & contexts with interfaces + implementing > classes. > > The problem is that this approach doesn't fit very well with Repast > Symphony since the model score and the scenario entries require to > specify the concrete classes used. > If I want to change the implementation of a context or an agent, I've > almost nothing to do in my code, but then I've to update all the > repast files that was referencing the previous implementation ... > Moreover I've noticed that the scheduling annotation are processed > only if they are defined in a class which is used in model.score file. > If there is a schedule annotation in a super class, this one is not > taken into account. > > It would be nice to be able to reference interfaces / super classes in > the score file and in the scenario files, and so to be able to load > easily different implementations at run-time. > Do you think this is feasible? > > To achieve this at the moment, I suppose I've to build the scenario > with java programming (but loosing the nice graphical interface ...). > Is there any documentation or code examples you can recommend me to > have a look at how to build a scenario in java ? > > Thanks, > John > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/blackberry > _______________________________________________ > Repast-interest mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-interest |