From: Nick C. <nic...@ve...> - 2002-10-29 20:46:49
|
Hi, On Tue, 2002-10-29 at 14:11, Thomas R. Howe wrote: > I'll try to answer as many of these as I can. > > On Tue, 2002-10-29 at 12:12, Ricardo Sosa wrote: > > Hi, since the tutorials at agents2002 we've been working with repast and > > have implemented a rather basic model to start with. Thanks to Nick, Tom, > > Michael and Laszlo for their patience during the tutorials. Now we have a > > list of questions and would appreciate your help. I understand that these > > are rather basic and apologise in advance for sending such elementary > > questions. > > > > 1. I'm using JBuilder and when I run my models from it they are *really* > > slow, especially with the display on. What sort of gain can be expected if > > the model is run from the command line? Still, it's useful for testing > > purposes to run from JBuilder while I write the code, so would anyone > > suggest a way of speeding it up? > > My first suggestion would be to make sure you are using java 1.4. It is > much faster. I'm not too familiar with JBuilder, but I don't think the > speed impact should be too huge. Maybe some of the JBuilder folks, can > talk about this. I agree with Tom here. However, JBuilder requires lots and lots of memory and resources. If its pushing your machine to the limit, then you'll have lots of thrashing while you try to run your repast application and it at the same time. > > > 2. Display constants = how can I override the WIDTH and HEIGHT values? and > > what does DEPTH do? Actually I'd like to make these constants variables and > > proportional to the number of agents selected, so that a regular window > > size is displayed. > > These can be set using regular setter methods. In your model class, > call: > > this.getController().setCellHeight(int cellSize); > > The same follows for the other parameters. This should probably be done > from either your constructor or your setup method. You can also do DisplayConstants.CELL_WIDTH = ... At the moment DEPTH does nothing. We should probably hide it. > > > > 3. How can I control the display of grid lines in the 2D Hexagonal Torus? > > This space displays a yellow box around the agents and I'd like to turn it > > off or be able to change the colour and line size. Also, how to change the > > background colour of a space? > > In the hexagonal display, there is a method called setFramed(boolean). > This allows you to turn the frame on/off. there is also a method called > setFrameColor(Color) This allows you to change the color. > > > > > 4. QuickTime movies: they are huge, presumably because they are made > > without any compression to avoid data loss but when I zip them or use a > > movie codec, the file size is 10 or 20 times smaller. Is there a way to > > implement this straight into repast so that one can choose a codec in the > > QuickTime movie dialog? > > There is java support for zip files (as a matter of fact, jar files are > zip files). It should be relatively easy to include this into your > model. As for codecs, none have been implemented for repast at this > point. I just reworked some of the movie capture code. Java is still fairly thin when it comes to available formats. I couldn't get anything to work other than our current QT set up. I'll take another look at it though with compression in mind. > Take a look at the package java.util.zip. It should give you some ideas > of how to add the compression > > > > > 5. Lastly, I'm using the getProbedProperties method and everything is fine > > except for the int[] characteristics of my agents. Each agent has an Array > > of features and the subsequent getter/setter methods but when the agents > > are clicked and their properties window appears, all int and double values > > are displayed properly except for the int[] one which only says "class > > [I"... what am I doing wrong? > > You're not doing anything wrong. The problem is that repast doesn't > know how to display an int[]. It understands strings, numbers and > booleans, plus the built in property descriptors (drop down boxes for > vectors, and the such). For things that are not included, repast is > forced to display it as the class button you see. If you click on that > button, it should try to probe into this as well. However, this is not > ideal. Fortunately, there is a solution. > > You need to create your get method for the int[] field to produce > something that repast knows how to display. It could look something > like this, perhaps: > > int[] foo; > ... > String out = new String(); > for(int i = 0 ; i < foo.length ; i++){ > out += foo[i]); > } > return out; > > This will format your array as a string and then repast will know how to > display it. You can do the same thing with the setter method (only > opposite). This is not the only way to do it, but it will work. > > > > > Hope this helps. > > Tom > > > > > Your help on these points will be very very appreciated, > > > > --Ricardo > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Repast-interest mailing list > > Rep...@li... > > https://lists.sourceforge.net/lists/listinfo/repast-interest > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Repast-interest mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-interest -- Nick Collier Social Science Research Computing University of Chicago http://repast.sourceforge.net |