From: Irena L. <il...@st...> - 2009-04-21 17:01:50
|
Thanks for all the advice so far. I did forget to mention in my first email that I went through the process to add the display, and added all of the projections that were in my context class, but ended up with the same problem. There isn't any display frame at all, I initialize and run the process but that dockable frame doesn't show up, there is nothing at all on the right-hand side though it says that the context has been loaded (I do also have the data loader set to load from my custom-created context class) I would like to try to do just a bare-bones projection with a few agents, but I'm not sure exactly what is needed. Does it matter what the projection is (i.e. GIS projection, grid, scalar field)? Again, thanks for the advice, Irena Nick Collier wrote: >When you say that nothing appears? Do you mean that no agents appear >in the displays or that the display frame itself doesn't appear? If >the frame is appearing you should see a new dockable frame on the >right side with some toolbar buttons on top of it. > >One thing to try here though is to just add a single projection with a >few agents -- that is, simplify your context down to the bare minimum >and see if you can get that to display. Also check the console when >you run the model, perhaps there are errors showing up there? > >Nick > >On Apr 18, 2009, at 11:17 PM, Irena Lanc wrote: > >> Hi all, >> I am having a bit of trouble finding a good reference for working with >> Repast Simphony, and I’m starting at a very basic level, so hopefully >> someone in this group can be of help to a beginner like me. I am >> currently trying to build a model of forest growth using Simphony. I’d >> already built one in NetLogo, and am having issues trying to port it >> to >> Repast. The main problem I am having is getting the context and the >> agents to show up in Simphony. I’ve built my own custom context, and >> added the necessary factory methods to create my different projections >> (or, at least I THINK I have...). But when I run the program, nothing >> shows up on the screen in Simphony. The scenario tree and parameters >> are all there, but nothing on the right-hand side. It’s very >> frustrating, as I’ve combed through the demos trying to figure out how >> they have the projection and agents showing up, and can’t see what I’m >> missing. I have all the corresponding agents, projections, and >> contexts >> added in the .score file. I’m including my context code, its hard to >> describe if anything is missing and I’m afraid I have a pretty >> untrained eye. >> >> public class ForestContext extends DefaultContext<Tree> implements >> ContextBuilder<Tree> { >> public ForestContext(){ >> super("ForestContext"); >> } >> >> public Context<Tree> build(Context<Tree> context) { >> int xdim = 50; // The x dimension of the physical space >> int ydim = 50; // The y dimension of the physical space >> >> GeographyParameters<Tree> geoParams = >> new GeographyParameters<Tree>(); >> >> // Create Geograpy context >> Geography<Tree> forestGeography = >> GeographyFactoryFinder >> .createGeographyFactory(null).createGeography("for >> estGeography", this, geoParams); >> >> >> GeographyParameters<Tree> treeParams = new >> GeographyParameters<Tree>(); >> >> for ( int i=0; i<10; i++) { >> Tree t = new Tree(); >> >> context.add(t); >> } >> >> GridFactoryFinder.createGridFactory(null).createGrid("Simple Grid", >> context, >> new GridBuilderParameters<Tree>(new >> repast.simphony.space.grid.WrapAroundBorders(), >> new RandomGridAdder<Tree>(), true, xdim, ydim)); >> >> ContinuousSpaceFactoryFinder.createContinuousSpaceFactory(null) >> .createContinuousSpace("Continuous Space", context, new >> RandomCartesianAdder<Tree>(), >> new repast.simphony.space.continuous.WrapAroundBorders(), xdim, >> ydim, 1); >> >> GridValueLayer vl = new GridValueLayer("Field", true, >> new repast.simphony.space.grid.WrapAroundBorders(),xdim,ydim); >> >> this.addValueLayer(vl); >> >> { >> Parameters p = RunEnvironment.getInstance().getParameters(); >> int numTrees = (Integer)p.getValue("numberofTrees"); >> >> for (int i = 0; i < numTrees; i++){ >> Tree t = new Tree(); >> this.add(t); >> } >> } >> return context; >> } >> } >> >> Any help would be really appreciated! >> >> Irena >> >> >> >> ------------------------------------------------------------------------ ------ >> Stay on top of everything new and different, both inside and >> around Java (TM) technology - register by April 22, and save >> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. >> 300 plus technical and hands-on sessions. Register today. >> Use priority code J9JMT32. http://p.sf.net/sfu/p >> _______________________________________________ >> Repast-interest mailing list >> Rep...@li... >> https://lists.sourceforge.net/lists/listinfo/repast-interest > > |