pub struct ProfitOracle {
pub elasticities: Array1<f64>,
/* private fields */
}
Expand description
The ProfitOracle struct represents an oracle for a profit maximization problem with specific parameters.
This example is taken from [Aliabadi and Salahi, 2013]:
max p(A x1alpha x2beta) - v1 * x1 - v2 * x2 s.t. x1 <= k
where:
p(scale x1alpha x2beta): Cobb-Douglas production function p: the market price per unit scale: 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
Reference:
- Aliabadi, Hossein, and Maziar Salahi. “Robust Geometric Programming Approach to Profit Maximization with Interval Uncertainty.” Computer Science Journal Of Moldova 61.1 (2013): 86-96.
Properties:
log_p_scale
: The natural logarithm of the scale parameter of the Cobb-Douglas production function. It represents the overall scale of production.log_k
: The natural logarithm of the constant k that restricts the quantity of x1.price_out
: Theprice_out
property represents the output pricesv1
andv2
in the profit maximization problem. It is of typeArr
, which is likely a shorthand for an array or vector data structure.elasticities
: An array representing the output elasticities (alpha and beta) in the profit maximization problem.
Fields§
§elasticities: Array1<f64>
Implementations§
Source§impl ProfitOracle
impl ProfitOracle
Sourcepub fn new(
params: (f64, f64, f64),
elasticities: Array1<f64>,
price_out: Array1<f64>,
) -> Self
pub fn new( params: (f64, f64, f64), elasticities: Array1<f64>, price_out: Array1<f64>, ) -> Self
The function new
constructs a new ProfitOracle object with given parameters.
Arguments:
p
: The parameterp
represents the market price per unit. It is a floating-point number (f64) that indicates the price at which the product is sold in the market.scale
: The scale parameter represents the scale of production. It determines the quantity of output produced.k
: The parameterk
is a given constant that restricts the quantity ofx1
. It is used in the calculation of the profit oracle object.elasticities
: The parameter “elasticities” represents the output elasticities, which are coefficients that measure the responsiveness of the quantity of output to changes in the inputs. It is expected to be an array or list of values.price_out
: Theprice_out
parameter represents the output price. It is of typeArr
, which suggests that it is an array or collection of values. The specific type ofArr
is not specified in the code snippet, so it could be an array, a vector, or any other collection type
Returns:
The new
function is returning an instance of the ProfitOracle
struct.
Trait Implementations§
Source§impl Debug for ProfitOracle
impl Debug for ProfitOracle
Source§impl OracleOptim<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for ProfitOracle
impl OracleOptim<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for ProfitOracle
Source§fn assess_optim(
&mut self,
y: &Array1<f64>,
gamma: &mut f64,
) -> ((Array1<f64>, f64), bool)
fn assess_optim( &mut self, y: &Array1<f64>, gamma: &mut f64, ) -> ((Array1<f64>, f64), bool)
The function assess_optim calculates the gradient and objective function value for an optimization problem in Rust.
Arguments:
y
: A reference to an array of f64 values.gamma
: The parametergamma
is a mutable reference to af64
variable.