gii = number of like adjacencies (joins) between pixels of patch type (class) i based on the singlecount method. maxgii = maximum number of like adjacencies (joins) between pixels of patch type (class) i (see below) based on the singlecount method. Pi = proportion of landscape comprised of patch type (class) i. 

Description  AI equals the number of like adjacencies involving the corresponding class, divided by the maximum possible number of like adjacencies involving the corresponding class, which is achieved when the class is maximally clumped into a single, compact patch, multiplied the proportion of the landscape comprised of the corresponding class, summed over all classes and multiplied by 100 (to convert to a percentage). If Ai is the area of class i (in terms of number of cells) and n is the side of a largest integer square smaller than Ai, and m = Ai  n2, then the largest number of shared edges for class i, maxgii will take one of the three forms:
Note, because of the design of the metric, like adjacencies are tallied using the singlecount method, and all landscape boundary edge segments are ignored, even if a border is provided. Also, Pi is based on the total landscape area (A) excluding any background present. 
Units  Percent 
Range  0 ≦ AI ≦ 100 Given any Pi , AI equals 0 when the patch types are maximally disaggregated (i.e., when there are no like adjacencies); AI increases as the landscape is increasingly aggregated and equals 100 when the landscape consists of a single patch. AI is undefined and reported as "N/A" in the "basename".land file if each class consists of a single cell (and hence is undefined). 
Comments  Aggregation index is calculated from an adjacency matrix at the class level (see classlevel AI comments). At landscape level, the index is computed simply as an areaweighted mean class aggregation index, where each class is weighted by its proportional area in the landscape. The index is scaled to account for the maximum possible number of like adjacencies given any landscape composition. 