SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
ProgressReporter Class Referenceabstract

Abstract sink for progress information produced by a running analysis. More...

#include <progressreporter.h>

Inheritance diagram for ProgressReporter:
Inheritance graph
Collaboration diagram for ProgressReporter:
Collaboration graph

Public Member Functions

virtual ~ProgressReporter ()=default
 
virtual void Start ()
 Makes the reporter visible or otherwise begins reporting.
 
virtual void Finish ()
 Ends reporting.
 
virtual void AppendPoint (const double &x, const double &y, int chart=0)=0
 Adds a point to one of the progress charts.
 
virtual void SetProgress (const double &prog)=0
 Sets the primary progress fraction.
 
virtual void SetProgress2 (const double &prog)=0
 Sets the secondary progress fraction, where one is displayed.
 
virtual void SetLabel (const QString &label)=0
 Sets the free-text status label.
 
virtual void SetYRange (const double &y0, const double &y1, int chart=0)=0
 Sets the vertical range of a chart.
 
virtual void SetXRange (const double &x0, const double &x1, int chart=0)=0
 Sets the horizontal range of a chart.
 
virtual void SetTitle (const QString &title, int chart=0)=0
 Sets the title of a chart.
 
virtual void SetXAxisTitle (const QString &title, int chart=0)=0
 Sets the horizontal axis title of a chart.
 
virtual void SetYAxisTitle (const QString &title, int chart=0)=0
 Sets the vertical axis title of a chart.
 
virtual void ClearGraph (int chart=0)=0
 Discards the points accumulated in a chart.
 
virtual void SetChartTitle (int i, const QString &title)=0
 Sets the title of chart i.
 

Detailed Description

Abstract sink for progress information produced by a running analysis.

The long-running algorithms (genetic algorithm, MCMC, distribution fitting, the batch analyses) report their progress as they go. In the graphical application that progress is drawn in a ProgressWindow; in the command line application it is written to the console or discarded. Neither the algorithms nor the Conductor should care which, so both report through this interface.

The method set mirrors the ProgressWindow API that the algorithms were already written against, so that ProgressWindow implements this interface without changing the body of any of its methods.

Only QString is used here, which belongs to QtCore. This header deliberately pulls in nothing from QtWidgets, so that code including it stays usable in a program that never creates a window.

Note
Implementations must tolerate being called from an analysis that runs to completion without ever calling Start() or Finish()
See also
ProgressWindow for the graphical implementation
AnalysisHost for how reporters are created and disposed of

Definition at line 29 of file progressreporter.h.

Constructor & Destructor Documentation

◆ ~ProgressReporter()

virtual ProgressReporter::~ProgressReporter ( )
virtualdefault

Member Function Documentation

◆ AppendPoint()

virtual void ProgressReporter::AppendPoint ( const double &  x,
const double &  y,
int  chart = 0 
)
pure virtual

Adds a point to one of the progress charts.

Parameters
xHorizontal coordinate, typically an iteration or generation number
yVertical coordinate, typically a fitness or likelihood value
chartIndex of the chart to append to

Implemented in NullProgressReporter, and ProgressWindow.

Referenced by SourceSinkData::SolveLevenberg_Marquardt().

◆ ClearGraph()

virtual void ProgressReporter::ClearGraph ( int  chart = 0)
pure virtual

Discards the points accumulated in a chart.

Implemented in ProgressWindow, and NullProgressReporter.

Referenced by SourceSinkData::MCMC_Batch().

◆ Finish()

virtual void ProgressReporter::Finish ( )
inlinevirtual

Ends reporting.

Named Finish() for the same reason Start() is not called show(). Disposing of the reporter is the responsibility of the AnalysisHost that created it, not of this call.

Reimplemented in ProgressWindow.

Definition at line 50 of file progressreporter.h.

◆ SetChartTitle()

virtual void ProgressReporter::SetChartTitle ( int  i,
const QString &  title 
)
pure virtual

Sets the title of chart i.

Implemented in ProgressWindow, and NullProgressReporter.

◆ SetLabel()

virtual void ProgressReporter::SetLabel ( const QString &  label)
pure virtual

Sets the free-text status label.

Implemented in NullProgressReporter, and ProgressWindow.

Referenced by SourceSinkData::LM_Batch(), and SourceSinkData::MCMC_Batch().

◆ SetProgress()

◆ SetProgress2()

virtual void ProgressReporter::SetProgress2 ( const double &  prog)
pure virtual

Sets the secondary progress fraction, where one is displayed.

Parameters
progProgress in the range [0,1]

Implemented in NullProgressReporter, and ProgressWindow.

Referenced by SourceSinkData::MCMC_Batch().

◆ SetTitle()

virtual void ProgressReporter::SetTitle ( const QString &  title,
int  chart = 0 
)
pure virtual

◆ SetXAxisTitle()

virtual void ProgressReporter::SetXAxisTitle ( const QString &  title,
int  chart = 0 
)
pure virtual

Sets the horizontal axis title of a chart.

Implemented in NullProgressReporter, and ProgressWindow.

◆ SetXRange()

virtual void ProgressReporter::SetXRange ( const double &  x0,
const double &  x1,
int  chart = 0 
)
pure virtual

Sets the horizontal range of a chart.

Implemented in NullProgressReporter, and ProgressWindow.

Referenced by SourceSinkData::SolveLevenberg_Marquardt().

◆ SetYAxisTitle()

virtual void ProgressReporter::SetYAxisTitle ( const QString &  title,
int  chart = 0 
)
pure virtual

Sets the vertical axis title of a chart.

Implemented in NullProgressReporter, and ProgressWindow.

Referenced by Conductor::ExecuteGA_FixedProfile(), Conductor::ExecuteTestCMBBayesian(), and SourceSinkData::MCMC().

◆ SetYRange()

virtual void ProgressReporter::SetYRange ( const double &  y0,
const double &  y1,
int  chart = 0 
)
pure virtual

Sets the vertical range of a chart.

Implemented in NullProgressReporter, and ProgressWindow.

◆ Start()

virtual void ProgressReporter::Start ( )
inlinevirtual

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