Helper for constructing internally consistent population size grids.
More...
#include <size_grid_builder.hpp>
Helper for constructing internally consistent population size grids.
This builder centralizes grid creation so bin edges, centers, and dimensions are created once in a consistent way.
◆ BuildDefaultFromFleetEdges()
Build the default population biological size grid from resolved fleet observation-bin edges.
The default rule uses the minimum fleet lower edge and maximum fleet upper edge across the supplied fleet edge vectors to define the supported range. It then builds fixed-width regular biological bins with built-in width 1.0 in the same size units used by the user-supplied data until that regular-bin sequence covers the supported range. The built-in width is one size-data unit, but the resulting biological-bin edges are anchored to the minimum resolved fleet lower edge and therefore are not required to fall on integer-valued boundaries. Finally, it appends one additional terminal bin above the last regular bin so the final biological bin can serve as the plus-group representation.
- Parameters
-
| fleet_edges | Resolved fleet observation-bin edge vectors. |
- Returns
- Internally consistent default population biological size grid.
◆ BuildFromEdges()
Build a size grid from an explicit vector of bin edges.
- Parameters
-
| edges | Biological size-bin edges on the natural scale. |
- Returns
- Internally consistent population size grid.
◆ BuildObservationEdgesFromLowerEdges()
| fims::Vector< double > fims_popdy::SizeGridBuilder::BuildObservationEdgesFromLowerEdges |
( |
const fims::Vector< double > & | lower_edges | ) |
|
|
inlinestatic |
Build one fleet observation-bin edge vector from stored bin lower edges.
Fleet lengths are the lower edge of each observation bin, as in SS3 and WHAM. The edges are those values plus 1 upper edge for the last bin, which gets the same width as the bin before it. The first and last bins are open-ended when the population grid is mapped onto them, so they act as minus and plus groups. That upper edge only sets the range of the default population grid and the representative length of the last bin. At least 2 strictly increasing lower edges are required because 1 value gives no bin width.
- Parameters
-
| lower_edges | Fleet observation-bin lower edges. |
- Returns
- Strictly increasing observation-bin edges, 1 longer than lower_edges.
◆ BuildRegularGrid()
| SizeGrid fims_popdy::SizeGridBuilder::BuildRegularGrid |
( |
double | lower_edge, |
|
|
double | upper_edge, |
|
|
double | bin_width ) |
|
inlinestatic |
Build a regular size grid from lower edge, upper edge, and bin width.
- Parameters
-
| lower_edge | Lower edge of the first biological size bin. |
| upper_edge | Upper edge of the final biological size bin. |
| bin_width | Width of each biological size bin. |
- Returns
- Internally consistent population size grid.
The documentation for this struct was generated from the following file: