Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::ProgressData Struct Reference

Public Member Functions

double ProgressDone () const
 
void Add (const ProgressData &other)
 
void Normalize (const double target=1.0)
 
void SetInvalid ()
 
bool IsValid () const
 

Public Attributes

double done = 0.0
 
double total = 0.0
 
bool invalid = false
 

Member Function Documentation

◆ ProgressDone()

double duckdb::ProgressData::ProgressDone ( ) const
inline
19906 {
19907 // ProgressDone requires a valid state
19908 D_ASSERT(IsValid());
19909
19910 return done / total;
19911 }

◆ Add()

void duckdb::ProgressData::Add ( const ProgressData other)
inline
19913 {
19914 // Add is unchecked, propagating invalid
19915 done += other.done;
19916 total += other.total;
19917 invalid = invalid || other.invalid;
19918 }

◆ Normalize()

void duckdb::ProgressData::Normalize ( const double  target = 1.0)
inline
19919 {
19920 // Normalize checks only `target`, propagating invalid
19921 D_ASSERT(target > 0.0);
19922 if (IsValid()) {
19923 if (total > 0.0) {
19924 done /= total;
19925 }
19926 total = 1.0;
19927 done *= target;
19928 total *= target;
19929 } else {
19930 SetInvalid();
19931 }
19932 }

◆ SetInvalid()

void duckdb::ProgressData::SetInvalid ( )
inline
19933 {
19934 invalid = true;
19935 done = 0.0;
19936 total = 1.0;
19937 }

◆ IsValid()

bool duckdb::ProgressData::IsValid ( ) const
inline
19938 {
19939 return (!invalid) && (done >= 0.0) && (done <= total) && (total >= 0.0);
19940 }

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