Class dimension_checker

Class Documentation

class dimension_checker

Checker to verify and, if necessary, change the passed dimensions to be even multiples of the arena map resolution. This is necessary for LOTS of different calculations to be correct at runtime, including:

  • Cache placement

  • Block placement

Public Static Functions

static rmath::vector2d even_multiple(const rtypes::discretize_ratio &res, const rmath::vector2d &to_check)

Check the spatial dimensions that a class wants to use to create objects with, and modify it if necessary so that it is an even multiple of the grid size.

static rspatial::euclidean_dist even_multiple(const rtypes::discretize_ratio &res, const rspatial::euclidean_dist &to_check)
static rmath::vector2d odd_dsize(const rtypes::discretize_ratio &res, const rmath::vector2d &to_check)

Check the dimension that a class wants to use to create objects with, and modify it if necessary so that the created objects have an odd # cells in X,Y, so that they have a uniquely defined discrete center.

Note

This function does NOT call resolution() before possibly shrinking the size of the dimension.

static rspatial::euclidean_dist odd_dsize(const rtypes::discretize_ratio &res, const rspatial::euclidean_dist &to_check)