|
From: Laszlo G. <gu...@la...> - 2002-11-07 21:16:48
|
Hi, Thanks Nick, this sounds awesome! Please find my comments below. Gulya At 09:11 AM 11/7/2002 -0500, Nick Collier wrote: >Hi, > >I've added support of the dynamic compilation of sequences and histogram >items for the various kinds of charts in repast. I've also fiddled with >the internals a bit so they should be a bit faster and look a bit >better. > >All this should make it fairly easy to create a chart building GUI so >the user can add charts on the fly. Data is received by a chart via some >class that implements Sequence. This is essentially a single method >class whose method returns a double. Thus, for chart building I'm >thinking of introspecting the model and returning all the methods that >return a number. These can be wrapped in a dynamically compiled >sequence. Something similar could be done for histograms. > >However, this approach sort of bothers me in that it assumes the methods >of interest are already defined. Maybe we also need to iterate over all >the agents calling some method on each one and then plot the average, >for example. I don't want to do too much here as Tom and I are keen to >get 2.0 out the door as its been a bit delayed as he and I have been >writing models. So, any comments? Disclaimer: I have very limited experience with introspection, so I apologize if what I say is nonsense. [Although, in the last 30 mins I've made some experiments, so it seems this may be doable.] That said, what I originally had in mind was something like this: a) A menu with all the classes in the model's (?) package, you could pick a class from it. (By default, it would be the model.) Then, a menu of all the methods returning a value, PLUS all the data members having a double/float/int/long/etc. type would show up. You'd pick the data source from it. b) Alternatively, in the second step, the menu could show all the collections (or perhaps, all arrays, too) available to extract data from them [and calculate min/max/avg/sum]. It's much trickier, though, as with collections, you don't know what kind of objects you are facing. So, perhaps, we should, indeed, scale back to the agents... On the other hand, we could force the user to pick a class/interface and throw away all objects in the generated code that don't adhere... (Although, I'm afraid this would get way too complicated for the users...) >Also, Gulya had a good suggestion about remembering the position and >sizes of windows and so forth. If this is to be done between runs, but >not between application instances then no problem. If we want to do it >between application instances, and I think we do, then we'll need to use >a file format to store this info. Java 1.4's new property mechanism >would be good for this, but 1.4 is not really available for the Mac yet. >So, I'm thinking a simple XML format. I'd go with java's properties >format, but I think we'd might grow out of that at some time. We could I haven't got much experience with java properties, so I don't know. In principle, XML sounds good to me. Take care! Gulya |