() function optimal ASR (, , IDnow()) |
() if ( >= ) // indicates the number of the user’s grid-area. |
() = the area of IDnow(); //IDnow() is the user’s grid-area; is cloaked set of grid-areas. |
() else |
() int = 1; //the distance from the grid-area of IDnow(). |
() while all the useful areas have not yet been searched . |
() d++; // Extends the distance to search, for the first time, , so there are 24 grid-areas can be chosen. |
() if (total number of the users in all the grid-areas nearby whose distance from IDnow() <= is less |
() than ) continue; |
() = the grid-area of IDnow(); |
() Adds the grid-area which has the highest QoS into until the total users in is not less than ; |
() // the QoS of the grid-area can be calculated by Formula (3). |
() break; |
() //end while |
() //end else |
() if ( is null) = the grid-area of IDnow(); |
() // Not enough users, so reduce the degree of anonymity. |
() if (the total square measure of < ) |
() adds the grid-area which has the highest QoS into until the total square measure of |
() is not less than ; // the QoS of the grid-area can be calculated by Formula (2). |
() if (there are grid-areas which are adjacent in ) |
() Combines the adjacent grid-areas to one single area; |
() replaces the ID() to for grid-areas in to get the ASR; |
() return ASR; |