Generated on for Gecode by doxygen 1.17.0

Stop-object based on time More...

#include <gecode/search.hh>

Public Member Functions

 TimeStop (double l)
 Stop if search exceeds l milliseconds (from creation of this object).
 TimeStop (const TimeStop &s)
 Copy constructor.
TimeStopoperator= (const TimeStop &s)
 Assignment operator.
double limit (void) const
 Return current limit in milliseconds.
void limit (double l)
 Set current limit to l milliseconds.
void reset (void)
 Reset time to zero.
virtual bool stop (const Statistics &s, const Options &o)
 Return true if time limit is exceeded.
 Stop (void)
 Default constructor.
virtual ~Stop (void)
 Destructor.

Protected Types

using clock = std::chrono::steady_clock
using clock_rep = clock::time_point::rep

Protected Attributes

std::atomic< clock_rept0
 Clock representation at the start of timing.
std::atomic< double > l
 Current limit in milliseconds.

Additional Inherited Members

static Stopnode (unsigned long long int l)
 Stop if node limit l has been exceeded.
static Stopfail (unsigned long long int l)
 Stop if failure limit l has been exceeded.
static Stoptime (double l)
 Stop if time limit l (in milliseconds) has been exceeded.
static Stoprestart (unsigned long long int l)
 Stop if restart limit l has been exceeded.
Static Public Member Functions inherited from Gecode::HeapAllocated
static void * operator new (size_t s)
 Memory management.
static void operator delete (void *p)
 Free memory allocated from heap.

Detailed Description

Stop-object based on time

Definition at line 886 of file search.hh.

Member Typedef Documentation

◆ clock

using Gecode::Search::TimeStop::clock = std::chrono::steady_clock
protected

Definition at line 888 of file search.hh.

◆ clock_rep

using Gecode::Search::TimeStop::clock_rep = clock::time_point::rep
protected

Definition at line 889 of file search.hh.

Constructor & Destructor Documentation

◆ TimeStop() [1/2]

Gecode::Search::TimeStop::TimeStop ( double l)
inline

Stop if search exceeds l milliseconds (from creation of this object).

Definition at line 110 of file stop.hpp.

◆ TimeStop() [2/2]

Gecode::Search::TimeStop::TimeStop ( const TimeStop & s)
inline

Copy constructor.

Definition at line 113 of file stop.hpp.

Member Function Documentation

◆ operator=()

TimeStop & Gecode::Search::TimeStop::operator= ( const TimeStop & s)
inline

Assignment operator.

Definition at line 118 of file stop.hpp.

◆ limit() [1/2]

double Gecode::Search::TimeStop::limit ( void ) const
inline

Return current limit in milliseconds.

Definition at line 128 of file stop.hpp.

◆ limit() [2/2]

void Gecode::Search::TimeStop::limit ( double l)
inline

Set current limit to l milliseconds.

Definition at line 133 of file stop.hpp.

◆ reset()

void Gecode::Search::TimeStop::reset ( void )
inline

Reset time to zero.

Definition at line 138 of file stop.hpp.

◆ stop()

virtual bool Gecode::Search::TimeStop::stop ( const Statistics & s,
const Options & o )
virtual

Return true if time limit is exceeded.

Implements Gecode::Search::Stop.

Member Data Documentation

◆ t0

std::atomic<clock_rep> Gecode::Search::TimeStop::t0
protected

Clock representation at the start of timing.

Definition at line 891 of file search.hh.

◆ l

std::atomic<double> Gecode::Search::TimeStop::l
protected

Current limit in milliseconds.

Definition at line 893 of file search.hh.


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