Next: , Up: Machine learning with tarot   [Contents][Index]


5.1 The features

All features are actually redundant with a clever use of the TarotGame and TarotCounter. However, this interface will highlight useful high-level features. These are the list of implemented high-level features that you may want to use:

Function: void tarot_features_variant (const TarotGame *game, size_t *nplayers, int *withcall)

Query the game variant used in game: the number of players, nplayers, and whether there is a call, withcall.

Function: void tarot_features_position (const TarotGame *game, size_t *trick, size_t *position)

Get our position in the game, i.e. the number of players that have already “played” in the given step. During the tricks phase, this is the number of players that have played before us in the current trick. trick is set to the number of tricks played so far.

Function: void tarot_features_partner_known (const TarotGame *game, int *known)

Check whether the taker’s partner is known in game. If there is no call, then the partner is considered known.

We also have some function to give interesting statistics about your game. The statistics are counted with the dog, if you’re the taker and are set to discard.

Function: void tarot_features_count_faces (const TarotGame *game, size_t *nkings, size_t *nmarriages, size_t *nextendedmarriages, size_t *nqueens, size_t *nkings)

Query some statistics about the face cards in game: the number of kings nkings, the number of queens, nqueens, the number of knights nknights, and the combination of these: the number of marriages nmarriages, i.e. the number of suits where we own the king and the queen, and the number of extended marriages nextendedmarriages, i.e. the number of suits for which we own the king, the queen and the knight.

Function: void tarot_features_count_minor (const TarotGame *game, size_t *nshortest, size_t *nsecondshortest, size_t *nsecondlongest, size_t *nlongest)

Query some statistics about the suits that you own in game. The longest suit is the suit for which you have most cards. The shortest is the suit for which you have least.

This notion is important, since calling a suit will be translated as a strategy of calling the shortest, the second shortest and so on.

Function: void tarot_features_count_oudlers (const TarotGame *game, int *haspetit, int *hasexcuse, int *hastwentyone)

Query whether you have the petit, excuse or twentyone in game.

Function: void tarot_features_count_trumps (const TarotGame *game, size_t *ntrumps, TarotNumber *max, TarotNumber *min, TarotNumber *q1, TarotNumber *q3, TarotNumber *median)

Count your trumps in game. Count the actual number as ntrumps, but also compute the max-imum and min-imum, and also the first and third quartiles, q1 and q3, and the median.

As you know, the first and third quartiles and the median may have multiple valid values. Here we choose the smallest.


Next: , Up: Machine learning with tarot   [Contents][Index]