DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
myutils.h File Reference
#include <commons_global.h>
#include <sparsepp/spp.h>
#include <vesselcalendar.h>
#include <idtypes.h>
#include <utils/MultifieldReader.h>
#include <vector>
#include <deque>
#include <map>
#include <list>
#include <set>
#include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <math.h>
#include <cstddef>
#include <pathshop.h>

Go to the source code of this file.

Classes

struct  splitX
 
struct  edge
 

Macros

#define __MYUTILS_H   (1)
 

Typedefs

typedef types::NodeId::type vertex_t
 
typedef int weight_t
 
typedef std::map< vertex_t, std::list< edge > > adjacency_map_t
 

Functions

template<double f>
double simpson (double a, double b, int n, double S1, double S2)
 
template<typename T >
vector< size_t > sort_indexes_ascending (const vector< T > &v)
 
template<typename T >
vector< size_t > sort_indexes_descending (const vector< T > &v)
 
double COMMONSSHARED_EXPORT trapezoidal (double a, double b, vector< double > sel)
 
double COMMONSSHARED_EXPORT myintegrand (double x, double S1, double S2)
 
template<typename T >
void remove_dups (vector< T > &seq)
 
void COMMONSSHARED_EXPORT remove_dups (vector< int > &seq)
 
multimap< int, int > COMMONSSHARED_EXPORT remove_dups (multimap< int, int > &original_map)
 
template<typename K , typename V >
multimap< K, V > remove_dups (multimap< K, V > &original_map)
 
multimap< int, int >::const_iterator COMMONSSHARED_EXPORT find_pair (const multimap< int, int > &map, const pair< int, int > &pair)
 
bool COMMONSSHARED_EXPORT insert_if_not_present (multimap< int, int > &map, const pair< int, int > &pair)
 
template<typename K , typename V >
multimap< K, V >::const_iterator find_pair (const multimap< K, V > &map, const pair< K, V > &pair)
 
template<typename K , typename V >
bool insert_if_not_present (multimap< K, V > &map, const pair< K, V > &pair)
 
template<typename Container >
Container & split (Container &result, const typename Container::value_type &s, const typename Container::value_type &delimiters, splitX::empties_t empties=splitX::empties_ok)
 
void COMMONSSHARED_EXPORT DijkstraComputePaths (vertex_t source, adjacency_map_t &adjacency_map, spp::sparse_hash_map< vertex_t, weight_t > &min_distance, spp::sparse_hash_map< vertex_t, vertex_t > &previous, std::vector< types::NodeId > relevant_nodes)
 
std::list< vertex_t > COMMONSSHARED_EXPORT DijkstraGetShortestPathTo (vertex_t target, spp::sparse_hash_map< vertex_t, vertex_t > &previous)
 
std::list< types::NodeId > COMMONSSHARED_EXPORT DijkstraGetShortestPathTo (types::NodeId target, const PathShop &pathshop)
 
void COMMONSSHARED_EXPORT SimplifyThePreviousMap (int source, spp::sparse_hash_map< vertex_t, vertex_t > &previous, std::vector< types::NodeId > &relevant_nodes, spp::sparse_hash_map< vertex_t, weight_t > &min_distance, string namesimu, string a_graph_name, string inputfolder)
 
void COMMONSSHARED_EXPORT closeSomeNodes (std::vector< int > &nodes_to_be_closed, adjacency_map_t &adjacency_map)
 
vector< double > COMMONSSHARED_EXPORT compute_distance_fgrounds (const vector< types::NodeId > &relevant_nodes, const std::vector< PathShop > &pathshops, types::NodeId from, vector< types::NodeId > grounds)
 
bool COMMONSSHARED_EXPORT fill_from_coord (istream &in, vector< double > &graph_coord_x, vector< double > &graph_coord_y, vector< int > &graph_coord_harbour, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_graph (istream &in, vector< int > &graph_idx_dep, vector< int > &graph_idx_arr, vector< int > &graph_dist_km, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_code_area (istream &in, vector< int > &graph_point_code_area, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_code_marine_landscape (istream &in, vector< int > &graph_point_code_landscape, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_wind (istream &in, vector< double > &graph_point_wind, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_sst (istream &in, vector< double > &graph_point_sst, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_salinity (istream &in, vector< double > &graph_point_salinity, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_Nitrogen (istream &in, vector< double > &graph_point_Nitrogen, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_Phosphorus (istream &in, vector< double > &graph_point_Phosphorus, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_Oxygen (istream &in, vector< double > &graph_point_Oxygen, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_DissolvedCarbon (istream &in, vector< double > &graph_point_DissolvedCarbon, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_bathymetry (istream &in, vector< double > &graph_point_bathymetry, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_shippingdensity (istream &in, vector< double > &graph_point_shippingdensity, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_siltfraction (istream &in, vector< double > &graph_point_siltfraction, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_benthos_biomass (istream &in, vector< double > &graph_point_benthos_biomass, int nrow)
 
bool COMMONSSHARED_EXPORT fill_from_benthos_number (istream &in, vector< double > &graph_point_benthos_number, int nrow)
 
bool COMMONSSHARED_EXPORT fill_in_growth_transition (istream &in, vector< vector< double > > &growth_transition)
 
bool COMMONSSHARED_EXPORT fill_in_species_interactions_mortality_proportion_matrix (istream &in, vector< vector< double > > &species_interactions_mortality_proportion_matrix)
 
bool COMMONSSHARED_EXPORT fill_in_preferences_for_species_matrix (istream &in, vector< vector< double > > &preferences_for_species_matrix)
 
bool COMMONSSHARED_EXPORT fill_in_selectivity_per_stock (istream &in, vector< vector< double > > &growth_transition)
 
bool COMMONSSHARED_EXPORT fill_in_percent_szgroup_per_age_matrix (istream &in, vector< vector< double > > &percent_szgroup_per_age_matrix)
 
bool COMMONSSHARED_EXPORT fill_in_percent_age_per_szgroup_matrix (istream &in, vector< vector< double > > &percent_age_per_szgroup_matrix)
 
bool COMMONSSHARED_EXPORT fill_in_param_sr (istream &in, vector< double > &param_sr)
 
bool COMMONSSHARED_EXPORT fill_in_initial_tac (istream &in, vector< double > &initial_tac)
 
bool COMMONSSHARED_EXPORT fill_in_fbar_ages_min_max (istream &in, vector< double > &fbar_ages_min_max)
 
bool COMMONSSHARED_EXPORT fill_from_metier_specifications (istream &in, multimap< string, double > &infos)
 
bool COMMONSSHARED_EXPORT fill_from_vessels_specifications (istream &in, vector< string > &names, vector< int > &vid_is_actives, vector< int > &vid_is_part_of_ref_fleets, vector< double > &speeds, vector< double > &fuelcons, vector< double > &lengths, vector< double > &vKWs, vector< double > &carrycapacities, vector< double > &tankcapacities, vector< double > &nbfpingspertrips, vector< double > &resttime_par1s, vector< double > &resttime_par2s, vector< double > &av_trip_duration, vector< double > &mult_fuelcons_when_steaming, vector< double > &mult_fuelcons_when_fishing, vector< double > &mult_fuelcons_when_returning, vector< double > &mult_fuelcons_when_inactive, vector< int > &firm_ids, vector< VesselCalendar > &calendars)
 
bool COMMONSSHARED_EXPORT fill_from_vessels_economic_specifications (istream &in, vector< double > &this_vessel_nb_crews, vector< double > &annual_other_incomes, vector< double > &landing_costs_percents, vector< double > &crewshare_and_unpaid_labour_costs_percents, vector< double > &other_variable_costs_per_unit_efforts, vector< double > &annual_insurance_costs_per_crews, vector< double > &standard_labour_hour_opportunity_costss, vector< double > &standard_annual_full_time_employement_hourss, vector< double > &other_annual_fixed_costss, vector< double > &vessel_values, vector< double > &annual_depreciation_rates, vector< double > &opportunity_interest_rates, vector< double > &annual_discount_rates)
 
bool COMMONSSHARED_EXPORT fill_from_ships_specifications (istream &in, vector< string > &names, vector< double > &imos, vector< double > &yearbuilds, vector< string > &flags, vector< string > &types, vector< double > &typecodes, vector< double > &loas, vector< double > &KWs, vector< double > &breadths, vector< double > &grosstonnages, vector< double > &nbunits, vector< double > &fueluse, vector< double > &NOxEmission_gperKWh, vector< double > &SOxEmission_percentpertotalfuelmass, vector< double > &GHGEmission, vector< double > &PMEmission, vector< double > &vmaxs, vector< double > &vcruises, vector< double > &lane_ids)
 
bool COMMONSSHARED_EXPORT fill_from_fishfarms_specifications (istream &in, vector< int > &fishfarms_ids, vector< string > &fishfarms_names, vector< int > &idx_nodes, vector< int > &is_actives, vector< double > &sizes, vector< double > &longs, vector< double > &lats, vector< double > &mean_SSTs, vector< double > &mean_salinities, vector< double > &mean_windspeeds, vector< double > &mean_currentspeeds, vector< double > &max_depths, vector< double > &diss_O2_mg_per_ls, vector< double > &Linf_mms, vector< double > &K_ys, vector< double > &t0_ys, vector< double > &fulton_condition_factors, vector< string > &meanw_growth_model_types, vector< int > &start_day_growings, vector< int > &end_day_harvests, vector< int > &nbyears_for_growths, vector< int > &nb_days_fallowing_periods, vector< int > &nb_fish_at_starts, vector< double > &meanw_at_starts, vector< double > &price_per_kg_at_starts, vector< double > &target_meanw_at_harvests, vector< int > &nb_fish_at_harvests, vector< double > &meanw_at_harvests, vector< double > &prop_harvest_kg_solds, vector< double > &kg_eggs_per_kgs, vector< double > &price_eggs_per_kgs, vector< double > &N_in_fish_kg_3pers, vector< double > &P_in_fish_kg_0_5pers, vector< string > &feed_types, vector< double > &feed_price_per_kgs, vector< double > &total_feed_kg, vector< double > &prop_N_in_feeds, vector< double > &prop_P_in_feeds, vector< double > &total_feed_N_kgs, vector< double > &total_feed_P_kgs, vector< string > &feed_type_vets, vector< double > &feed_vet_price_per_kgs, vector< double > &total_feed_vet_kgs, vector< double > &prop_N_in_feed_vets, vector< double > &prop_P_in_feed_vets, vector< double > &total_feed_vet_N_kgs, vector< double > &total_feed_vet_P_kgs, vector< double > &annual_discharge_N_kgs, vector< double > &annual_discharge_P_kgs, vector< double > &annual_discharge_C_kgs, vector< double > &annual_discharge_heavymetals_kgs, vector< double > &annual_discharge_medecine_kgs, vector< double > &net_harvest_kg_per_sqkm_ys, vector< double > &market_price_sold_fishs, vector< double > &operating_cost_per_days, vector< double > &annual_profits)
 
bool fill_from_firms_specifications (istream &in, vector< int > &firm_ids, vector< string > &firm_names, vector< int > &nb_vessels, vector< double > &longs, vector< double > &lats)
 
bool COMMONSSHARED_EXPORT fill_from_avai_nodes_with_pop (istream &in, map< int, double > &avai)
 
bool COMMONSSHARED_EXPORT fill_from_avai_szgroup_nodes_with_pop (istream &in, multimap< types::NodeId, double > &avai)
 
bool COMMONSSHARED_EXPORT fill_field_of_coeff_diffusion_this_pop (istream &in, multimap< types::NodeId, double > &coeffs)
 
bool COMMONSSHARED_EXPORT fill_from_oth_land (istream &in, map< types::NodeId, double > &oth_land)
 
bool COMMONSSHARED_EXPORT fill_from_overall_migration_fluxes (istream &in, multimap< int, double > &overall_migration_fluxes)
 
bool COMMONSSHARED_EXPORT fill_from_relative_stability (istream &in, map< string, double > &relative_stability)
 
bool COMMONSSHARED_EXPORT fill_from_nodes_in_polygons (istream &in, multimap< int, int > &nodes_in_polygons)
 
bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_s_i (istream &in, multimap< string, int > &infos)
 
bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_s_d (istream &in, multimap< string, double > &infos)
 
template<typename K , typename V >
bool fill_multimap_from_specifications (istream &in, multimap< K, V > &infos)
 
bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_i_s (istream &in, multimap< int, string > &infos)
 
bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_i_d (istream &in, multimap< int, double > &infos)
 fill in the vessel attributes into a multimap <integer, double>. First line is an heading. More...
 
bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_i_i (istream &in, multimap< int, int > &infos)
 
bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_i (istream &in, map< int, int > &a_map)
 
bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_s (istream &in, map< int, string > &a_map)
 
bool COMMONSSHARED_EXPORT fill_map_from_specifications_s_d (istream &in, map< string, double > &a_map)
 
template<typename DTYPE >
void fill_map_from_specifications (istream &in, map< int, DTYPE > &map)
 
template<typename K , typename V >
std::vector< V > find_entries (const std::multimap< K, V > &infos, K val)
 
vector< double > COMMONSSHARED_EXPORT find_entries_s_d (multimap< string, double > &infos, string str)
 
vector< int > COMMONSSHARED_EXPORT find_entries_s_i (multimap< string, int > &infos, string vid)
 
vector< double > COMMONSSHARED_EXPORT find_entries_i_d (const multimap< int, double > &infos, int intg)
 
vector< int > COMMONSSHARED_EXPORT find_entries_i_i (const multimap< int, int > &infos, int intg)
 
vector< string > COMMONSSHARED_EXPORT find_entries_i_s (multimap< int, string > &infos, int intg)
 
void COMMONSSHARED_EXPORT set_entries_d (multimap< int, double > &infos, int itr, vector< double > newval)
 
template<typename T , size_t N>
T * end (T(&pArray)[N])
 
vector< double > COMMONSSHARED_EXPORT scale_a_vector_to_1 (vector< double > a_vector)
 
bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_i (istream &in, map< int, int > &infos, string namefolderinput)
 
bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_s (istream &in, map< int, string > &infos, string namefolderinput)
 
bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_d (istream &in, map< int, double > &infos, string namefolderinput)
 
double COMMONSSHARED_EXPORT decode_the_tree (string &tree, vector< string > &direction, map< string, int > &external_states, map< string, int > &internal_states)
 

Macro Definition Documentation

◆ __MYUTILS_H

#define __MYUTILS_H   (1)

Typedef Documentation

◆ adjacency_map_t

typedef std::map<vertex_t, std::list<edge> > adjacency_map_t

◆ vertex_t

◆ weight_t

typedef int weight_t

Function Documentation

◆ closeSomeNodes()

void COMMONSSHARED_EXPORT closeSomeNodes ( std::vector< int > &  nodes_to_be_closed,
adjacency_map_t adjacency_map 
)

◆ compute_distance_fgrounds()

vector<double> COMMONSSHARED_EXPORT compute_distance_fgrounds ( const vector< types::NodeId > &  relevant_nodes,
const std::vector< PathShop > &  pathshops,
types::NodeId  from,
vector< types::NodeId grounds 
)

◆ decode_the_tree()

double COMMONSSHARED_EXPORT decode_the_tree ( string &  tree,
vector< string > &  direction,
map< string, int > &  external_states,
map< string, int > &  internal_states 
)

◆ DijkstraComputePaths()

void COMMONSSHARED_EXPORT DijkstraComputePaths ( vertex_t  source,
adjacency_map_t adjacency_map,
spp::sparse_hash_map< vertex_t, weight_t > &  min_distance,
spp::sparse_hash_map< vertex_t, vertex_t > &  previous,
std::vector< types::NodeId relevant_nodes 
)

◆ DijkstraGetShortestPathTo() [1/2]

std::list<vertex_t> COMMONSSHARED_EXPORT DijkstraGetShortestPathTo ( vertex_t  target,
spp::sparse_hash_map< vertex_t, vertex_t > &  previous 
)

◆ DijkstraGetShortestPathTo() [2/2]

std::list<types::NodeId> COMMONSSHARED_EXPORT DijkstraGetShortestPathTo ( types::NodeId  target,
const PathShop pathshop 
)

◆ end()

template<typename T , size_t N>
T* end ( T(&)  pArray[N])

◆ fill_field_of_coeff_diffusion_this_pop()

bool COMMONSSHARED_EXPORT fill_field_of_coeff_diffusion_this_pop ( istream &  in,
multimap< types::NodeId, double > &  coeffs 
)

fill in the avai attributes into a multimap

Parameters
theavai specification file, ...

◆ fill_from_avai_nodes_with_pop()

bool COMMONSSHARED_EXPORT fill_from_avai_nodes_with_pop ( istream &  in,
map< int, double > &  avai 
)

fill in the avai attributes into a map

Parameters
thevessel specification file, ...

◆ fill_from_avai_szgroup_nodes_with_pop()

bool COMMONSSHARED_EXPORT fill_from_avai_szgroup_nodes_with_pop ( istream &  in,
multimap< types::NodeId, double > &  avai 
)

fill in the avai attributes into a multimap

Parameters
theavai specification file, ...

◆ fill_from_bathymetry()

bool COMMONSSHARED_EXPORT fill_from_bathymetry ( istream &  in,
vector< double > &  graph_point_bathymetry,
int  nrow 
)

◆ fill_from_benthos_biomass()

bool COMMONSSHARED_EXPORT fill_from_benthos_biomass ( istream &  in,
vector< double > &  graph_point_benthos_biomass,
int  nrow 
)

◆ fill_from_benthos_number()

bool COMMONSSHARED_EXPORT fill_from_benthos_number ( istream &  in,
vector< double > &  graph_point_benthos_number,
int  nrow 
)

◆ fill_from_code_area()

bool COMMONSSHARED_EXPORT fill_from_code_area ( istream &  in,
vector< int > &  graph_point_code_area,
int  nrow 
)

◆ fill_from_code_marine_landscape()

bool COMMONSSHARED_EXPORT fill_from_code_marine_landscape ( istream &  in,
vector< int > &  graph_point_code_landscape,
int  nrow 
)

◆ fill_from_coord()

bool COMMONSSHARED_EXPORT fill_from_coord ( istream &  in,
vector< double > &  graph_coord_x,
vector< double > &  graph_coord_y,
vector< int > &  graph_coord_harbour,
int  nrow 
)

fill in the separated vectors related to the coord object

Parameters
thecoord file, ...

◆ fill_from_DissolvedCarbon()

bool COMMONSSHARED_EXPORT fill_from_DissolvedCarbon ( istream &  in,
vector< double > &  graph_point_DissolvedCarbon,
int  nrow 
)

◆ fill_from_firms_specifications()

bool fill_from_firms_specifications ( istream &  in,
vector< int > &  firm_ids,
vector< string > &  firm_names,
vector< int > &  nb_vessels,
vector< double > &  longs,
vector< double > &  lats 
)

fill in the firms attributes

Parameters
thefirm specification file, ...

◆ fill_from_fishfarms_specifications()

bool COMMONSSHARED_EXPORT fill_from_fishfarms_specifications ( istream &  in,
vector< int > &  fishfarms_ids,
vector< string > &  fishfarms_names,
vector< int > &  idx_nodes,
vector< int > &  is_actives,
vector< double > &  sizes,
vector< double > &  longs,
vector< double > &  lats,
vector< double > &  mean_SSTs,
vector< double > &  mean_salinities,
vector< double > &  mean_windspeeds,
vector< double > &  mean_currentspeeds,
vector< double > &  max_depths,
vector< double > &  diss_O2_mg_per_ls,
vector< double > &  Linf_mms,
vector< double > &  K_ys,
vector< double > &  t0_ys,
vector< double > &  fulton_condition_factors,
vector< string > &  meanw_growth_model_types,
vector< int > &  start_day_growings,
vector< int > &  end_day_harvests,
vector< int > &  nbyears_for_growths,
vector< int > &  nb_days_fallowing_periods,
vector< int > &  nb_fish_at_starts,
vector< double > &  meanw_at_starts,
vector< double > &  price_per_kg_at_starts,
vector< double > &  target_meanw_at_harvests,
vector< int > &  nb_fish_at_harvests,
vector< double > &  meanw_at_harvests,
vector< double > &  prop_harvest_kg_solds,
vector< double > &  kg_eggs_per_kgs,
vector< double > &  price_eggs_per_kgs,
vector< double > &  N_in_fish_kg_3pers,
vector< double > &  P_in_fish_kg_0_5pers,
vector< string > &  feed_types,
vector< double > &  feed_price_per_kgs,
vector< double > &  total_feed_kgs,
vector< double > &  prop_N_in_feeds,
vector< double > &  prop_P_in_feeds,
vector< double > &  total_feed_N_kgs,
vector< double > &  total_feed_P_kgs,
vector< string > &  feed_type_vets,
vector< double > &  feed_vet_price_per_kgs,
vector< double > &  total_feed_vet_kgs,
vector< double > &  prop_N_in_feed_vets,
vector< double > &  prop_P_in_feed_vets,
vector< double > &  total_feed_vet_N_kgs,
vector< double > &  total_feed_vet_P_kgs,
vector< double > &  annual_discharge_N_kgs,
vector< double > &  annual_discharge_P_kgs,
vector< double > &  annual_discharge_C_kgs,
vector< double > &  annual_discharge_heavymetals_kgs,
vector< double > &  annual_discharge_medecine_kgs,
vector< double > &  net_harvest_kg_per_sqkm_ys,
vector< double > &  market_price_sold_fishs,
vector< double > &  operating_cost_per_days,
vector< double > &  annual_profits 
)

fill in the fishfarms attributes

Parameters
thefishfarm specification file, ...

◆ fill_from_graph()

bool COMMONSSHARED_EXPORT fill_from_graph ( istream &  in,
vector< int > &  graph_idx_dep,
vector< int > &  graph_idx_arr,
vector< int > &  graph_dist_km,
int  nrow 
)

fill in the separated vectors related to the coord object

Parameters
thecoord file, ...

◆ fill_from_metier_specifications()

bool COMMONSSHARED_EXPORT fill_from_metier_specifications ( istream &  in,
multimap< string, double > &  infos 
)

fill in the vessel attributes into a multimap DOUBLE

Parameters
thevessel specification file, ...

◆ fill_from_Nitrogen()

bool COMMONSSHARED_EXPORT fill_from_Nitrogen ( istream &  in,
vector< double > &  graph_point_Nitrogen,
int  nrow 
)

◆ fill_from_nodes_in_polygons()

bool COMMONSSHARED_EXPORT fill_from_nodes_in_polygons ( istream &  in,
multimap< int, int > &  nodes_in_polygons 
)

fill in the avai attributes into a multimap

Parameters
theavai specification file, ...

◆ fill_from_oth_land()

bool COMMONSSHARED_EXPORT fill_from_oth_land ( istream &  in,
map< types::NodeId, double > &  oth_land 
)

fill in the oth_land attributes into a multimap

Parameters
theoth_land specification file, ...

◆ fill_from_overall_migration_fluxes()

bool COMMONSSHARED_EXPORT fill_from_overall_migration_fluxes ( istream &  in,
multimap< int, double > &  overall_migration_fluxes 
)

fill in the overall_migration_fluxes attributes into a multimap

Parameters
theoverall_migration_fluxes specification file, ...

◆ fill_from_Oxygen()

bool COMMONSSHARED_EXPORT fill_from_Oxygen ( istream &  in,
vector< double > &  graph_point_Oxygen,
int  nrow 
)

◆ fill_from_Phosphorus()

bool COMMONSSHARED_EXPORT fill_from_Phosphorus ( istream &  in,
vector< double > &  graph_point_Phosphorus,
int  nrow 
)

◆ fill_from_relative_stability()

bool COMMONSSHARED_EXPORT fill_from_relative_stability ( istream &  in,
map< string, double > &  relative_stability 
)

fill in the attributes into a multimap

Parameters
thespecification file, ...

◆ fill_from_salinity()

bool COMMONSSHARED_EXPORT fill_from_salinity ( istream &  in,
vector< double > &  graph_point_salinity,
int  nrow 
)

◆ fill_from_shippingdensity()

bool COMMONSSHARED_EXPORT fill_from_shippingdensity ( istream &  in,
vector< double > &  graph_point_shippingdensity,
int  nrow 
)

◆ fill_from_ships_specifications()

bool COMMONSSHARED_EXPORT fill_from_ships_specifications ( istream &  in,
vector< string > &  names,
vector< double > &  imos,
vector< double > &  yearbuilds,
vector< string > &  flags,
vector< string > &  types,
vector< double > &  typecodes,
vector< double > &  loas,
vector< double > &  KWs,
vector< double > &  breadths,
vector< double > &  grosstonnages,
vector< double > &  nbunits,
vector< double > &  fueluses,
vector< double > &  NOxEmission_gperKWhs,
vector< double > &  SOxEmission_percentpertotalfuelmasss,
vector< double > &  GHGEmissions,
vector< double > &  PMEmissions,
vector< double > &  vmaxs,
vector< double > &  vcruises,
vector< double > &  lane_ids 
)

fill in the vessel attributes

Parameters
thevessel specification file, ...

◆ fill_from_siltfraction()

bool COMMONSSHARED_EXPORT fill_from_siltfraction ( istream &  in,
vector< double > &  graph_point_siltfraction,
int  nrow 
)

◆ fill_from_sst()

bool COMMONSSHARED_EXPORT fill_from_sst ( istream &  in,
vector< double > &  graph_point_sst,
int  nrow 
)

◆ fill_from_vessels_economic_specifications()

bool COMMONSSHARED_EXPORT fill_from_vessels_economic_specifications ( istream &  in,
vector< double > &  this_vessel_nb_crews,
vector< double > &  annual_other_incomes,
vector< double > &  landing_costs_percents,
vector< double > &  crewshare_and_unpaid_labour_costs_percents,
vector< double > &  other_variable_costs_per_unit_efforts,
vector< double > &  annual_insurance_costs_per_crews,
vector< double > &  standard_labour_hour_opportunity_costss,
vector< double > &  standard_annual_full_time_employement_hourss,
vector< double > &  other_annual_fixed_costss,
vector< double > &  vessel_values,
vector< double > &  annual_depreciation_rates,
vector< double > &  opportunity_interest_rates,
vector< double > &  annual_discount_rates 
)

fill in the vessel attributes

Parameters
thevessel specification file, ...

◆ fill_from_vessels_specifications()

bool COMMONSSHARED_EXPORT fill_from_vessels_specifications ( istream &  in,
vector< string > &  names,
vector< int > &  vid_is_actives,
vector< int > &  vid_is_part_of_ref_fleets,
vector< double > &  speeds,
vector< double > &  fuelcons,
vector< double > &  lengths,
vector< double > &  vKWs,
vector< double > &  carrycapacities,
vector< double > &  tankcapacities,
vector< double > &  nbfpingspertrips,
vector< double > &  resttime_par1s,
vector< double > &  resttime_par2s,
vector< double > &  av_trip_duration,
vector< double > &  mult_fuelcons_when_steaming,
vector< double > &  mult_fuelcons_when_fishing,
vector< double > &  mult_fuelcons_when_returning,
vector< double > &  mult_fuelcons_when_inactive,
vector< int > &  firm_ids,
vector< VesselCalendar > &  calendars 
)

fill in the vessel attributes

Parameters
thevessel specification file, ...

◆ fill_from_wind()

bool COMMONSSHARED_EXPORT fill_from_wind ( istream &  in,
vector< double > &  graph_point_wind,
int  nrow 
)

◆ fill_in_fbar_ages_min_max()

bool COMMONSSHARED_EXPORT fill_in_fbar_ages_min_max ( istream &  in,
vector< double > &  fbar_ages_min_max 
)

fill in

Parameters
thevector file, ...

◆ fill_in_growth_transition()

bool COMMONSSHARED_EXPORT fill_in_growth_transition ( istream &  in,
vector< vector< double > > &  growth_transition 
)

fill in the growth transition matrix

Parameters
thevector file, ...

◆ fill_in_initial_tac()

bool COMMONSSHARED_EXPORT fill_in_initial_tac ( istream &  in,
vector< double > &  initial_tac 
)

fill in

Parameters
thevector file, ...

◆ fill_in_param_sr()

bool COMMONSSHARED_EXPORT fill_in_param_sr ( istream &  in,
vector< double > &  param_sr 
)

fill in

Parameters
thevector file, ...

◆ fill_in_percent_age_per_szgroup_matrix()

bool COMMONSSHARED_EXPORT fill_in_percent_age_per_szgroup_matrix ( istream &  in,
vector< vector< double > > &  percent_age_per_szgroup_matrix 
)

fill in the growth transition matrix

Parameters
thevector file, ...

◆ fill_in_percent_szgroup_per_age_matrix()

bool COMMONSSHARED_EXPORT fill_in_percent_szgroup_per_age_matrix ( istream &  in,
vector< vector< double > > &  percent_szgroup_per_age_matrix 
)

fill in the growth transition matrix

Parameters
thevector file, ...

◆ fill_in_preferences_for_species_matrix()

bool COMMONSSHARED_EXPORT fill_in_preferences_for_species_matrix ( istream &  in,
vector< vector< double > > &  preferences_for_species_matrix 
)

fill in the preferences_for_species_matrix

Parameters
thevector file, ...

◆ fill_in_selectivity_per_stock()

bool COMMONSSHARED_EXPORT fill_in_selectivity_per_stock ( istream &  in,
vector< vector< double > > &  selectivity_per_stock 
)

fill in the growth transition matrix

Parameters
thevector file, ...

◆ fill_in_species_interactions_mortality_proportion_matrix()

bool COMMONSSHARED_EXPORT fill_in_species_interactions_mortality_proportion_matrix ( istream &  in,
vector< vector< double > > &  species_interactions_mortality_proportion_matrix 
)

fill in the species_interactions_mortality_proportion_matrix

Parameters
thevector file, ...

◆ fill_map_from_specifications()

template<typename DTYPE >
void fill_map_from_specifications ( istream &  in,
map< int, DTYPE > &  map 
)

◆ fill_map_from_specifications_i_d()

bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_d ( istream &  in,
map< int, double > &  infos,
string  namefolderinput 
)

fill in the vessel attributes into a map <int, int>

Parameters
e.g.the vessel specification file, ...

◆ fill_map_from_specifications_i_i() [1/2]

bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_i ( istream &  in,
map< int, int > &  a_map 
)

fill in the avai attributes into a multimap

Parameters
theavai specification file, ...

◆ fill_map_from_specifications_i_i() [2/2]

bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_i ( istream &  in,
map< int, int > &  infos,
string  namefolderinput 
)

fill in the vessel attributes into a map <int, int>

Parameters
e.g.the vessel specification file, ...

◆ fill_map_from_specifications_i_s() [1/2]

bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_s ( istream &  in,
map< int, string > &  a_map 
)

fill in the avai attributes into a multimap

Parameters
theavai specification file, ...

◆ fill_map_from_specifications_i_s() [2/2]

bool COMMONSSHARED_EXPORT fill_map_from_specifications_i_s ( istream &  in,
map< int, string > &  infos,
string  namefolderinput 
)

fill in the vessel attributes into a map <int, int>

Parameters
e.g.the vessel specification file, ...

◆ fill_map_from_specifications_s_d()

bool COMMONSSHARED_EXPORT fill_map_from_specifications_s_d ( istream &  in,
map< string, double > &  infos 
)

fill in the vessel attributes into a map <int, int>

Parameters
e.g.the vessel specification file, ...

◆ fill_multimap_from_specifications()

template<typename K , typename V >
bool fill_multimap_from_specifications ( istream &  in,
multimap< K, V > &  infos 
)

◆ fill_multimap_from_specifications_i_d()

bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_i_d ( istream &  in,
multimap< int, double > &  infos 
)

fill in the vessel attributes into a multimap <integer, double>. First line is an heading.

Parameters
e.g.the vessel specification file, ...

◆ fill_multimap_from_specifications_i_i()

bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_i_i ( istream &  in,
multimap< int, int > &  infos 
)

fill in the vessel attributes into a multimap <int, int>

Parameters
e.g.the vessel specification file, ...

◆ fill_multimap_from_specifications_i_s()

bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_i_s ( istream &  in,
multimap< int, string > &  infos 
)

fill in the vessel attributes into a multimap <int, string>

Parameters
e.g.the vessel specification file, ...

◆ fill_multimap_from_specifications_s_d()

bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_s_d ( istream &  in,
multimap< string, double > &  infos 
)

fill in the vessel attributes into a multimap <string, double>

Parameters
e.g.the vessel specification file, ...

◆ fill_multimap_from_specifications_s_i()

bool COMMONSSHARED_EXPORT fill_multimap_from_specifications_s_i ( istream &  in,
multimap< string, int > &  infos 
)

fill in the vessel attributes into a multimap <string, integer>

Parameters
e.g.the vessel specification file, ...

◆ find_entries()

template<typename K , typename V >
std::vector<V> find_entries ( const std::multimap< K, V > &  infos,
K  val 
)

◆ find_entries_i_d()

vector<double> COMMONSSHARED_EXPORT find_entries_i_d ( const multimap< int, double > &  infos,
int  intg 
)

◆ find_entries_i_i()

vector<int> COMMONSSHARED_EXPORT find_entries_i_i ( const multimap< int, int > &  infos,
int  intg 
)

◆ find_entries_i_s()

vector<string> COMMONSSHARED_EXPORT find_entries_i_s ( multimap< int, string > &  infos,
int  intg 
)

◆ find_entries_s_d()

vector<double> COMMONSSHARED_EXPORT find_entries_s_d ( multimap< string, double > &  infos,
string  str 
)

◆ find_entries_s_i()

vector<int> COMMONSSHARED_EXPORT find_entries_s_i ( multimap< string, int > &  infos,
string  vid 
)

◆ find_pair() [1/2]

multimap<int,int>::const_iterator COMMONSSHARED_EXPORT find_pair ( const multimap< int, int > &  map,
const pair< int, int > &  pair 
)

◆ find_pair() [2/2]

template<typename K , typename V >
multimap<K,V>::const_iterator find_pair ( const multimap< K, V > &  map,
const pair< K, V > &  pair 
)

◆ insert_if_not_present() [1/2]

bool COMMONSSHARED_EXPORT insert_if_not_present ( multimap< int, int > &  map,
const pair< int, int > &  pair 
)

◆ insert_if_not_present() [2/2]

template<typename K , typename V >
bool insert_if_not_present ( multimap< K, V > &  map,
const pair< K, V > &  pair 
)

◆ myintegrand()

double COMMONSSHARED_EXPORT myintegrand ( double  x,
double  S1,
double  S2 
)

◆ remove_dups() [1/4]

template<typename T >
void remove_dups ( vector< T > &  seq)

◆ remove_dups() [2/4]

void COMMONSSHARED_EXPORT remove_dups ( vector< int > &  seq)

◆ remove_dups() [3/4]

multimap<int,int> COMMONSSHARED_EXPORT remove_dups ( multimap< int, int > &  original_map)

◆ remove_dups() [4/4]

template<typename K , typename V >
multimap<K,V> remove_dups ( multimap< K, V > &  original_map)

◆ scale_a_vector_to_1()

vector<double> COMMONSSHARED_EXPORT scale_a_vector_to_1 ( vector< double >  a_vector)

◆ set_entries_d()

void COMMONSSHARED_EXPORT set_entries_d ( multimap< int, double > &  infos,
int  itr,
vector< double >  newval 
)

◆ SimplifyThePreviousMap()

void COMMONSSHARED_EXPORT SimplifyThePreviousMap ( int  source,
spp::sparse_hash_map< vertex_t, vertex_t > &  previous,
std::vector< types::NodeId > &  relevant_nodes,
spp::sparse_hash_map< vertex_t, weight_t > &  min_distance,
string  namesimu,
string  a_graph_name,
string  inputfolder 
)

◆ simpson()

template<double f>
double simpson ( double  a,
double  b,
int  n,
double  S1,
double  S2 
)

◆ sort_indexes_ascending()

template<typename T >
vector<size_t> sort_indexes_ascending ( const vector< T > &  v)

◆ sort_indexes_descending()

template<typename T >
vector<size_t> sort_indexes_descending ( const vector< T > &  v)

◆ split()

template<typename Container >
Container& split ( Container &  result,
const typename Container::value_type &  s,
const typename Container::value_type &  delimiters,
splitX::empties_t  empties = splitX::empties_ok 
)

◆ trapezoidal()

double COMMONSSHARED_EXPORT trapezoidal ( double  a,
double  b,
vector< double >  sel 
)