Occupancy


 * Home * Chess * Squares * Occupancy**
 * [[image:ZappaBesetzt20160916.JPG]] ||~ || The **Occupancy** refers to the boolean property of a square. It is occupied if any piece exclusively resides on that square, otherwise the square is empty. In bitboards, the occupancy or //occupied bitboard// refers the set of all squares occupied by any piece. Thus, it is the union of all piece bitboards, which is used for instance in calculating sliding piece attacks. Likely, while the piece bitboards are updated incrementally, the occupancy is updated incrementally as well, rather than calculated from up to 12 piece bitboards each time.

Alternatively, if needed more often, the complement set of the occupancy, the set of **all empty squares** is exclusively kept inside the board-definition and a cheap not-instruction is done to calculate the occupancy on the fly. Other programs keep disjoint white and black pieces, to "or" them if the occupancy is actually needed. The appearance of multiple, redundant occupied bitboards, which are flipped, mirrored or rotated are eponym of bitboard methods related to sliding piece attack generation, most notably rotated and reverse bitboards. || toc =See also= > Obstruction Difference > Occupancy of any Line > Reverse Bitboards > Rotated Bitboards
 * Occupied ||~ ||^ ||
 * Sliding Piece Attacks

=Forum Posts=
 * [|Occupancy Variations] by CDaley11, OpenChess Forum, January 25, 2013 » Magic Bitboards

=External Links=
 * [|Occupancy from Wikipedia]
 * [|occupancy - Wiktionary]

=References= =What links here?= include page="Occupancy" component="backlinks" limit="80"
 * Up one Level**