Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::utility::ProgressMeasurement Class Reference

A class that provides convenience operations to display run times. More...

#include <ProgressMeasurement.h>

Public Types

typedef decltype(std::chrono::duration_cast< std::chrono::seconds >(std::chrono::seconds::zero()).count()) SecondType
typedef decltype(std::chrono::duration_cast< std::chrono::milliseconds >(std::chrono::milliseconds::zero()).count()) MilisecondType
typedef decltype(std::chrono::duration_cast< std::chrono::nanoseconds >(std::chrono::nanoseconds::zero()).count()) NanosecondType

Public Member Functions

 ProgressMeasurement (std::string const &itemName="items")
 Initializes progress measurement.
void startNewMeasurement (uint64_t startCount)
 Starts a new measurement, dropping all progress information collected so far.
bool updateProgress (uint64_t count)
 Updates the progress to the current count and logs it (on the progress log channel) if the delay passed.
bool updateProgress (uint64_t count, std::ostream &outstream)
 Updates the progress to the current count.
bool isMaxCountSet () const
 Returns whether a maximal count (which is required to achieve 100% progress) has been specified.
uint64_t getMaxCount () const
 Returns the maximal possible count (if specified).
void setMaxCount (uint64_t maxCount)
 Sets the maximal possible count.
void unsetMaxCount ()
 Erases a previously specified maximal count.
uint64_t getShowProgressDelay () const
 Returns the currently specified minimal delay (in seconds) between two progress messages.
void setShowProgressDelay (uint64_t delay)
 Customizes the minimal delay between two progress messages.
std::string const & getItemName () const
 Returns the current name of what we are counting (e.g.
void setItemName (std::string const &name)
 Customizes the name of what we are counting (e.g.

Detailed Description

A class that provides convenience operations to display run times.

Definition at line 14 of file ProgressMeasurement.h.

Member Typedef Documentation

◆ MilisecondType

typedef decltype(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::milliseconds::zero()).count()) storm::utility::ProgressMeasurement::MilisecondType

Definition at line 17 of file ProgressMeasurement.h.

◆ NanosecondType

typedef decltype(std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::nanoseconds::zero()).count()) storm::utility::ProgressMeasurement::NanosecondType

Definition at line 18 of file ProgressMeasurement.h.

◆ SecondType

typedef decltype(std::chrono::duration_cast<std::chrono::seconds>(std::chrono::seconds::zero()).count()) storm::utility::ProgressMeasurement::SecondType

Definition at line 16 of file ProgressMeasurement.h.

Constructor & Destructor Documentation

◆ ProgressMeasurement()

storm::utility::ProgressMeasurement::ProgressMeasurement ( std::string const & itemName = "items")

Initializes progress measurement.

Parameters
itemNamethe name of what we are counting (iterations, states, ...).

Definition at line 13 of file ProgressMeasurement.cpp.

Member Function Documentation

◆ getItemName()

std::string const & storm::utility::ProgressMeasurement::getItemName ( ) const

Returns the current name of what we are counting (e.g.

iterations, states, ...)

Definition at line 74 of file ProgressMeasurement.cpp.

◆ getMaxCount()

uint64_t storm::utility::ProgressMeasurement::getMaxCount ( ) const

Returns the maximal possible count (if specified).

Definition at line 53 of file ProgressMeasurement.cpp.

◆ getShowProgressDelay()

uint64_t storm::utility::ProgressMeasurement::getShowProgressDelay ( ) const

Returns the currently specified minimal delay (in seconds) between two progress messages.

Definition at line 66 of file ProgressMeasurement.cpp.

◆ isMaxCountSet()

bool storm::utility::ProgressMeasurement::isMaxCountSet ( ) const

Returns whether a maximal count (which is required to achieve 100% progress) has been specified.

Definition at line 49 of file ProgressMeasurement.cpp.

◆ setItemName()

void storm::utility::ProgressMeasurement::setItemName ( std::string const & name)

Customizes the name of what we are counting (e.g.

iterations, states, ...)

Parameters
namethe name of what we are counting.

Definition at line 78 of file ProgressMeasurement.cpp.

◆ setMaxCount()

void storm::utility::ProgressMeasurement::setMaxCount ( uint64_t maxCount)

Sets the maximal possible count.

Definition at line 58 of file ProgressMeasurement.cpp.

◆ setShowProgressDelay()

void storm::utility::ProgressMeasurement::setShowProgressDelay ( uint64_t delay)

Customizes the minimal delay between two progress messages.

Parameters
delaythe delay (in seconds).

Definition at line 70 of file ProgressMeasurement.cpp.

◆ startNewMeasurement()

void storm::utility::ProgressMeasurement::startNewMeasurement ( uint64_t startCount)

Starts a new measurement, dropping all progress information collected so far.

Parameters
startCountthe initial count.

Definition at line 18 of file ProgressMeasurement.cpp.

◆ unsetMaxCount()

void storm::utility::ProgressMeasurement::unsetMaxCount ( )

Erases a previously specified maximal count.

Definition at line 62 of file ProgressMeasurement.cpp.

◆ updateProgress() [1/2]

bool storm::utility::ProgressMeasurement::updateProgress ( uint64_t count)

Updates the progress to the current count and logs it (on the progress log channel) if the delay passed.

Parameters
countThe currently achieved count.
Returns
True iff the progress was logged (i.e., the delay passed).

Definition at line 24 of file ProgressMeasurement.cpp.

◆ updateProgress() [2/2]

bool storm::utility::ProgressMeasurement::updateProgress ( uint64_t count,
std::ostream & outstream )

Updates the progress to the current count.

Parameters
countThe currently achieved count.
outstreamThe stream to which the progress is printed (if the delay passed)
Returns
True iff the progress was printed (i.e., the delay passed)

Definition at line 33 of file ProgressMeasurement.cpp.


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