private HashMap < DensityGrid , CharacteristicVector > adjustForSparseGrid ( DensityGrid dg , CharacteristicVector cv , int dgClass ) { HashMap < DensityGrid , CharacteristicVector > glNew = new HashMap < DensityGrid , CharacteristicVector > ( ) ; //System.out.print("Density grid "+dg.toString()+" is adjusted as a sparse grid at time "+this.getCurrTime()+". "); if ( dgClass != NO_CLASS ) { //System.out.println("It is removed from cluster "+dgClass+"."); GridCluster gc = this . cluster_list . get ( dgClass ) ; gc . removeGrid ( dg ) ; cv . setLabel ( NO_CLASS ) ; glNew . put ( dg , cv ) ; this . cluster_list . set ( dgClass , gc ) ; if ( gc . getWeight ( ) > 0.0 && ! gc . isConnected ( ) ) glNew . putAll ( recluster ( gc ) ) ; } //else //System.out.println("It was not clustered ("+dgClass+")."); return glNew ; }
Adjusts the clustering of a sparse density grid . Implements lines 5 and 6 from Figure 4 of Chen and Tu 2007 .