LibCapy - minimax

MiniMax class.

Macros:

Maximum number of actors in a MiniMaxWorld

Macro to define the MiniMaxWorld structure

Enumerations:

None.

Typedefs:

Predeclaration of the parent structure for MiniMax worlds

Predeclaration of the memory pool of MiniMaxWorld

Struct CapyMiniMax :

Struct CapyMiniMax's properties:

Exploration thread.

Mutex to control the exploration thread.

Flag to stop the exploration thread

Max depth exploration (default: 1)

Pruning threshold (default: 1.0)

Current state

Memory pool for the worlds

Counter for the number of iteration, incremented each time setCurrentWorld is called

Struct CapyMiniMax's methods:

Destructor

Start the exploration

Stop the exploration

Get the next best world

Output and side effect(s):

Return a clone of the next best world.

Set the new current world.

Input argument(s):

world: the new current world

Output and side effect(s):

Free the current history except for the world in argument and its subtree if it's in the current history, and set the world in argument as the new root of the history.

Functions:

Create a MiniMaxWorld and return it. Inputs: nbActor: the number of actors

Output and side effect(s):

Return the MiniMaxWorld.

Free a MiniMaxWorld Inputs: that: the world to free mempool: the memory pool this world is belonging to

Output and side effect(s):

Free the word in the memory pool.

Create a CapyMiniMax

Input argument(s):

sizeWorld: size in byte of the world structure

Output and side effect(s):

Return a CapyMiniMax

Allocate memory for a new CapyMiniMax and create it

Input argument(s):

sizeWorld: size in byte of the world structure

Output and side effect(s):

Return a CapyMiniMax

Exception(s):

May raise CapyExc_MallocFailed.

Free the memory used by a CapyMiniMax* and reset '*that' to NULL

Input argument(s):

that: a pointer to the CapyMiniMax to free

2024-03-20
in LibCapy,
19 views
Copyright 2021-2024 Baillehache Pascal