From GridLAB-D Wiki
Jump to: navigation, search

jcfuller 16:34, 16 March 2012 (UTC)

  1. I'm having some confusion about the clock implementation. To me, that doesn't really fall out from the requirements, but rather seems to be a kludge-y workaround to use the clock as a flag. Granted, we've used the clock as a flag in the past (quite often), but this just seems to be an extension of that same "wrong way" to do it. Additionally, it causes a lot of heartache without really addressing the issues we're trying to fix.
    • Actually the use of the clock in sync() to detect improperly initialized models is the kludge and this is a golden opportunity to fix it right. The clock should be set properly when the first sync occurs. A quick code search for t0=={TS_INIT,0} suggests the impact is on the following modules and classes: Tape/schedule, Climate/climate, Residential/{dishwasher,dryer,evcharger,range,refrigerator,house_e}, Market/controller, and Comm/mpi_controller. The original thought was to create an object flag to say that the initialization is done. But that is redundant with the clock then because the clock is set to TS_INIT, which is exactly the same semantics. The only needed new object flag is that the initialization is deferred. --Dchassin 17:54, 16 March 2012 (UTC)
    • Also add battery/storage, meters, regulators, capacitors, and a number of others that don't directly rely on this "flag" ( in other words, just about every object that has some complexity where relative time is needed ). This is not really my point. If we need to fix these, we can. But, all we are doing is kicking the can further down the road by now using the clock as a flag in init() instead of pre-sync. Let's do it right, and not use the clock as a flag at all and initialize it globally right off the bat. This would allow us to move things like schedules and players up on the priority list in init(), and allow us to pull in true initial values to start our simulations. --jcfuller 20:14, 16 March 2012 (UTC)
    • Added OF_INIT, PC_NODEFERRAL and PF_DEFER flags to allow modules to know object state and control which properties and classes can participate in deferral. Also added requirement that all clocks be set prior to initialization. --Dchassin 19:04, 20 March 2012 (UTC)