pub struct ProfitOracleQ { /* private fields */ }Expand description
The ProfitOracleQ struct is an oracle for the profit maximization problem in a discrete version.
Properties:
omega: Theomegaproperty is an instance of theProfitOraclestruct. It is used to calculate the profit for a given input.yd: The variableydis an array that represents the discrete version of y values
Implementations§
Source§impl ProfitOracleQ
impl ProfitOracleQ
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 ProfitOracleQ object with given parameters.
Arguments:
p: The parameterprepresents 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 parameterelasticitiesrepresents 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 parameterprice_outrepresents 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
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)
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 parameteryis an input quantity in log scale. It is of typeArr, which is likely an array or vector type.gamma: The parametergammarepresents the best-so-far optimal value. It is a mutable reference to af64value, which means it can be modified within the function.retry: A boolean value indicating whether it is a retry or not.
type CutChoice = f64
Auto Trait Implementations§
impl Freeze for ProfitOracleQ
impl RefUnwindSafe for ProfitOracleQ
impl Send for ProfitOracleQ
impl Sync for ProfitOracleQ
impl Unpin for ProfitOracleQ
impl UnwindSafe for ProfitOracleQ
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more