|
From: North, M. <no...@an...> - 2007-02-12 20:39:06
|
Les: This is a good question. Users can schedule events with real numbered values. This is useful for modeling processes with known or approximately known physical timing (e.g., modeling the arrival of packets in a network). Mike > -----Original Message----- > From: rep...@li... [mailto:repast- > dev...@li...] On Behalf Of Les Gasser > Sent: Monday, February 12, 2007 1:46 PM > To: rep...@li... > Cc: ga...@ui... > Subject: [Repast-developer] getTickCount/getCurrentTime - why typed > asdoubles? >=20 >=20 > I'm implementing some extensions to Repast. > Regarding uchicago.src.sim.engine: >=20 > The TickCounter interface specifies the method "getTickCount" which > returns a double. The SimModel class specifies the method > "getCurrentTime" which also returns a double. >=20 > Question: >=20 > 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? >=20 > (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.) >=20 > Suggestion: >=20 > 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. >=20 > Thanks, >=20 > - Les >=20 > (not a list subscriber, so please respond directly as well as to the > list - thanks.) >=20 >=20 >=20 > ------------------------------------------------------------------------ - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 121642 > _______________________________________________ > Repast-developer mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-developer |