org.opensha.sra.calc
Class BenefitCostCalculator

java.lang.Object
  extended by org.opensha.sra.calc.BenefitCostCalculator

public class BenefitCostCalculator
extends Object

Title: BenefitCostCalculator
Description: Calculates Benefit, Cost, and the Benefit-Cost Ratio (BCR) of a structure given a current and retrofitted cost/expected annualized loss. Use this in conjunction with the BenefitCostBean to gather information required.

Author:
Eric Martinez, Keith Porter

Constructor Summary
BenefitCostCalculator()
          Creates a new Benefit Cost Calculator and sets all parameters equal to zero.
BenefitCostCalculator(double eal0, double eal1, double rate, double years, double netCost)
          Creates a new Benefit Cost Calculator with the given parameters.
BenefitCostCalculator(double eal0, double eal1, double rate, double years, double cost0, double cost1)
          Creates a new Benefit Cost Calculator with the given parameters.
 
Method Summary
 double computeBCR()
          Computes the Benefit Cost Ration of retrofitting the structure by using the current objects parameters.
static double computeBCR(double eal0, double eal1, double rate, double years, double cost0, double cost1)
          Computes the Benefit Cost Ratio of retrofitting a structure.
 double computeBenefit()
          Computes the benefit of retrofitting the structure by using the current values for EAL0, EAL1, rate, and years.
static double computeBenefit(double eal0, double eal1, double rate, double years)
          Computes the benefit for retrofitted a structure for the given EAL values over years at rate.
 double computeCost()
          Computes the cost of retrofitting the structure by using the current values for InitialCost and RetroCost.
static double computeCost(double cost0, double cost1)
          Computes the cost of retrofitting a structure.
 double getInitialEAL()
           
 double getNetCost()
           
 double getRate()
           
 double getRetroEAL()
           
 double getYears()
           
 void setInitialEAL(double eal0)
          Sets the initialEAL value to eal0
 void setNetCost(double netCost)
          Sets the NetCost to netCost
 void setNetCost(double cost0, double cost1)
          Sets the NetCost to cost1 - cost0
 void setRate(double rate)
          Sets the discount rate (in %) to rate
 void setRetroEAL(double eal1)
          Sets the retroEAL value to eal1
 void setYears(double years)
          Sets the return period (in years) to years
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BenefitCostCalculator

public BenefitCostCalculator()
Creates a new Benefit Cost Calculator and sets all parameters equal to zero. You must then set the values using the get/set methods else an exception will be thrown upon attempt to calculate BCR.


BenefitCostCalculator

public BenefitCostCalculator(double eal0,
                             double eal1,
                             double rate,
                             double years,
                             double cost0,
                             double cost1)
Creates a new Benefit Cost Calculator with the given parameters.

Parameters:
eal0 - The EAL for the Current Structure.
eal1 - The EAL for the Retrofitted Structure.
rate - The Discout Rate to apply. This is in %. i.e. 3.5%
years - The number of years to calculate for.
cost0 - The cost of building the structure "As-Is".
cost1 - The cost of building the structure "What-If".

BenefitCostCalculator

public BenefitCostCalculator(double eal0,
                             double eal1,
                             double rate,
                             double years,
                             double netCost)
Creates a new Benefit Cost Calculator with the given parameters.

Parameters:
eal0 - The EAL for the Current Structure.
eal1 - The EAL for the Retrofitted Structure.
rate - The Discout Rate to apply. This is in %. i.e. 3.5%
years - The number of years to calculate for.
netCost - The cost of a retrofit for an existing structure, or the marginal cost between two prospective structure designs
Method Detail

computeBenefit

public double computeBenefit()
Computes the benefit of retrofitting the structure by using the current values for EAL0, EAL1, rate, and years.

Returns:
The benefit of retrofitting the structure.

computeCost

public double computeCost()
Computes the cost of retrofitting the structure by using the current values for InitialCost and RetroCost.

Returns:
The cost of retrofitting the structure.

computeBCR

public double computeBCR()
Computes the Benefit Cost Ration of retrofitting the structure by using the current objects parameters.

Returns:
The BCR of retrofitting.

computeBenefit

public static double computeBenefit(double eal0,
                                    double eal1,
                                    double rate,
                                    double years)
Computes the benefit for retrofitted a structure for the given EAL values over years at rate.

Parameters:
eal0 - The Expected Annualized Loss for the structure for the current construction conditions.
eal1 - The Expexted Annualized Loss for the structure for the retrofitted construction conditions.
rate - The Discount Rate to use for calculations.
years - The number of years to calculate over.

computeCost

public static double computeCost(double cost0,
                                 double cost1)
Computes the cost of retrofitting a structure.

Parameters:
cost0 - The cost of building the structure "As-Is".
cost1 - The cost of building the structure "What-If"
Returns:
The difference between cost1 and cost0.

computeBCR

public static double computeBCR(double eal0,
                                double eal1,
                                double rate,
                                double years,
                                double cost0,
                                double cost1)
Computes the Benefit Cost Ratio of retrofitting a structure.

Parameters:
eal0 - The EAL for the Current Structure.
eal1 - The EAL for the Retrofitted Structure.
rate - The Discout Rate to apply.
years - The number of years to calculate for.
cost0 - The cost of building the structure "As-Is".
cost1 - The cost of building the structure "What-If".
Returns:
The Benefit-Cost ratio for the given parameters.

setNetCost

public void setNetCost(double netCost)
Sets the NetCost to netCost


setNetCost

public void setNetCost(double cost0,
                       double cost1)
Sets the NetCost to cost1 - cost0


setInitialEAL

public void setInitialEAL(double eal0)
Sets the initialEAL value to eal0


setRetroEAL

public void setRetroEAL(double eal1)
Sets the retroEAL value to eal1


setRate

public void setRate(double rate)
Sets the discount rate (in %) to rate


setYears

public void setYears(double years)
Sets the return period (in years) to years


getNetCost

public double getNetCost()
Returns:
The netCost for this retrofit analysis

getInitialEAL

public double getInitialEAL()
Returns:
The EAL for "as-is" conditions

getRetroEAL

public double getRetroEAL()
Returns:
The EAL for "what-if" conditions

getRate

public double getRate()
Returns:
The current discount rate (in %)

getYears

public double getYears()
Returns:
The current return period (in years)