Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::AdaptiveParameterValue Class Reference

#include <adaptative_parameter_value.h>

Public Member Functions

 AdaptiveParameterValue (double initial_value)
 Initial value is in [0.0, 1.0], both 0.0 and 1.0 are valid.
 
void Reset ()
 
void Increase ()
 
void Decrease ()
 
void Update (int num_decreases, int num_increases)
 
double value () const
 

Detailed Description

Basic adaptive [0.0, 1.0] parameter that can be increased or decreased with a step that get smaller and smaller with the number of updates.

After a while, if the probability of getting a Decrease() vs Increase() when running at a given value is f(value), then this should converge towards a value such that f(value) = 0.5 provided f is a non-decreasing function over [0.0, 1.0].

Todo
(user): The current logic work well in practice, but has no strong theoretical foundation. We should be able to come up with a better understood formula that converge way faster. It will also be nice to generalize the 0.5 above to a target probability p.

Definition at line 35 of file adaptative_parameter_value.h.

Constructor & Destructor Documentation

◆ AdaptiveParameterValue()

operations_research::AdaptiveParameterValue::AdaptiveParameterValue ( double initial_value)
inlineexplicit

Initial value is in [0.0, 1.0], both 0.0 and 1.0 are valid.

Definition at line 38 of file adaptative_parameter_value.h.

Member Function Documentation

◆ Decrease()

void operations_research::AdaptiveParameterValue::Decrease ( )
inline

Definition at line 48 of file adaptative_parameter_value.h.

◆ Increase()

void operations_research::AdaptiveParameterValue::Increase ( )
inline

Definition at line 43 of file adaptative_parameter_value.h.

◆ Reset()

void operations_research::AdaptiveParameterValue::Reset ( )
inline

Definition at line 41 of file adaptative_parameter_value.h.

◆ Update()

void operations_research::AdaptiveParameterValue::Update ( int num_decreases,
int num_increases )
inline

If we get more than 1 datapoints from the same value(), we use a formula that is more sound than calling n times Increase()/Decrease() which depends on the order of calls.

Definition at line 56 of file adaptative_parameter_value.h.

◆ value()

double operations_research::AdaptiveParameterValue::value ( ) const
inline

Definition at line 68 of file adaptative_parameter_value.h.


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