Struct ProfitOracle

Source
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: The price_out property represents the output prices v1 and v2 in the profit maximization problem. It is of type Arr, 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

Source

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 parameter p 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 parameter k is a given constant that restricts the quantity of x1. 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: The price_out parameter represents the output price. It is of type Arr, which suggests that it is an array or collection of values. The specific type of Arr 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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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)

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 parameter gamma is a mutable reference to a f64 variable.
Source§

type CutChoice = f64

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.