def _inhibitColumnsLocal(self, overlaps, density):
activeArray = numpy.zeros(self._numColumns, dtype="<STR_LIT:bool>")<EOL>for column, overlap in enumerate(overlaps):<EOL><INDENT>if overlap >= self._stimulusThreshold:<EOL><INDENT>neighborhood = self._getColumnNeighborhood(column)<EOL>neighborhoodOverlaps = overlaps[neighborhood]<EOL>numBigger = numpy.count_nonzero(neighborhoodOverlaps > overlap)<EOL>ties = numpy.where(neighborhoodOverlaps == overlap)<EOL>tiedNeighbors = neighborhood[ties]<EOL>numTiesLost = numpy.count_nonzero(activeArray[tiedNeighbors])<EOL>numActive = int(<NUM_LIT:0.5> + density * len(neighborhood))<EOL>if numBigger + numTiesLost < numActive:<EOL><INDENT>activeArray[column] = True<EOL><DEDENT><DEDENT><DEDENT>return activeArray.nonzero()[<NUM_LIT:0>]<EOL>
Performs local inhibition. Local inhibition is performed on a column by
column basis. Each column observes the overlaps of its neighbors and is
selected if its overlap score is within the top 'numActive' in its local
neighborhood. At most half of the columns in a local neighborhood are
allowed to be active. Columns with an overlap score below the
'stimulusThreshold' are always inhibited.

:param overlaps: an array containing the overlap score for each  column.
                The overlap score for a column is defined as the number
                of synapses in a "connected state" (connected synapses)
                that are connected to input bits which are turned on.
:param density: The fraction of columns to survive inhibition. This
                value is only an intended target. Since the surviving
                columns are picked in a local fashion, the exact fraction
                of surviving columns is likely to vary.
@return list with indices of the winning columns