Struct ProfitOracleQ

Source
pub struct ProfitOracleQ { /* private fields */ }
Expand description

The ProfitOracleQ struct is an oracle for the profit maximization problem in a discrete version.

Properties:

  • omega: The omega property is an instance of the ProfitOracle struct. It is used to calculate the profit for a given input.
  • yd: The variable yd is an array that represents the discrete version of y values

Implementations§

Source§

impl ProfitOracleQ

Source

pub fn new( params: (f64, f64, f64), elasticities: Array1<f64>, price_out: Array1<f64>, ) -> Self

The function new constructs a new ProfitOracleQ 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 a unit of the product is sold in the market.
  • scale: The “scale” parameter represents the scale of production, which refers to the level of output or production of a particular good or service. It indicates the quantity of goods or services produced within a given time period.
  • k: A given constant that restricts the quantity of x1. It is used to limit the quantity of a particular input (x1) in the production process.
  • elasticities: The parameter elasticities represents the output elasticities. Output elasticity measures the responsiveness of the quantity of output to a change in the input quantity. It indicates how much the quantity of output changes in response to a change in the quantity of input.
  • price_out: The parameter price_out represents the output price. It is an array that contains the prices of the outputs.

Returns:

The new function is returning an instance of the ProfitOracleQ struct.

Trait Implementations§

Source§

impl OracleOptimQ<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for ProfitOracleQ

Source§

fn assess_optim_q( &mut self, y: &Array1<f64>, gamma: &mut f64, retry: bool, ) -> ((Array1<f64>, f64), bool, Array1<f64>, bool)

The assess_optim_q function takes in an input quantity y in log scale, updates the best-so-far optimal value gamma, and returns a cut and the updated best-so-far value.

Arguments:

  • y: The parameter y is an input quantity in log scale. It is of type Arr, which is likely an array or vector type.
  • gamma: The parameter gamma represents the best-so-far optimal value. It is a mutable reference to a f64 value, which means it can be modified within the function.
  • retry: A boolean value indicating whether it is a retry or not.
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.