watch#
Classes#
Reference#
-
template<class T>
class Reference : public ioh::logger::Property# A property that access a referenced variable.
Note
The variable must be castable to a double.
Public Functions
-
inline Reference(const std::string name, const T &variable, const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
- Parameters:
name – the name of the property.
variable – a reference to the logged variable.
format – a fmt::format specification
-
inline Reference(const std::string name, const T &variable, const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Pointer#
-
template<class T>
class Pointer : public ioh::logger::Property# A property that access a variable through a pointer.
Note
The pointed variable must be castable to a double.
Public Functions
-
inline Pointer(const std::string name, const T *const variable, const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
- Parameters:
name – the name of the property.
variable – a pointer to the logged variable.
format – a fmt::format specification
-
inline Pointer(const std::string name, const T *const variable, const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
PointerReference#
-
template<class T>
class PointerReference : public ioh::logger::Property# A property that access the variable of a variable through a reference to a pointer.
Use this if the variable does not always exists in the logged scope.
Note
The pointed variable must be castable to a double.
Warning
It is your responsability to ensure that the referenced pointer is a nullptr if the variable is out of the logged scope.
Public Types
-
using RefType = ConstPtrType&#
Typedef for the const ptr ref.
Public Functions
-
inline PointerReference(const std::string name, ConstRefType ref_ptr_var, const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
- Parameters:
name – the name of the property.
ref_ptr_var – a reference to a pointer to the logged variable.
format – a fmt::format specification
Protected Attributes
-
ConstRefType _ref_ptr_var#
The managed reference to a pointer.
-
using RefType = ConstPtrType&#
Structs#
Evaluations#
RawY#
-
struct RawY : public ioh::logger::Property#
A property that access the cyrrent objective value, without transformation.
Public Functions
-
inline RawY(const std::string name = "raw_y", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
-
inline RawY(const std::string name = "raw_y", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
RawYBest#
-
struct RawYBest : public ioh::logger::Property#
A property that access the best value so far, without transformation.
Public Functions
-
inline RawYBest(const std::string name = "raw_y_best", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
-
inline RawYBest(const std::string name = "raw_y_best", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
TransformedY#
-
struct TransformedY : public ioh::logger::Property#
A property that access the current value so far, with transformation.
Public Functions
-
inline TransformedY(const std::string name = "transformed_y", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
Main call interface.
-
inline virtual std::optional<double> operator()(const logger::Info &log_info) const override#
Returns the current value of the managed variable.
The call interface should return an optional, which should be set to
std::nullopt
if the managed variable cannot be accessed (for instance if it does not exists during the call scope, for example if it’s a dynamic algorithm parameter that is not currently configured).- Parameters:
log_info – The current problem state data.
- Returns:
An optional that holds a
double
if the variable is available,std::nullopt
else.
-
inline TransformedY(const std::string name = "transformed_y", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
TransformedYBest#
-
struct TransformedYBest : public ioh::logger::Property#
A property that access the best value found so far, with transformation.
Public Functions
-
inline TransformedYBest(const std::string name = "transformed_y_best", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
-
inline TransformedYBest(const std::string name = "transformed_y_best", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
CurrentY#
-
struct CurrentY : public ioh::logger::Property#
A property that access the current value so far, with transformation and constraints applied.
Public Functions
-
inline CurrentY(const std::string name = "current_y", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
Main call interface.
-
inline virtual std::optional<double> operator()(const logger::Info &log_info) const override#
Returns the current value of the managed variable.
The call interface should return an optional, which should be set to
std::nullopt
if the managed variable cannot be accessed (for instance if it does not exists during the call scope, for example if it’s a dynamic algorithm parameter that is not currently configured).- Parameters:
log_info – The current problem state data.
- Returns:
An optional that holds a
double
if the variable is available,std::nullopt
else.
-
inline CurrentY(const std::string name = "current_y", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
CurrentBestY#
-
struct CurrentBestY : public ioh::logger::Property#
A property that access the current best value so far, with transformation and constraints applied.
Public Functions
-
inline CurrentBestY(const std::string name = "current_y_best", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Constructor.
Main call interface.
-
inline virtual std::optional<double> operator()(const logger::Info &log_info) const override#
Returns the current value of the managed variable.
The call interface should return an optional, which should be set to
std::nullopt
if the managed variable cannot be accessed (for instance if it does not exists during the call scope, for example if it’s a dynamic algorithm parameter that is not currently configured).- Parameters:
log_info – The current problem state data.
- Returns:
An optional that holds a
double
if the variable is available,std::nullopt
else.
-
inline CurrentBestY(const std::string name = "current_y_best", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)#
Violation#
-
struct Violation : public ioh::logger::Property#
A property that accesses the current constraint violation.
Public Functions
-
inline Violation(const std::string name = "violation", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT, const size_t ci = 0)#
Constructor.
Main call interface.
-
inline virtual std::optional<double> operator()(const logger::Info &log_info) const override#
Returns the current value of the managed variable.
The call interface should return an optional, which should be set to
std::nullopt
if the managed variable cannot be accessed (for instance if it does not exists during the call scope, for example if it’s a dynamic algorithm parameter that is not currently configured).- Parameters:
log_info – The current problem state data.
- Returns:
An optional that holds a
double
if the variable is available,std::nullopt
else.
Private Members
-
size_t ci#
Index of the constraint to be logged.
-
inline Violation(const std::string name = "violation", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT, const size_t ci = 0)#
Penalty#
-
struct Penalty : public ioh::logger::Property#
A property that accesses the current constraint penalty.
Public Functions
-
inline Penalty(const std::string name = "penalty", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT, const size_t ci = 0)#
Constructor.
Main call interface.
-
inline virtual std::optional<double> operator()(const logger::Info &log_info) const override#
Returns the current value of the managed variable.
The call interface should return an optional, which should be set to
std::nullopt
if the managed variable cannot be accessed (for instance if it does not exists during the call scope, for example if it’s a dynamic algorithm parameter that is not currently configured).- Parameters:
log_info – The current problem state data.
- Returns:
An optional that holds a
double
if the variable is available,std::nullopt
else.
Private Members
-
size_t ci#
Index of the constraint to be logged.
-
inline Penalty(const std::string name = "penalty", const std::string &format = logger::DEFAULT_DOUBLE_FORMAT, const size_t ci = 0)#
Functions#
address#
-
template<class T>
Pointer<T> &ioh::watch::address(const std::string name, const T *const variable, const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)# The value of an extern variable (captured by address).
- Parameters:
name – the name of the property.
variable – a pointer to the logged variable.
format – a string to format the variable when logging.
pointer#
-
template<class T>
PointerReference<T> &ioh::watch::pointer(const std::string name, const T *const &variable, const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)# The value of an extern variable, which may not exists.
Useful for variables that doesn’t exists at some point during the solver run. In that case, if the referenced pointer is a
std::nullptr
, the value will be indicated as invalid in the logs.To do so, this captures a reference to a pointer toward your variable. If you update the value of the pointed variables, it will change in the logs. If you need to invalidate the variable, you can set the referenced pointer itself to
nullptr
.Warning
It is your responsability to ensure that the referenced pointer is a nullptr if the variable is out of the logged scope.
- Parameters:
name – the name of the property.
variable – a reference to a pointer to the logged variable.
format – a fmt::format specification
reference#
-
template<class T>
Reference<T> &ioh::watch::reference(const std::string name, const T &variable, const std::string &format = logger::DEFAULT_DOUBLE_FORMAT)# The value of an extern variable (captured by reference).
- Parameters:
name – the name of the property.
variable – a reference to the logged variable.
format – a fmt::format specification
Variables#
current_y#
current_y_best#
-
CurrentBestY ioh::watch::current_y_best#
Objective function value for this call, without transformation.
evaluations#
-
Evaluations ioh::watch::evaluations#
Number of evaluations of the objective function called by the solver.
penalty#
raw_y#
raw_y_best#
transformed_y#
-
TransformedY ioh::watch::transformed_y#
Objective function value for this call, with transformation.
transformed_y_best#
-
TransformedYBest ioh::watch::transformed_y_best#
Best objective function value found so far, with transformation.