The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Chess::Plisco::Engine::TimeControl - Time Management

SYNOPSIS

    my $tc = Chess::Plisco::Engine::TimeControl->new(
        searchmoves => ['e2e4', 'd2d4', 'f2f4'],
        ponder => 0,
        movestogo => 40,
        mwime => 5 * 60 * 1000,
        btime => 5 * 60 * 1000,
        winc => 1000,
        binc => 1000,
        depth => 5.
        nodes => 1_000_000,
        mate => 5,
        movetime => 1000,
        infinite => 0,
    );

DESCRIPTION

A Chess::Plisco::Engine::TimeControl processes the parameters for a search and sets the relevant properties of the Chess::Plisco::Engine::Tree.

CONSTRUCTOR

The constructor receives the values parsed as options for the "go" command per the UCI specification.

position

The current position as a Chess::Plisco::Engine::Position object.

start_time

Start time of the current search as an array of seconds and microseconds since the epoch (as returned by "gettimeofday" in Time::HiRes).

allocated_time

The maximum time in ms to think about a move.

nodes_to_tc

When that many nodes have been searched, the time left should be checked again. A negative value means to search infinitely.

move_now

If true, the engine's time is used up and it should move as soon as possible.

COPYRIGHT

Copyright (C) 2021 Guido Flohr <guido.flohr@cantanea.com>, all rights reserved.

SEE ALSO

Chess::Plisco::Engine::Position, perl(1)