ColorShapeLinks AI
An AI competition for the IEEE Conference on Games 2021
IThinker Interface Reference

The actual AI code of specific thinkers should be placed in classes which implement this interface. More...

+ Inheritance diagram for IThinker:
+ Collaboration diagram for IThinker:

Public Member Functions

FutureMove Think (Board board, CancellationToken ct)
 Perform a move. More...
 

Events

Action< string > ThinkingInfo
 Event raised when thinkers produce information while thinking. More...
 

Detailed Description

The actual AI code of specific thinkers should be placed in classes which implement this interface.

Member Function Documentation

◆ Think()

FutureMove Think ( Board  board,
CancellationToken  ct 
)

Perform a move.

Parameters
boardThe game board.
ctA cancellation token.
Returns
The move to be performed.

The main thread may ask the thinker to stop thinking. As such, this method should frequently test if a cancellation request was made to the cancellation token (ct ). If so, it should return immediately with no move performed, as exemplified in the following code:

if (ct.IsCancellationRequested) return FutureMove.NoMove;

Implemented in HumanThinker, HumanThinker, SequentialAIThinker, RandomMemoryHoarderThinker, RandomAIThinker, MinimaxAIThinker, BadMoveAIThinker, and AbstractThinker.

Event Documentation

◆ ThinkingInfo

Action<string> ThinkingInfo

Event raised when thinkers produce information while thinking.

  • Listeners receive a string containing the thinking information.
  • It is not mandatory that thinkers produce any information while thinking.

The documentation for this interface was generated from the following file: