Gecode 6.4.0
Gecode::Optimize::SolveBudget Class Reference

#include < -- improving gecode/implementation/gecode/gecode/optimize/result.hpp>

Public Member Functions

 SolveBudget (const SolveOptions &options)
double elapsed_seconds () const noexcept
double remaining_seconds () const noexcept
bool cancelled () const noexcept
bool time_limit_reached () const noexcept
bool node_limit_reached () const noexcept
bool expired () const noexcept
std::optional< Terminationstop_reason () const noexcept
void add_nodes (std::uint64_t count=1) noexcept
std::uint64_t nodes () const noexcept
std::shared_ptr< CancellationTokencancellation () const noexcept

Detailed Description

Copies share a monotonic clock, cancellation token and cumulative node count. All stages of one solve should use this same budget rather than restarting the deadline. Callers explicitly add newly consumed nodes (not a cumulative backend total on every poll). Concurrent node additions saturate at UINT64_MAX.

Constructor & Destructor Documentation

◆ SolveBudget()

Gecode::Optimize::SolveBudget::SolveBudget ( const SolveOptions & options)
explicit

Member Function Documentation

◆ elapsed_seconds()

double Gecode::Optimize::SolveBudget::elapsed_seconds ( ) const
noexcept

◆ remaining_seconds()

double Gecode::Optimize::SolveBudget::remaining_seconds ( ) const
noexcept

◆ cancelled()

bool Gecode::Optimize::SolveBudget::cancelled ( ) const
noexcept

◆ time_limit_reached()

bool Gecode::Optimize::SolveBudget::time_limit_reached ( ) const
noexcept

◆ node_limit_reached()

bool Gecode::Optimize::SolveBudget::node_limit_reached ( ) const
noexcept

◆ expired()

bool Gecode::Optimize::SolveBudget::expired ( ) const
noexcept

◆ stop_reason()

std::optional< Termination > Gecode::Optimize::SolveBudget::stop_reason ( ) const
noexcept

Cancellation takes precedence over time, then node limits.

◆ add_nodes()

void Gecode::Optimize::SolveBudget::add_nodes ( std::uint64_t count = 1)
noexcept

◆ nodes()

std::uint64_t Gecode::Optimize::SolveBudget::nodes ( ) const
noexcept

◆ cancellation()

std::shared_ptr< CancellationToken > Gecode::Optimize::SolveBudget::cancellation ( ) const
noexcept

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