Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

RAMShop Class Reference

Ordering of supplies optimization class. More...

List of all members.

Public Methods

 RAMShop (float cw, float cr, int N, float L, int D, int W, int lambda, JProgressBar progress) throws BadParamException
 Constructor. More...

float getCw ()
 Returns wholesale price. More...

void setCw (float cw) throws BadParamException
 Sets wholesale price. More...

float getCr ()
 Returns retail price. More...

void setCr (float cr) throws BadParamException
 Sets retail price. More...

int getN ()
 Returns number of time stages. More...

void setN (int N) throws BadParamException
 Sets number of time stages. More...

float getL ()
 Returns loss due to short supply. More...

void setL (float L) throws BadParamException
 Sets loss due to short supply. More...

int getD ()
 Returns shop warehouse size. More...

void setD (int D) throws BadParamException
 Sets shop warehouse size. More...

int getW ()
 Returns maximal RAM demand. More...

void setW (int W) throws BadParamException
 Sets maximal RAM demand. More...

int getLambda ()
 Returns expected RAM demand. More...

void setLambda (int lambda) throws BadParamException
 Setss expected RAM demand. More...

void refreshTables ()
 (Re)calculates optimal decisions. More...

Solution optimalDecision (int q)
 Returns optimal decision. More...

Solution optimalDecision (int q, int i)
 Returns optimal decision in given stage. More...


Private Methods

void maximalUtility (float[][] u, int stage)
 Calculates maximal utility in given stage. More...

void sumUtility (float[][] u, int stage)
 Summarizes utilities of current and next stages. More...

double poissonDistribution (int w)
 Returns Poisson distribution for given value. More...


Private Attributes

float cw
 wholesale price of one RAM unit.

float cr
 retail price of one RAM unit.

int N
 number of time stages.

float L
 loss due to short supply of one RAM unit.

int D
 shop warehouse size in RAM units.

int W
 maximal RAM demand.

int lambda
 expected RAM demand.

int [][] optimald
 optimal supply decision ([stage][number of unsold units]).

float [][] optimalu
 maximal utility ([stage][number of unsold units]).

int lastW
 last demand used for probability calculation.

double probabilityW
 last probability.

JProgressBar progress
 progress bar to indicate that calculations are being performed.


Detailed Description

A computer shop orders d units of RAM at fixed times t=1..N. The supply d is optimized when demand w is unknown.


Constructor & Destructor Documentation

RAMShop::RAMShop ( float cw,
float cr,
int N,
float L,
int D,
int W,
int lambda,
JProgressBar progress )
 

Creates optimization class with given parameters.

Parameters:
cw   wholesale price of one RAM unit (>0).
cr   retail price of one RAM unit (<0).
N   number of time stages (natural).
L   coefficient of loss due to short supply (>0).
D   shop warehouse size in RAM units (natural).
W   maximal RAM demand (natural).
lambda   expected RAM demand (>=0).
progress   progress bar to indicate that calculations are being performed


Member Function Documentation

float RAMShop::getCr ( )
 

Returns:
retail price of one RAM unit.

float RAMShop::getCw ( )
 

Returns:
wholesale price of one RAM unit.

int RAMShop::getD ( )
 

Returns:
shop warehouse size in RAM units.

float RAMShop::getL ( )
 

Returns:
loss due to short supply of one RAM unit.

int RAMShop::getLambda ( )
 

Returns:
expected RAM demand.

int RAMShop::getN ( )
 

Returns:
number of time stages.

int RAMShop::getW ( )
 

Returns:
maximal RAM demand.

void RAMShop::maximalUtility ( float u[][],
int stage ) [private]
 

Calculates maximal utility and corresponding supply decision in time stage stage. Results are stored in optimization tables.

Parameters:
u   utility matrix ([number of unsold units][supply]).
stage   time stage number (>0 and <number of time stage).
See also:
sumUtility(float[][] u, int stage)

Solution RAMShop::optimalDecision ( int q,
int i )
 

Returns optimal supply and resulting utility in time stage i, given the number of unslod RAM units q from previous stage.

Parameters:
q   number of unsold units (>=0 and <shop warehouse size).
i   time stage number (>0 and <number of time stage ).
Returns:
optimal decision
See also:
Solution , optimalDecision(int q)

Solution RAMShop::optimalDecision ( int q )
 

Returns optimal supply and resulting utility, given the number of unslod RAM units q from previous time stage.

Parameters:
q   number of unsold units (>=0 and <shop warehouse size).
Returns:
optimal decision.
See also:
Solution , optimalDecision(int q, int i)

double RAMShop::poissonDistribution ( int w ) [private]
 

Returns probability of demand value w, distributes by Poisson law. Expected demand value is lambda.

Parameters:
w   demand.
Returns:
demand probability.

void RAMShop::refreshTables ( )
 

(Re)calculates decisions tables using current optimization parameters parameters. Results are stored in optimization tables.

void RAMShop::setCr ( float cr )
 

Parameters:
cr   retail price of one RAM unit.

void RAMShop::setCw ( float cw )
 

Parameters:
cw   wholesale price of one RAM unit.

void RAMShop::setD ( int D )
 

Parameters:
D   shop warehouse size in RAM units.

void RAMShop::setL ( float L )
 

Parameters:
L   loss due to short supply of one RAM unit.

void RAMShop::setLambda ( int lambda )
 

Parameters:
lambda   expected RAM demand.

void RAMShop::setN ( int N )
 

Parameters:
N   number of time stages.

void RAMShop::setW ( int W )
 

Parameters:
W   maximal RAM demand.

void RAMShop::sumUtility ( float u[][],
int stage ) [private]
 

Summarizes utility of current time stage stage and maximal total utility of next stage.

Parameters:
u   utility matrix ([number of unsold units][supply]).
stage   time stage number (>0 and <number of time stage).


The documentation for this class was generated from the following file:
Generated at Mon May 28 15:13:56 2001 by Giedrius Paulikas & Emilis Štuopys, © 2001