DISPLACE
1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
|
#include <sqliteoutputstorage.h>
Classes | |
struct | Impl |
Public Types | |
enum | Operation { Sum, Average, Count } |
Public Member Functions | |
SQLiteOutputStorage (std::string path) | |
~SQLiteOutputStorage () noexcept | |
void | open () |
void | close () |
Get the current db version number from the metadata table. More... | |
int | versionNumber () |
Get the current supported db version number schema. More... | |
int | currentSchemaNumber () |
bool | isOutdated () |
void | startDayLoop () |
void | endDayLoop () |
void | createAllTables () |
void | createAllIndexes () |
std::shared_ptr< VesselDefTable > | getVesselDefTable () const |
std::shared_ptr< VesselsLoglikeTable > | getVesselLoglikeTable () const |
std::shared_ptr< VesselVmsLikeTable > | getVesselVmsLikeTable () const |
std::shared_ptr< VesselVmsLikeFPingsOnlyTable > | getVesselVmsLikeFPingsOnlyTable () const |
std::shared_ptr< NodesDefTable > | getNodesDefTable () const |
std::shared_ptr< NodesEnvtTable > | getNodesEnvtTable () const |
std::shared_ptr< NodesStatTable > | getNodesStatTable () const |
std::shared_ptr< NodesTariffStatTable > | getNodesTariffStatTable () const |
std::shared_ptr< PopTable > | getPopTable () const |
std::shared_ptr< FuncGroupsTable > | getFuncGroupsTable () const |
std::shared_ptr< WindfarmsTable > | getWindfarmTable () const |
std::shared_ptr< FishFarmsDefTable > | getFishfarmDefTable () const |
std::shared_ptr< MetadataTable > | metadata () const |
std::shared_ptr< sqlite::SQLiteStorage > | getDb () const |
void | exportFishfarmDef (const Fishfarm &fishfarm) |
void | exportFishfarmLog (Fishfarm *fishfarm, int tstep) |
void | exportWindmillsLog (Windmill *windmill, int tstep) |
void | exportPopNodes (int tstep, Node *node) |
void | exportEnvtNodes (int tstep, Node *node) |
void | exportTariffNodes (int tstep, Node *node) |
void | exportPopStat (Population *pop, int popid, int tstep) |
void | exportPopQuotas (Population *pop, int popid, int tstep) |
void | exportLogLike (Vessel *v, const std::vector< double > &populations, const std::vector< double > &discards, unsigned int tstep) |
void | exportCalendar (const std::vector< int > &tsteps_months, const std::vector< int > &tsteps_quarters, const std::vector< int > &tsteps_semesters, const std::vector< int > &tsteps_years) |
void | exportShip (int tstep, Ship *ship) |
void | importCalendar (std::vector< int > &tsteps_months, std::vector< int > &tsteps_quarters, std::vector< int > &tsteps_semesters, std::vector< int > &tsteps_years) |
TimelineData | getVesselLoglikeDataByNation (displace::plot::NationsStat stattype, std::string nation, Operation op) |
TimelineData | getVesselLoglikeDataByVessel (displace::plot::VesselsStat stattype, std::string vessel, Operation op) |
TimelineData | getVesselLoglikeDataByHarbour (displace::plot::HarboursStat stattype, int harbourid, Operation op) |
TimelineData | getVesselLoglikeDataByMetier (displace::plot::MetiersStat stattype, int metierid, Operation op) |
TimelineData | getPopulationStatData (displace::plot::PopulationStat stat, displace::plot::AggregationType aggtype, int popid, std::vector< int > szid) |
TimelineData | getBenthosStatData (displace::plot::BenthosStat stattype, displace::plot::AggregationType aggtype, int grpid, const std::vector< int > &btype) |
TimelineData | getShipsStatData (displace::plot::ShipsStat stattype, displace::plot::AggregationType aggtype, int shipid, std::vector< int > shiptypeid) |
TimelineData | getFishFarmStatData (displace::plot::FishfarmsStat stattype, displace::plot::AggregationType aggtype, int ffid, std::vector< int > ftypes) |
size_t | getNbPops () |
std::vector< std::string > | getNationsList () |
std::vector< std::string > | getPopulationsList () |
|
explicit |
|
defaultnoexcept |
void SQLiteOutputStorage::close | ( | ) |
Get the current db version number from the metadata table.
void SQLiteOutputStorage::createAllIndexes | ( | ) |
void SQLiteOutputStorage::createAllTables | ( | ) |
int SQLiteOutputStorage::currentSchemaNumber | ( | ) |
void SQLiteOutputStorage::endDayLoop | ( | ) |
void SQLiteOutputStorage::exportCalendar | ( | const std::vector< int > & | tsteps_months, |
const std::vector< int > & | tsteps_quarters, | ||
const std::vector< int > & | tsteps_semesters, | ||
const std::vector< int > & | tsteps_years | ||
) |
void SQLiteOutputStorage::exportEnvtNodes | ( | int | tstep, |
Node * | node | ||
) |
void SQLiteOutputStorage::exportFishfarmDef | ( | const Fishfarm & | fishfarm | ) |
void SQLiteOutputStorage::exportFishfarmLog | ( | Fishfarm * | fishfarm, |
int | tstep | ||
) |
void SQLiteOutputStorage::exportLogLike | ( | Vessel * | v, |
const std::vector< double > & | populations, | ||
const std::vector< double > & | discards, | ||
unsigned int | tstep | ||
) |
void SQLiteOutputStorage::exportPopNodes | ( | int | tstep, |
Node * | node | ||
) |
void SQLiteOutputStorage::exportPopQuotas | ( | Population * | pop, |
int | popid, | ||
int | tstep | ||
) |
void SQLiteOutputStorage::exportPopStat | ( | Population * | pop, |
int | popid, | ||
int | tstep | ||
) |
void SQLiteOutputStorage::exportShip | ( | int | tstep, |
Ship * | ship | ||
) |
void SQLiteOutputStorage::exportTariffNodes | ( | int | tstep, |
Node * | node | ||
) |
void SQLiteOutputStorage::exportWindmillsLog | ( | Windmill * | windmill, |
int | tstep | ||
) |
TimelineData SQLiteOutputStorage::getBenthosStatData | ( | displace::plot::BenthosStat | stattype, |
displace::plot::AggregationType | aggtype, | ||
int | grpid, | ||
const std::vector< int > & | btype | ||
) |
std::shared_ptr< SQLiteStorage > SQLiteOutputStorage::getDb | ( | ) | const |
std::shared_ptr< FishFarmsDefTable > SQLiteOutputStorage::getFishfarmDefTable | ( | ) | const |
TimelineData SQLiteOutputStorage::getFishFarmStatData | ( | displace::plot::FishfarmsStat | stattype, |
displace::plot::AggregationType | aggtype, | ||
int | ffid, | ||
std::vector< int > | ftypes | ||
) |
std::shared_ptr< FuncGroupsTable > SQLiteOutputStorage::getFuncGroupsTable | ( | ) | const |
std::vector< std::string > SQLiteOutputStorage::getNationsList | ( | ) |
size_t SQLiteOutputStorage::getNbPops | ( | ) |
std::shared_ptr< NodesDefTable > SQLiteOutputStorage::getNodesDefTable | ( | ) | const |
std::shared_ptr< NodesEnvtTable > SQLiteOutputStorage::getNodesEnvtTable | ( | ) | const |
std::shared_ptr< NodesStatTable > SQLiteOutputStorage::getNodesStatTable | ( | ) | const |
std::shared_ptr< NodesTariffStatTable > SQLiteOutputStorage::getNodesTariffStatTable | ( | ) | const |
std::shared_ptr< PopTable > SQLiteOutputStorage::getPopTable | ( | ) | const |
std::vector<std::string> SQLiteOutputStorage::getPopulationsList | ( | ) |
TimelineData SQLiteOutputStorage::getPopulationStatData | ( | displace::plot::PopulationStat | stat, |
displace::plot::AggregationType | aggtype, | ||
int | popid, | ||
std::vector< int > | szid | ||
) |
TimelineData SQLiteOutputStorage::getShipsStatData | ( | displace::plot::ShipsStat | stattype, |
displace::plot::AggregationType | aggtype, | ||
int | shipid, | ||
std::vector< int > | shiptypeid | ||
) |
std::shared_ptr< VesselDefTable > SQLiteOutputStorage::getVesselDefTable | ( | ) | const |
TimelineData SQLiteOutputStorage::getVesselLoglikeDataByHarbour | ( | displace::plot::HarboursStat | stattype, |
int | harbourid, | ||
Operation | op | ||
) |
TimelineData SQLiteOutputStorage::getVesselLoglikeDataByMetier | ( | displace::plot::MetiersStat | stattype, |
int | metierid, | ||
Operation | op | ||
) |
TimelineData SQLiteOutputStorage::getVesselLoglikeDataByNation | ( | displace::plot::NationsStat | stattype, |
std::string | nation, | ||
Operation | op | ||
) |
TimelineData SQLiteOutputStorage::getVesselLoglikeDataByVessel | ( | displace::plot::VesselsStat | stattype, |
std::string | vessel, | ||
Operation | op | ||
) |
std::shared_ptr< VesselsLoglikeTable > SQLiteOutputStorage::getVesselLoglikeTable | ( | ) | const |
std::shared_ptr< VesselVmsLikeFPingsOnlyTable > SQLiteOutputStorage::getVesselVmsLikeFPingsOnlyTable | ( | ) | const |
std::shared_ptr< VesselVmsLikeTable > SQLiteOutputStorage::getVesselVmsLikeTable | ( | ) | const |
std::shared_ptr< WindfarmsTable > SQLiteOutputStorage::getWindfarmTable | ( | ) | const |
void SQLiteOutputStorage::importCalendar | ( | std::vector< int > & | tsteps_months, |
std::vector< int > & | tsteps_quarters, | ||
std::vector< int > & | tsteps_semesters, | ||
std::vector< int > & | tsteps_years | ||
) |
|
inline |
std::shared_ptr< MetadataTable > SQLiteOutputStorage::metadata | ( | ) | const |
void SQLiteOutputStorage::open | ( | ) |
void SQLiteOutputStorage::startDayLoop | ( | ) |
int SQLiteOutputStorage::versionNumber | ( | ) |
Get the current supported db version number schema.