|
From: Les G. <ga...@ui...> - 2007-02-12 19:45:41
|
I'm implementing some extensions to Repast. Regarding uchicago.src.sim.engine: The TickCounter interface specifies the method "getTickCount" which returns a double. The SimModel class specifies the method "getCurrentTime" which also returns a double. Question: Both these methods refer to simulation ticks or times. Why are their return types specified as "double", which is a floating point type, and not int or long? When would a RePast-computed tick or time count ever be fractional, i.e., anything but an integer? (If I've got this right, the method of updating sim ticks is through reading "nextTime" fields in BasicAction.java; BasicActions are placed in a priority queue called ActionQueue (nb: Java 1.5 now has java.util.PriorityQueue). Sim time is advanced to the minimum time (next) entry in this queue - so it can leap forward by more than one tick depending on the times for which the BasicActions were (re)inserted in the ActionQueue. Nonetheless, all the time specifiers I could find in the RePast code are integer values, typically 0 or 1, and it's hard to envision when a float would be needed for a simtick.) Suggestion: While the inheritance and implementation graphs for these interfaces are clearly different, both methods seem to be intending to return the current simulation tick or time. Why the difference in names then? It seems like it might be a good idea to unify the concept of getting access to the current simulation time/tick, unless there really is some underlying conceptual difference that I'm not seeing. Thanks, - Les (not a list subscriber, so please respond directly as well as to the list - thanks.) |