EllAlgo 1.6.13
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ProfitOracle Class Reference

Oracle for a profit maximization problem. More...

#include <profit_oracle.hpp>

Public Member Functions

 ProfitOracle (double p, double A, double k, const Vec &a, const Vec &v)
 Construct a new profit oracle object.
 
 ProfitOracle (const ProfitOracle &)=delete
 Construct a new profit oracle object (only explicitly)
 
ProfitOracleoperator= (const ProfitOracle &)=delete
 
 ProfitOracle (ProfitOracle &&)=delete
 
ProfitOracleoperator= (ProfitOracle &&)=delete
 
 ~ProfitOracle ()=default
 
auto set_elasticities (const Vec &elasticities)
 
auto assess_feas (const Vec &y, const double &gamma) -> Cut *
 Assess feasibility of a given input quantity.
 
auto assess_optim (const Vec &y, double &gamma) -> std::tuple< Cut, bool >
 

Detailed Description

Oracle for a profit maximization problem.

This example is taken from [Aliabadi and Salahi, 2013]:

max     p(A x1^alpha x2^beta) - v1*x1 - v2*x2
s.t.    x1 \le k

where:

p(A x1^alpha x2^beta): Cobb-Douglas production function
p: the market price per unit
A: the scale of production
alpha, beta: the output elasticities
x: input quantity
v: output price
k: a given constant that restricts the quantity of x1
Note
Strategy pattern: the two constraints (capacity and Cobb-Douglas profit) are evaluated via a round-robin over a strategy table (_constraints), replacing the former switch (this->idx) dispatch. Each entry is a self-contained constraint evaluator returning a Cut* (or nullptr when satisfied).

Constructor & Destructor Documentation

◆ ProfitOracle() [1/3]

ProfitOracle::ProfitOracle ( double  p,
double  A,
double  k,
const Vec &  a,
const Vec &  v 
)
inline

Construct a new profit oracle object.

Parameters
[in]pthe market price per unit
[in]Athe scale of production
[in]ka given constant that restricts the quantity of x1
[in]athe output elasticities
[in]vthe output prices

◆ ProfitOracle() [2/3]

ProfitOracle::ProfitOracle ( const ProfitOracle )
delete

Construct a new profit oracle object (only explicitly)

◆ ProfitOracle() [3/3]

ProfitOracle::ProfitOracle ( ProfitOracle &&  )
delete

◆ ~ProfitOracle()

ProfitOracle::~ProfitOracle ( )
default

Member Function Documentation

◆ assess_feas()

auto ProfitOracle::assess_feas ( const Vec &  y,
const double gamma 
) -> Cut *

Assess feasibility of a given input quantity.

Uses round-robin to check constraints. Returns a cut if infeasible.

Parameters
[in]yinput quantity (in log scale)
[in]gammathe best-so-far optimal value
Returns
Cut* Pointer to cut, or nullptr if feasible

◆ assess_optim()

auto ProfitOracle::assess_optim ( const Vec &  y,
double gamma 
) -> std::tuple< Cut, bool >
Parameters
[in]yinput quantity (in log scale)
[in,out]gammathe best-so-far optimal value
Returns
std::tuple<Cut, double> Cut and the updated best-so-far value

◆ operator=() [1/2]

ProfitOracle & ProfitOracle::operator= ( const ProfitOracle )
delete

◆ operator=() [2/2]

ProfitOracle & ProfitOracle::operator= ( ProfitOracle &&  )
delete

◆ set_elasticities()

auto ProfitOracle::set_elasticities ( const Vec &  elasticities)
inline

The set_elasticities function is a member function of the ProfitOracle class. It takes a Vec object elasticities as input and sets the _elasticities member variable of the ProfitOracle object to the input value. This function allows you to update the elasticities used by the profit oracle for assessing feasibility and optimization.


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