MalariaSentinel — C++ reference
The contract-defining headers of the ABM engine
Loading...
Searching...
No Matches
mal_abm_fast::HabitatEngine Class Reference

#include <habitat_engine.hpp>

Public Member Functions

void load_from_gpkg (const std::string &path, const AOI &aoi)
const std::vector< HabitatPatch > & patches () const
const HabitatPatch & patch_by_id (int64_t pid) const

Detailed Description

Reader of the candidate habitat-patch census: loads the single-layer OGR Point gpkg emitted by ingest and keeps the patches that pass the candidate-potential floor, indexed for O(1) lookup by patch_id.

Member Function Documentation

◆ load_from_gpkg()

void mal_abm_fast::HabitatEngine::load_from_gpkg ( const std::string & path,
const AOI & aoi )

Read the candidate-patch gpkg from path and populate patches_. Each row becomes a HabitatPatch (see wire.hpp). Throws std::runtime_error if the OGR driver fails or the layer is missing.

◆ patch_by_id()

const HabitatPatch & mal_abm_fast::HabitatEngine::patch_by_id ( int64_t pid) const

O(1) lookup by patch_id (the gpkg's sequential index, 0-based). Throws std::out_of_range if the id is not present.

◆ patches()

const std::vector< HabitatPatch > & mal_abm_fast::HabitatEngine::patches ( ) const
inline

Patches loaded from the gpkg. May be empty if the gpkg was absent (the union then comes from the static env planes).


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