public void updateGridDensity ( int currTime , double decayFactor , double dl , double dm ) { // record the last attribute int lastAtt = this . getAttribute ( ) ; // Update the density grid's density double densityOfG = ( Math . pow ( decayFactor , ( currTime - this . getDensityTimeStamp ( ) ) ) * this . getGridDensity ( ) ) ; this . setGridDensity ( densityOfG , currTime ) ; // Evaluate whether or not the density grid is now SPARSE, DENSE or TRANSITIONAL if ( this . isSparse ( dl ) ) this . attribute = SPARSE ; else if ( this . isDense ( dm ) ) this . attribute = DENSE ; else this . attribute = TRANSITIONAL ; // Evaluate whether or not the density grid attribute has changed and set the attChange flag accordingly if ( this . getAttribute ( ) == lastAtt ) this . attChange = false ; else this . attChange = true ; }
Implements the update the density of all grids step given at line 2 of both Fig 3 and Fig 4 of Chen and Tu 2007 .