FIMS  v0.10.0
Loading...
Searching...
No Matches
fims_popdy::SizeGridBuilder Struct Reference

Helper for constructing internally consistent population size grids. More...

#include <size_grid_builder.hpp>

Static Public Member Functions

static SizeGrid BuildFromEdges (const fims::Vector< double > &edges)
 Build a size grid from an explicit vector of bin edges.
 
static SizeGrid BuildRegularGrid (double lower_edge, double upper_edge, double bin_width)
 Build a regular size grid from lower edge, upper edge, and bin width.
 
static fims::Vector< double > BuildObservationEdgesFromCenters (const fims::Vector< double > &centers)
 Build one fleet observation-bin edge vector from stored bin centers.
 
static SizeGrid BuildDefaultFromFleetEdges (const fims::Vector< fims::Vector< double > > &fleet_edges)
 Build the default population biological size grid from resolved fleet observation-bin edges.
 

Detailed Description

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.

Member Function Documentation

◆ BuildDefaultFromFleetEdges()

static SizeGrid fims_popdy::SizeGridBuilder::BuildDefaultFromFleetEdges ( const fims::Vector< fims::Vector< double > > &  fleet_edges)
inlinestatic

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_edgesResolved fleet observation-bin edge vectors.
Returns
Internally consistent default population biological size grid.

◆ BuildFromEdges()

static SizeGrid fims_popdy::SizeGridBuilder::BuildFromEdges ( const fims::Vector< double > &  edges)
inlinestatic

Build a size grid from an explicit vector of bin edges.

Parameters
edgesBiological size-bin edges on the natural scale.
Returns
Internally consistent population size grid.

◆ BuildObservationEdgesFromCenters()

static fims::Vector< double > fims_popdy::SizeGridBuilder::BuildObservationEdgesFromCenters ( const fims::Vector< double > &  centers)
inlinestatic

Build one fleet observation-bin edge vector from stored bin centers.

For multiple centers, edges are inferred from adjacent midpoints. A single center is not enough information to infer observation-bin geometry consistently, so this helper requires at least 2 strictly increasing centers.

Parameters
centersFleet observation-bin centers.
Returns
Strictly increasing observation-bin edges inferred from the centers.

◆ BuildRegularGrid()

static 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_edgeLower edge of the first biological size bin.
upper_edgeUpper edge of the final biological size bin.
bin_widthWidth of each biological size bin.
Returns
Internally consistent population size grid.

The documentation for this struct was generated from the following file: