This model converts cleaned up versions of .pgn files (records of real chess games) and conversts them into files that record all of the events and “possible” events within a game of chess. This is intended to be a way to create sets of data that capture event sequences within the relatively complex but finite context of chess games as a proxy or “toy” data set. Although not a perfect correlation, these toy data sets are a first step in analysing complex and dynamic systems of events and possible events that happen in the real world.
Chess games are complex but finite; pieces, squares and possible moves are limited but predicting moves or outcomes is difficult because of the complex interactions. Chess games may be a useful proxy or “toy” data set for complex systems.
Function- Appropriately formatted input strings (example = “Pd4 Nf6 Nd2 Pe5 Pde5 Ng4 Ph3 Ne3 black_wins”) are turned into exported files of all (possible) events as the ABM * determine which colour goes next, * copies the next move in the game to a variable called “ply-piece”, * asks the pieces of the colour to go next to report back on what moves they are legally allowed to make as well as whether they could capture a piece , are protecting a piece, etc. * exports the possible moves to another file, * compares the the possible moves to the ply-piece and ask the appropriate piece to make that move.
This process repeats, alternating between white and black, until there are no moves left in the string and the game ends. Importantly, instances of (potential) castling are reported by both kings and rooks as (potential) events for both pieces rather than as a single event as is typically written in .pgn notation. The model also reports the end of the game and the result of the game (white_wins, black_wins or draw) as events and these are appended to the output file (if the model is set to create an output file).
Consider The output is a long list of events including the pieces involved (that move, that are threatened, etc.) what (could have) happened and where/when it happened.
Events includes all possible events within the finite limits and rules of the game, including moves not taken such as: * Valid, but irrelevant moves (e.g. pawns that never move still report possible moves). * Implicit threats (e.g. bishop that takes a position that is not a direct threat but could quickly become one). * Nonsense moves that advanced players would never consider, but which are still legally possible.