Gecode::Search::TimeStop Class Reference
Functionality by programming task » Programming models » Search engines » Stop-objects for stopping search

Stop-object based on time More...

`#include <search.hh>`

## Public Member Functions

| TimeStop (unsigned long int l)
| Stop if search exceeds l milliseconds (from creation of this object).
unsigned long int | limit (void) const
| Return current limit in milliseconds.
void | limit (unsigned long int 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 Attributes

Support::Timer | t
| Time when execution should stop.
unsigned long int | l
| Current limit in milliseconds.

## Additional Inherited Members

static Stop * | node (unsigned long int l)
| Stop if node limit l has been exceeded.
static Stop * | fail (unsigned long int l)
| Stop if failure limit l has been exceeded.
static Stop * | time (unsigned long int l)
| Stop if time limit l (in milliseconds) 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 871 of file search.hh.

## Constructor & Destructor Documentation

## TimeStop()

Gecode::Search::TimeStop::TimeStop | ( | unsigned long int | l | ) |

inline

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

Definition at line 90 of file stop.hpp.

## Member Function Documentation

## limit() [1/2]

unsigned long int Gecode::Search::TimeStop::limit | ( | void |  | ) | const

inline

Return current limit in milliseconds.

Definition at line 96 of file stop.hpp.

## limit() [2/2]

void Gecode::Search::TimeStop::limit | ( | unsigned long int | l | ) |

inline

Set current limit to l milliseconds.

Definition at line 101 of file stop.hpp.

## reset()

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

inline

Reset time to zero.

Definition at line 106 of file stop.hpp.

## stop()

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

virtual

Return true if time limit is exceeded.

Implements Gecode::Search::Stop.

Definition at line 81 of file stop.cpp.

## Member Data Documentation

## t

Support::Timer Gecode::Search::TimeStop::t

protected

Time when execution should stop.

Definition at line 874 of file search.hh.

## l

unsigned long int Gecode::Search::TimeStop::l

protected

Current limit in milliseconds.

Definition at line 876 of file search.hh.

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

- gecode/search.hh
- gecode/search/stop.cpp
- gecode/search/stop.hpp