src/de/pik/lagom/generic/initvalues/ImportExportInitValues.java

00001 
00002 // Copyright 2010 by Carlo Jaeger, Antoine Mandel, Steffen Fuerst and European Climate Forum
00003 // Licensed under the Open Software License version 3.0
00004 // See the file "License-OSL-3.0.txt" in the distribution for more information
00005 // The License text can be also found under http://www.opensource.org/licenses/osl-3.0.php
00007 
00008 
00009 package de.pik.lagom.generic.initvalues;
00010 
00011 import de.pik.lagom.annotations.Description;
00012 import de.pik.lagom.annotations.InitValue;
00013 import de.pik.lagom.annotations.MatrixDescription;
00014 import de.pik.lagom.annotations.NameInUI;
00015 import de.pik.lagom.annotations.Variability;
00016 import static de.pik.lagom.annotations.Variability.*;
00017 import de.pik.lagom.generic.Foundation;
00018 import de.pik.lagom.toolbox.ArrayTools;
00019 import de.pik.lagom.toolbox.io.initvalues.InitValuesManager;
00020 
00021 @Variability(SIMULATION)
00022 public class ImportExportInitValues extends InitValuesWithSectors {
00027   @InitValue(inspector = "Import", posInInspector = 100, 
00028              exclude = "defaultInitialMaxImportAsOverallProductionFactor")
00029   @MatrixDescription(rowNames = "getSectorNames")
00030   @NameInUI("Initiale Import Limitation Factor")
00031   @Description("The maximal import is calculated by multiply the import limitation factor " + 
00032                "with the overall production of the sector")
00033   double[] initialMaxImportAsOverallProductionFactorArray;
00034 
00035   @InitValue(readOnly = true, exclude = "initialMaxImportAsOverallProductionFactorArray")
00036   double defaultInitialMaxImportAsOverallProductionFactor = 5.d;
00037 
00039   @InitValue(inspector = "Import", posInInspector = 101)
00040   @NameInUI("Growth of Import Limitation")
00041   @Description("The import limitation factor is multiplying each period with this value")
00042   double growthOfMaxImport = 1.005d;
00043 
00048   @InitValue(inspector = "Import", posInInspector = 200, 
00049              exclude = "defaultInitialMaxExportAsOverallProductionFactor")
00050   @MatrixDescription(rowNames = "getSectorNames")
00051   @NameInUI("Initiale Export Limitation Factor")
00052   @Description("The maximal export is calculated by multiply the import limitation factor " + 
00053                "with the overall production of the sector")
00054   double[] initialMaxExportAsOverallProductionFactorArray;
00055 
00056   @InitValue(readOnly = true, exclude = "initialMaxExportAsOverallProductionFactorArray")
00057   double defaultInitialMaxExportAsOverallProductionFactor = 5.d;
00058 
00060   @InitValue(inspector = "Import", posInInspector = 201)
00061   @NameInUI("Growth of Export Limitation")
00062   @Description("The export limitation factor is multiplying each period with this value")
00063   double growthOfMaxExport = 1.005d;
00064 
00065   @InitValue(inspector = "Import", posInInspector = 1)
00066   @NameInUI("Observed Suppliers Quotient")
00067   @Description("The quotient of firms that can export their production")
00068   public double observedSuppliersQuotient = 1.0d;
00069 
00070   public ImportExportInitValues(InitValuesManager pIVM) {
00071     super(pIVM);
00072   }
00073 
00074   @Override
00075   public void setArrayValues() {
00076     setDefaultInitialMaxImportAsOverallProductionFactor(defaultInitialMaxImportAsOverallProductionFactor);
00077     setDefaultInitialMaxExportAsOverallProductionFactor(defaultInitialMaxExportAsOverallProductionFactor);
00078   }
00079 
00080   public double getDefaultInitialMaxImportAsOverallProductionFactor() {
00081     return ArrayTools.allElementsHaveSameValue(initialMaxImportAsOverallProductionFactorArray);
00082   }
00083 
00084   public void setDefaultInitialMaxImportAsOverallProductionFactor(double pNewValue) {
00085     defaultInitialMaxImportAsOverallProductionFactor = pNewValue;
00086     initialMaxImportAsOverallProductionFactorArray = createArray(pNewValue);
00087   }
00088 
00089   public double[] getInitialMaxImportAsOverallProductionFactorArray() {
00090     return initialMaxImportAsOverallProductionFactorArray;
00091   }
00092 
00093   public void setInitialMaxImportAsOverallProductionFactorArray(double[] pNewArray) {
00094     initialMaxImportAsOverallProductionFactorArray = pNewArray;
00095     defaultInitialMaxImportAsOverallProductionFactor =
00096       checkForDefault(defaultInitialMaxImportAsOverallProductionFactor, pNewArray);
00097   }
00098 
00099   public double getGrowthOfMaxImport() {
00100     return growthOfMaxImport;
00101   }
00102 
00103   public void setGrowthOfMaxImport(double pGrowthOfMaxImport) {
00104     growthOfMaxImport = pGrowthOfMaxImport;
00105   }
00106 
00107   public double getDefaultInitialMaxExportAsOverallProductionFactor() {
00108     return ArrayTools.allElementsHaveSameValue(initialMaxExportAsOverallProductionFactorArray);
00109   }
00110 
00111   public void setDefaultInitialMaxExportAsOverallProductionFactor(double pNewValue) {
00112     defaultInitialMaxExportAsOverallProductionFactor = pNewValue;
00113     initialMaxExportAsOverallProductionFactorArray = createArray(pNewValue);
00114   }
00115 
00116   public double[] getInitialMaxExportAsOverallProductionFactorArray() {
00117     return initialMaxExportAsOverallProductionFactorArray;
00118   }
00119 
00120   public void setInitialMaxExportAsOverallProductionFactorArray(double[] pNewArray) {
00121     initialMaxExportAsOverallProductionFactorArray = pNewArray;
00122     defaultInitialMaxExportAsOverallProductionFactor =
00123       checkForDefault(defaultInitialMaxExportAsOverallProductionFactor, pNewArray);
00124   }
00125 
00126   public double getGrowthOfMaxExport() {
00127     return growthOfMaxExport;
00128   }
00129 
00130   public void setGrowthOfMaxExport(double pGrowthOfMaxExport) {
00131     growthOfMaxExport = pGrowthOfMaxExport;
00132   }
00133 
00134   public double getObservedSuppliersQuotient() {
00135     return observedSuppliersQuotient;
00136   }
00137 
00138   public void setObservedSuppliersQuotient(double pNumObservedSuppliers) {
00139     observedSuppliersQuotient = pNumObservedSuppliers;
00140   }
00141 
00142   @Override
00143   public String[] getSectorNames() {
00144     return Foundation.getInitValues().sectorInitValues().getSectorNames();
00145   }
00146 }
00147 
00149 // EOF

Generated on Tue Sep 14 11:11:48 2010 for lagom_generiC by  doxygen 1.5.4