Class IntercroppingFunctions
java.lang.Object
net.simplace.sim.components.experimental.intercropping.IntercroppingFunctions
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionBelowgroundAllocationFactors
(Double[] r1, Double[] r2) Calculates belowground allocation factors from given root information per layer of two plants Root information can be root length density per layer or root restriction factor or any information that reflects root uptake capacity.static double
calcInterceptionFractionOneCrop
(double width_strip, double width_path, double k, double lai, double height) Calculates radiation fraction that is intercepted by the crop if only one crop is presentstatic Double[]
calcInterceptionFractions
(double width_1, double space_1, double k_1, double lai_1, double height_1, double width_2, double space_2, double k_2, double lai_2, double height_2) Calculates radiation interception fractions for two cropsstatic Double[]
calcInterceptionFractionsSorted
(double width_1, double space_1, double k_1, double lai_1, double height_1, double width_2, double space_2, double k_2, double lai_2, double height_2) Calculates radiation interception for two crops where height of first crop is bigger than of secondstatic Double[][]
calcRowAndColSums
(Double[][] m) Calculates sum of rows, cols and total of a 2-dimensional arraystatic double
calcSoilInterceptionFractionPath
(double width_strip, double width_path, double k, double lai, double height) Calculates radiation fraction that is intercepted by the soilstatic double
calcSoilInterceptionFractionStrip
(double width_strip, double width_path, double k, double lai, double height) Calculates radiation fraction that is intercepted by the cropstatic double
calcViewFactor
(double height, double width) Calculates view factorstatic Double[][][]
calcWeightsMatrix
(Double[][] m) Divides the elements of a matrix by its total sum and calculates row- and colsums.static Double[]
getColSums
(Double[][] sums) Retrieves the colums calculated by calcRowAndColSumsstatic Double[]
getRowSums
(Double[][] sums) Retrieves the rowsums calculated by calcRowAndColSumsstatic Double
getTotalSum
(Double[][] sums) Retrieves the total sum calculated by calcRowAndColSumsstatic Double[]
getWeightsColsum
(Double[][][] weights) Retrieves the colsums for a weight matrixstatic Double[][]
getWeightsMatrix
(Double[][][] weights) Retrieves the weights matrixstatic Double[]
getWeightsMatrixRow
(Double[][][] weights, int row) Retrieves a specific row from the weights matrixstatic Double[]
getWeightsRowsum
(Double[][][] weights) Retrieves the rowsums for a weight matrix
-
Constructor Details
-
IntercroppingFunctions
public IntercroppingFunctions()
-
-
Method Details
-
calcRowAndColSums
Calculates sum of rows, cols and total of a 2-dimensional array- Parameters:
m
- 2-dimensional Array (1st index rows, 2nd index cols)- Returns:
- Array of rowsums, colsums and total sum
-
getRowSums
Retrieves the rowsums calculated by calcRowAndColSums- Parameters:
sums
- Array of rowsums, colsums and total sum- Returns:
- Array of rowsums
- See Also:
-
getColSums
Retrieves the colums calculated by calcRowAndColSums- Parameters:
sums
- Array of rowsums, colsums and total sum- Returns:
- Array of colsums
- See Also:
-
getTotalSum
Retrieves the total sum calculated by calcRowAndColSums- Parameters:
sums
- Array of rowsums, colsums and total sum- Returns:
- total sum
- See Also:
-
calcWeightsMatrix
Divides the elements of a matrix by its total sum and calculates row- and colsums.- Parameters:
m
- 2-dimensional Array- Returns:
- weights matrix as well as weighted rowsums and colsums
- See Also:
-
getWeightsMatrix
Retrieves the weights matrix- Parameters:
weights
- as calculated by calcWeightsMatrix- Returns:
- the 2-dimensional weighted matrix
-
getWeightsMatrixRow
Retrieves a specific row from the weights matrix- Parameters:
weights
- as calculated by calcWeightsMatrixrow
- number of the row to retrieve- Returns:
- a row from the weighted matrix
- See Also:
-
getWeightsRowsum
Retrieves the rowsums for a weight matrix- Parameters:
weights
- as calculated by calcWeightsMatrix- Returns:
- an 1-dimensional Array with sums for each row
-
getWeightsColsum
Retrieves the colsums for a weight matrix- Parameters:
weights
- as calculated by calcWeightsMatrix- Returns:
- an 1-dimensional Array with sums for each column
-
BelowgroundAllocationFactors
public static IntercroppingFunctions.BelowGroundAllocationFactorsResult BelowgroundAllocationFactors(Double[] r1, Double[] r2) Calculates belowground allocation factors from given root information per layer of two plants Root information can be root length density per layer or root restriction factor or any information that reflects root uptake capacity.- Parameters:
r1
- root information of plant 1r2
- root information of plant 2- Returns:
- factors per layer as well as total factor for each plant
-
calcViewFactor
public static double calcViewFactor(double height, double width) Calculates view factor- Parameters:
height
-width
-- Returns:
- view factor
-
calcSoilInterceptionFractionPath
public static double calcSoilInterceptionFractionPath(double width_strip, double width_path, double k, double lai, double height) Calculates radiation fraction that is intercepted by the soil- Parameters:
width_strip
- Width of stripwidth_path
- Width of pathk
- Extinction coefficientlai
- Leaf area indexheight
- Height of crop- Returns:
- fraction intercepted by the soil
-
calcSoilInterceptionFractionStrip
public static double calcSoilInterceptionFractionStrip(double width_strip, double width_path, double k, double lai, double height) Calculates radiation fraction that is intercepted by the crop- Parameters:
width_strip
- Width of stripwidth_path
- Width of pathk
- Extinction coefficientlai
- Leaf area indexheight
- Height of crop- Returns:
- fraction intercepted by the crop
-
calcInterceptionFractionOneCrop
public static double calcInterceptionFractionOneCrop(double width_strip, double width_path, double k, double lai, double height) Calculates radiation fraction that is intercepted by the crop if only one crop is present- Parameters:
width_strip
- Width of stripwidth_path
- Width of pathk
- Extinction coefficientlai
- Leaf area indexheight
- Height of crop- Returns:
- fraction intercepted by the crop
-
calcInterceptionFractionsSorted
public static Double[] calcInterceptionFractionsSorted(double width_1, double space_1, double k_1, double lai_1, double height_1, double width_2, double space_2, double k_2, double lai_2, double height_2) Calculates radiation interception for two crops where height of first crop is bigger than of second- Parameters:
width_1
- Width of first crop's stripspace_1
- Space of first cropk_1
- Extinction coefficient of first croplai_1
- LAI of first cropheight_1
- Height of first cropwidth_2
- Width of second crop's stripspace_2
- Space of second cropk_2
- Extinction coefficient of second croplai_2
- LAI of second cropheight_2
- Height of second crop- Returns:
- fractions as array with two entries
-
calcInterceptionFractions
public static Double[] calcInterceptionFractions(double width_1, double space_1, double k_1, double lai_1, double height_1, double width_2, double space_2, double k_2, double lai_2, double height_2) Calculates radiation interception fractions for two crops- Parameters:
width_1
- Width of first crop's stripspace_1
- Space of first cropk_1
- Extinction coefficient of first croplai_1
- LAI of first cropheight_1
- Height of first cropwidth_2
- Width of second crop's stripspace_2
- Space of second cropk_2
- Extinction coefficient of second croplai_2
- LAI of second cropheight_2
- Height of second crop- Returns:
- fractions as array with two entries
-