Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce sub-(sub-)rounds to tournament round counting and PGN #702

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alwey
Copy link
Contributor

@alwey alwey commented Jan 9, 2022

There have been requests for a more fine-grained identification of tournament games.
This PR introduces sub-round and sub-sub-round counters to the Tournament class.
It extends the simple numerical PGN "Round" tag value like [Round "1"] to structured values, e.g. [Round "1.2.1"]. Resolves #249.

Example from PGN Specification, Section 8.1.1.4:

[Round "1"]
[Round "3.1"]
[Round "4.1.2"]

To accomplish a more fine-grained control of openings two new policy options are introduced to OpeningPolicy:

  1. SubRoundPolicy which shifts openings for a new sub-round.
  2. KeepPolicy which always keeps the same opening.

There a policies to shift or not shift openings for the levels of a tournament (game, encounter, sub-round, round, tournament).

 -openings file=file format=[epd | pgn] order=[random | sequential]
             plies=plies start=start policy=[default | encounter | subround |
             round | keep]
             ...
             The value of policy rules when to shift to a new opening.  If set
             to "encounter" a new opening is used for any new pair of players,
             "subround" shifts when a new sub-round begins, "round" shifts when a
             new round begins, and with "keep" the opening stays unchanged. The
             "default" shifts for any new pair of players and also when the
             specified number of opening repetitions is reached.
  • The subround counting is used for round-robin tournaments. This fixes the round repetition policy mismatch where the PGN round does not correspond to a round specified by the -rounds option. Now the PGN round tag is constant for a whole cycle of sub-rounds. Those sub-rounds are numbered by the second counter. A sub-round consist of several encounters, depending on the number of players. In this PR the games within a sub-round are numbered by the sub-sub-round counter. Resolves openings policy works for gauntlet but not for round-robin (default) #641.
  • For pyramid tournaments the function of the round counter is now distributed between round and sub-round counter.
  • In gauntlet tournaments the sub-round counter tracks the gauntlet (seeded) players, the sub-sub-round counter individual games.
  • In knockout tournaments the sub-round is constant for a pair, the sub-sub-round counts the games of a pair.

The "round" field was changed from int to QString in PgnGame.

HTH

and PGN output.

Resolves cutechess#249

Use subround counting for round-robin tournaments. This fixes the round
repetition policy where the PGN round does not correspond to a round
specified by the -rounds option. Now the PGN round tag is constant for
the whole cycle of sub-rounds.

Resolves cutechess#641

To accomplish a more fine-grained control of openings two new policy
options are introduced to OpeningPolicy:

 1. SubRoundPolicy which shifts openings for a new sub-round.
 2. KeepPolicy which always keeps the same opening.

Thus there a policies to shift or not shift openings for the levels
of a tournament (game, encounter, sub-round, round, tournament).

For pyramid tournaments the function of the round counter is now
distributed between round and sub-round counter.

In knockout tournaments the sub-round is constant for a pair,
the sub-sub-round counts the games of a pair.

In gauntlet tournaments the sub-round counter tracks the gauntlet
(seeded) players, the sub-sub-round counter individual games.

The "round" field was changed from int to QString in PgnGame.
@chesserik
Copy link

Hi! This is Erik, CEO of Chess.com. We are currently hiring for two important roles on our engineering team: Chess Explanation Engineer, and Engineering Team Lead - Analysis & Core Chess. Would you potentially be interested in either of those? If so let me know and we can discuss!

Best,

Erik
erik@chess.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants