DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
SQLiteOutputStorage Class Reference

#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< VesselDefTablegetVesselDefTable () const
 
std::shared_ptr< VesselsLoglikeTablegetVesselLoglikeTable () const
 
std::shared_ptr< VesselVmsLikeTablegetVesselVmsLikeTable () const
 
std::shared_ptr< VesselVmsLikeFPingsOnlyTablegetVesselVmsLikeFPingsOnlyTable () const
 
std::shared_ptr< NodesDefTablegetNodesDefTable () const
 
std::shared_ptr< NodesEnvtTablegetNodesEnvtTable () const
 
std::shared_ptr< NodesStatTablegetNodesStatTable () const
 
std::shared_ptr< NodesTariffStatTablegetNodesTariffStatTable () const
 
std::shared_ptr< PopTablegetPopTable () const
 
std::shared_ptr< FuncGroupsTablegetFuncGroupsTable () const
 
std::shared_ptr< WindfarmsTablegetWindfarmTable () const
 
std::shared_ptr< FishFarmsDefTablegetFishfarmDefTable () const
 
std::shared_ptr< MetadataTablemetadata () 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 ()
 

Member Enumeration Documentation

◆ Operation

Enumerator
Sum 
Average 
Count 

Constructor & Destructor Documentation

◆ SQLiteOutputStorage()

SQLiteOutputStorage::SQLiteOutputStorage ( std::string  path)
explicit

◆ ~SQLiteOutputStorage()

SQLiteOutputStorage::~SQLiteOutputStorage ( )
defaultnoexcept

Member Function Documentation

◆ close()

void SQLiteOutputStorage::close ( )

Get the current db version number from the metadata table.

◆ createAllIndexes()

void SQLiteOutputStorage::createAllIndexes ( )

◆ createAllTables()

void SQLiteOutputStorage::createAllTables ( )

◆ currentSchemaNumber()

int SQLiteOutputStorage::currentSchemaNumber ( )

◆ endDayLoop()

void SQLiteOutputStorage::endDayLoop ( )

◆ exportCalendar()

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 
)

◆ exportEnvtNodes()

void SQLiteOutputStorage::exportEnvtNodes ( int  tstep,
Node node 
)

◆ exportFishfarmDef()

void SQLiteOutputStorage::exportFishfarmDef ( const Fishfarm fishfarm)

◆ exportFishfarmLog()

void SQLiteOutputStorage::exportFishfarmLog ( Fishfarm fishfarm,
int  tstep 
)

◆ exportLogLike()

void SQLiteOutputStorage::exportLogLike ( Vessel v,
const std::vector< double > &  populations,
const std::vector< double > &  discards,
unsigned int  tstep 
)

◆ exportPopNodes()

void SQLiteOutputStorage::exportPopNodes ( int  tstep,
Node node 
)

◆ exportPopQuotas()

void SQLiteOutputStorage::exportPopQuotas ( Population pop,
int  popid,
int  tstep 
)

◆ exportPopStat()

void SQLiteOutputStorage::exportPopStat ( Population pop,
int  popid,
int  tstep 
)

◆ exportShip()

void SQLiteOutputStorage::exportShip ( int  tstep,
Ship ship 
)

◆ exportTariffNodes()

void SQLiteOutputStorage::exportTariffNodes ( int  tstep,
Node node 
)

◆ exportWindmillsLog()

void SQLiteOutputStorage::exportWindmillsLog ( Windmill windmill,
int  tstep 
)

◆ getBenthosStatData()

TimelineData SQLiteOutputStorage::getBenthosStatData ( displace::plot::BenthosStat  stattype,
displace::plot::AggregationType  aggtype,
int  grpid,
const std::vector< int > &  btype 
)

◆ getDb()

std::shared_ptr< SQLiteStorage > SQLiteOutputStorage::getDb ( ) const

◆ getFishfarmDefTable()

std::shared_ptr< FishFarmsDefTable > SQLiteOutputStorage::getFishfarmDefTable ( ) const

◆ getFishFarmStatData()

TimelineData SQLiteOutputStorage::getFishFarmStatData ( displace::plot::FishfarmsStat  stattype,
displace::plot::AggregationType  aggtype,
int  ffid,
std::vector< int >  ftypes 
)

