User Tools

Site Tools


documentation:numberable_change

The Numberable interface change from int to double

F. de Coligny - 24.8.2006

The original Numberable interface

This capsis.util.Numberable interface contains two accessors:

public int getNumber ();
public void setNumber (int n);

It is mainly used in the Capsis kernel trees description for distance-independent tree models :

public class GMaidTree implements Numberable

The subclasses of GMaidTree (ex: Pp3Tree in Maritime pine model) use this property to handle the number of trees in the dbh class they represent.

public class Pp3Tree extends GMaidTree

Till now, this number was an integer (int type).

The new Numberable interface

Some models need to manage a decimal number in their tree description. When the need first arised, modellers coped with the existing int number by using an Oversampling method. The numbers were multiplied by some value to have more accurate calculations despite of the int restriction. This method leads to more complexity and needed to be changed. The change has been done on 22th august 2006 to ease the integration of the NZ1 Radiata pine model.

The new Numberable interface:

public double getNumber ();
public void setNumber (double n);	// fc - 22.8.2006

Corrections have been done in all the impacted source files:

  • The modules using an integer number pass the integer in the double type without change, their functioning do not change.
  • The extensions using this number have been adapted to consider the double precision, including on graphics, curves, etc. (e.g.: capsis.extension.dataextractor.DETimeN).
  • The genetics library has been technicaly adapted to handle a double (24.8.2006).
  • On the adapted histogram extractors, a configuration property has been added: “N rounded to the nearest integer” to allow the same results than previously, particularly when using the “Per hectare” option which can produce decimal values.
  • Some extensions which compatibility is restricted to a particular module not using the number property may have not been adapted.
  • The NProvider interface has been adapted to handle a double, the method providers of the modules have also been upgraded.
  • The “NumberOfDead” property has not been changed, it is still an integer. This property may be replaced by the use of the statusMap in the GTCStand superclass to memorize the dead trees under the “dead” status (available for individual based models and also for diameter class models). The related method in GTCStand has been updated to manage a double:
public void storeStatus (Numberable tree, String status, 
        double numberUnderThisStatus) {

Here is the list of impacted files and source files:

AlsExport.java(Modified)
AlsMethodProvider.java(Modified)
AlsTree.java(Modified)
AlsTree1.java(Modified)
AlsTree2.java(Modified)
BidFish.java(Modified)
C2Thinner.java(Modified)
CaMethodProvider.java(Modified)
CaModel.java(Modified)
CaStand.java(Modified)
CytMethodProvider.java(Modified)
DEAgeClassN.java(Modified)
DEBarkBiomassDistrib.java(Modified)
DEBiomassDistrib.java(Modified)
DEConfigurationPanel.java(Modified)
DECrownBaseHeightDistrib.java(Modified)
DECrownRatioClassN.java(Modified)
DEDbhClassN.java(Modified)
DEDbhIncrementClassN.java(Modified)
DEDiamDistrib.java(Modified)
DEGirthClassN.java(Modified)
DEGirthDistrib.java(Modified)
DEGirthDistrib2.java(Modified)
DEHIncrementClassN.java(Modified)
DEHeightClassN.java(Modified)
DEInterceptionIndexClassN.java(Modified)
DELargeDbhClassN.java(Modified)
DELivingBranchBiomassDistrib.java(Modified)
DELogNLogMeanV.java(Modified)
DESlendernessClassN.java(Modified)
DESpeciesClassN.java(Modified)
DESpeciesClassN_en.properties(Modified)
DESpeciesClassN_fr.properties(Modified)
DEStemBiomassDistrib.java(Modified)
DETimeDbh.java(Modified)
DETimeGirth.java(Modified)
DETimeH.java(Modified)
DETimeInterceptionIndexRank.java(Modified)
DETimeN.java(Modified)
DETotalNeedleBiomassDistrib.java(Modified)
DEVolumeClassN.java(Modified)
DcTLCell.java(Modified)
DcTree.java(Modified)
DeltaGTreeEquation.java(Modified)
DynFish.java(Modified)

EptusCell.java(Modified)
EptusMethodProvider.java(Modified)
EptusSimpleThinner.java(Modified)
EptusTree.java(Modified)
FasyMethodProvider.java(Modified)
FasyStand.java(Modified)
FgMethodProvider.java(Modified)
FilterThinner.java(Modified)
FtaMethodProvider.java(Modified)
GFish.java(Modified)
GMaidTree.java(Modified)
GTCStand.java(Modified)
GeneticTools.java(Modified)
GeneticTree.java(Modified)
GeneticsGeneration.java(Modified)
Genotypable.java(Modified)
GupFish.java(Modified)
HistoThinner.java(Modified)
IncomeFunction.java(Modified)
IndividualThinner.java(Modified)
Labels_en.properties(Modified)
Labels_fr.properties(Modified)
LoxGrowDie.java(Modified)
LoxMethodProvider.java(Modified)
LoxTree.java(Modified)
LoxTree1.java(Modified)
LoxTree2.java(Modified)
LubExportG1.java(Modified)
LubExportG2.java(Modified)
LubMethodProvider.java(Modified)
LubTree.java(Modified)
LubTree1.java(Modified)
LubTree2.java(Modified)
MaddMethodProvider.java(Modified)
MaidHisto.java(Modified)
MaidMethodProvider.java(Modified)
ManMethodProvider.java(Modified)
Mode1.java(Modified)
Mode2.java(Modified)
MountMethodProvider.java(Modified)
NProvider.java(Modified)
NZ1MethodProvider.java(Modified)
NZ1Model.java(Modified)
NZ1Tree.java(Modified)
NrgMethodProvider.java(Modified)
Numberable.java(Modified)
PalMethodProvider.java(Modified)
PnlMethodProvider.java(Modified)
PnlStand.java(Modified)
PnnMethodProvider.java(Modified)
PnnStand.java(Modified)
Pp3MethodProvider.java(Modified)
Pp3Stand.java(Modified)
Pp3TreeTaperViewer.java(Modified)
PreMethodProvider.java(Modified)
PsyHeight.java(Modified)
PsyMethodProvider.java(Modified)
PsyModel.java(Modified)
PsyStand.java(Modified)
QsMethodProvider.java(Modified)
QsModel.java(Modified)
QsStand.java(Modified)
QuerMethodProvider.java(Modified)
QuerTree.java(Modified)
QuerTree1.java(Modified)
QuerTree2.java(Modified)
RdiThinner.java(Modified)
RegMethodProvider.java(Modified)
SVController.java(Modified)
SVEucalypt.java(Modified)
SVLox.java(Modified)
SVMaid.java(Modified)
SVNrg2.java(Modified)
SafeMethodProvider.java(Modified)
SamareMethodProvider.java(Modified)
SamsaMethodProvider.java(Modified)
SimInventory.java(Modified)
SimMethodProvider.java(Modified)
SimTree.java(Modified)
SysMethodProvider.java(Modified)
TransRegTree.java(Modified)
TransTree.java(Modified)
TreeTab.java(Modified)
ViewerToolKit.java(Modified)
VtgMethodProvider.java(Modified)
VtgRegeneration.java(Modified)
VtgTree.java(Modified)
VtxMethodProvider.java(Modified)

The following images shows the evolution of the decimal number of trees over time in the NZ1 model (under development) and the N over slenderness classes histogram.

documentation/numberable_change.txt · Last modified: 2021/12/13 09:28 by 127.0.0.1