public class Helpers
extends java.lang.Object
| Constructor and Description | 
|---|
Helpers()  | 
| Modifier and Type | Method and Description | 
|---|---|
static double | 
annuity(double capitalvalue,
       double interestRate,
       int years)
Method to calculate annuity. 
 | 
static java.lang.String | 
capitalizeFirstLetter(java.lang.String instring)
Method to capitalize the first letter of a string. 
 | 
static double | 
discont(double startValue,
       double interestRate,
       int years)
Method for discounting. 
 | 
static double | 
getRealizedAnnuity(java.lang.Integer periodLength,
                  double[] profitMargins,
                  double interestRate)
Method to calculate the annuity from yearly profit margins. 
 | 
static double[] | 
getRealizedLabourCosts(java.lang.Integer periodLength,
                      double[] yield,
                      double slope,
                      double slopeFactor,
                      double slopeExponent,
                      double yieldBeta0,
                      double yieldBeta1,
                      double area,
                      double areaReference,
                      double areaBeta1,
                      double change)
Method to calculate yearly labor costs. 
 | 
static double[] | 
getRealizedProfitMargins(java.lang.Integer periodLength,
                        double[] prices,
                        double[] yields,
                        double[] varCosts,
                        double[] labourCosts,
                        double areaPayment)
Method to calculate profit margins. 
 | 
static double[] | 
getRealizedVarCosts(java.lang.Integer periodLength,
                   double[] yield,
                   double beta0,
                   double beta1,
                   double change)
Method to calculate yearly variable costs. 
 | 
static double[] | 
getRealizedYields(java.lang.Integer periodLength,
                 java.lang.Integer yieldPeriodLength,
                 java.lang.Integer yield1,
                 java.lang.Integer yield2,
                 java.lang.Double[] yieldFactor)
Method to calculate yield of simulation period. 
 | 
static double[] | 
getRealizedYields(int periodLength,
                 int harvestInterval,
                 double yield1,
                 double yield2,
                 double yield3,
                 double yield4,
                 double yieldFactor)
Method to calculate yield of simulation period. 
 | 
static java.util.ResourceBundle | 
loadLanguage(java.lang.String localeStr,
            java.lang.String path,
            java.lang.String file)
Method to load language files. 
 | 
static double | 
prolong(double startValue,
       double interestRate,
       int years)
Method for prolongation. 
 | 
public static java.util.ResourceBundle loadLanguage(java.lang.String localeStr,
                                                    java.lang.String path,
                                                    java.lang.String file)
                                             throws java.net.MalformedURLException
localeStr - Language codepath - Path to language file folderfile - Language file namejava.net.MalformedURLExceptionpublic static double prolong(double startValue,
                             double interestRate,
                             int years)
startValue - Value at the beginninginterestRate - Interest rateyears - Number of years to prolongatepublic static double discont(double startValue,
                             double interestRate,
                             int years)
startValue - Value at the beginninginterestRate - Interest rateyears - Number of years to discountpublic static double annuity(double capitalvalue,
                             double interestRate,
                             int years)
capitalvalue - Net present valueinterestRate - Interest rateyears - Number of years to pay annuity from net present valuepublic static double[] getRealizedYields(int periodLength,
                                         int harvestInterval,
                                         double yield1,
                                         double yield2,
                                         double yield3,
                                         double yield4,
                                         double yieldFactor)
periodLength - Length of simulation periodharvestInterval - Length of harvesting intervalyield1 - Annual yield in first harvesting intervalyield2 - Annual yield in second harvesting intervalyield3 - Annual yield in third harvesting intervalyield4 - Annual yield in fourth harvesting intervalyieldFactor - Yield correction factorpublic static double[] getRealizedYields(java.lang.Integer periodLength,
                                         java.lang.Integer yieldPeriodLength,
                                         java.lang.Integer yield1,
                                         java.lang.Integer yield2,
                                         java.lang.Double[] yieldFactor)
periodLength - Length of simulation periodyield1 - Annual yield in first harvesting intervalyield2 - Annual yield in second harvesting intervalyieldFactor - Yield correction factorpublic static double[] getRealizedVarCosts(java.lang.Integer periodLength,
                                           double[] yield,
                                           double beta0,
                                           double beta1,
                                           double change)
periodLength - Length of simulation periodyield - List of yearly yieldsbeta0 - beta0 in cost functionbeta1 - beta1 in cost functionchange - Annual change percentagepublic static double[] getRealizedLabourCosts(java.lang.Integer periodLength,
                                              double[] yield,
                                              double slope,
                                              double slopeFactor,
                                              double slopeExponent,
                                              double yieldBeta0,
                                              double yieldBeta1,
                                              double area,
                                              double areaReference,
                                              double areaBeta1,
                                              double change)
periodLength - Length of simulation periodyield - List of yearly yieldslope - Slope of fieldslopeFactor - Factor in slope-based cost correction functionslopeExponent - Exponent in slope-based cost correction functionyieldBeta0 - beta0 in yield-based cost functionyieldBeta1 - beta1 in yield-based cost functionarea - Area of fieldareaReference - Reference areaareaBeta1 - beta1 of area-based cost correction functionchange - Annual change percentagepublic static double[] getRealizedProfitMargins(java.lang.Integer periodLength,
                                                double[] prices,
                                                double[] yields,
                                                double[] varCosts,
                                                double[] labourCosts,
                                                double areaPayment)
periodLength - Length of simulation periodprices - List of yearly pricesyields - List of yearly yieldsvarCosts - List of yearly variable costslabourCosts - List of yearly labor costsareaPayment - annual area paymentpublic static double getRealizedAnnuity(java.lang.Integer periodLength,
                                        double[] profitMargins,
                                        double interestRate)
periodLength - Length of simulation periodprofitMargins - List of yearly profit marginsinterestRate - Interest ratepublic static java.lang.String capitalizeFirstLetter(java.lang.String instring)
instring - Input string