◆ getFuncGroupsTable()

std::shared_ptr< FuncGroupsTable > SQLiteOutputStorage::getFuncGroupsTable ( ) const

◆ getNationsList()

std::vector< std::string > SQLiteOutputStorage::getNationsList ( )

◆ getNbPops()

size_t SQLiteOutputStorage::getNbPops ( )

◆ getNodesDefTable()

std::shared_ptr< NodesDefTable > SQLiteOutputStorage::getNodesDefTable ( ) const

◆ getNodesEnvtTable()

std::shared_ptr< NodesEnvtTable > SQLiteOutputStorage::getNodesEnvtTable ( ) const

◆ getNodesStatTable()

std::shared_ptr< NodesStatTable > SQLiteOutputStorage::getNodesStatTable ( ) const

◆ getNodesTariffStatTable()

std::shared_ptr< NodesTariffStatTable > SQLiteOutputStorage::getNodesTariffStatTable ( ) const

◆ getPopTable()

std::shared_ptr< PopTable > SQLiteOutputStorage::getPopTable ( ) const

◆ getPopulationsList()

std::vector<std::string> SQLiteOutputStorage::getPopulationsList ( )

◆ getPopulationStatData()

TimelineData SQLiteOutputStorage::getPopulationStatData ( displace::plot::PopulationStat  stat,
displace::plot::AggregationType  aggtype,
int  popid,
std::vector< int >  szid 
)

◆ getShipsStatData()

TimelineData SQLiteOutputStorage::getShipsStatData ( displace::plot::ShipsStat  stattype,
displace::plot::AggregationType  aggtype,
int  shipid,
std::vector< int >  shiptypeid 
)

◆ getVesselDefTable()

std::shared_ptr< VesselDefTable > SQLiteOutputStorage::getVesselDefTable ( ) const

◆ getVesselLoglikeDataByHarbour()

TimelineData SQLiteOutputStorage::getVesselLoglikeDataByHarbour ( displace::plot::HarboursStat  stattype,
int  harbourid,
Operation  op 
)

◆ getVesselLoglikeDataByMetier()

TimelineData SQLiteOutputStorage::getVesselLoglikeDataByMetier ( displace::plot::MetiersStat  stattype,
int  metierid,
Operation  op 
)

◆ getVesselLoglikeDataByNation()

TimelineData SQLiteOutputStorage::getVesselLoglikeDataByNation ( displace::plot::NationsStat  stattype,
std::string  nation,
Operation  op 
)

◆ getVesselLoglikeDataByVessel()

TimelineData SQLiteOutputStorage::getVesselLoglikeDataByVessel ( displace::plot::VesselsStat  stattype,
std::string  vessel,
Operation  op 
)

◆ getVesselLoglikeTable()

std::shared_ptr< VesselsLoglikeTable > SQLiteOutputStorage::getVesselLoglikeTable ( ) const

◆ getVesselVmsLikeFPingsOnlyTable()

std::shared_ptr< VesselVmsLikeFPingsOnlyTable > SQLiteOutputStorage::getVesselVmsLikeFPingsOnlyTable ( ) const

◆ getVesselVmsLikeTable()

std::shared_ptr< VesselVmsLikeTable > SQLiteOutputStorage::getVesselVmsLikeTable ( ) const

◆ getWindfarmTable()

std::shared_ptr< WindfarmsTable > SQLiteOutputStorage::getWindfarmTable ( ) const

◆ importCalendar()

void SQLiteOutputStorage::importCalendar ( std::vector< int > &  tsteps_months,
std::vector< int > &  tsteps_quarters,
std::vector< int > &  tsteps_semesters,
std::vector< int > &  tsteps_years 
)

◆ isOutdated()

bool SQLiteOutputStorage::isOutdated ( )
inline

◆ metadata()

std::shared_ptr< MetadataTable > SQLiteOutputStorage::metadata ( ) const

◆ open()

void SQLiteOutputStorage::open ( )

◆ startDayLoop()

void SQLiteOutputStorage::startDayLoop ( )

◆ versionNumber()

int SQLiteOutputStorage::versionNumber ( )

Get the current supported db version number schema.


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