DISPLACE
1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
|
#include <Vessel.h>
Public Types | |
enum | LengthClass { Under15 = 0, Between15and18, Between18and24, Between24and40, Over40, NumLenghClasses } |
Public Member Functions | |
Vessel (std::string name, Node *a_location) | |
Vessel (Node *a_location, int idx_vessel, std::string name) | |
Vessel (Node *a_location, int idx_vessel, std::string name, int nbpops, int nbszgroups, const vector< types::NodeId > &harbours, const std::vector< types::NodeId > &fgrounds, const std::vector< types::NodeId > &fgrounds_init, const std::vector< double > &freq_harbours, const std::vector< double > &freq_fgrounds, const std::vector< double > &freq_fgrounds_init, const std::vector< double > &vessel_betas_per_pop, const std::vector< double > &percent_tac_per_pop, const multimap< types::NodeId, int > &possible_metiers, const multimap< types::NodeId, double > &freq_possible_metiers, int vid_is_active, int vid_is_part_of_ref_fleet, double speed, double fuelcons, double length, double KW, double carrycapacity, double tankcapacity, double nbfpingspertrip, double resttime_par1, double resttime_par2, double av_trip_duration, double mult_fuelcons_when_steaming, double mult_fuelcons_when_fishing, double mult_fuelcons_when_returning, double mult_fuelcons_when_inactive, int _firm_id, VesselCalendar cd, double this_vessel_nb_crew, double annual_other_income, double landing_costs_percent, double crewshare_and_unpaid_labour_costs_percent, double other_variable_costs_per_unit_effort, double annual_insurance_costs_per_crew, double standard_labour_hour_opportunity_costs, double standard_annual_full_time_employement_hours, double other_annual_fixed_costs, double vessel_value, double annual_depreciation_rate, double opportunity_interest_rate, double annual_discount_rate) | |
Vessel () | |
~Vessel () | |
void | lock () |
void | unlock () |
int | get_idx () const |
std::string | get_name () const |
int | get_vid_is_active () const |
int | get_vid_is_part_of_ref_fleet () const |
int | get_firm_id () const |
Node * | get_loc () const |
const std::vector< Node * > & | get_map_of_nodes () const |
Metier * | get_metier () const |
double | get_speed () const |
double | get_length () const |
double | get_KW () const |
int | get_length_class () const |
std::string | get_nationality () const |
const vector< types::NodeId > & | get_harbours () const |
const vector< types::NodeId > & | get_fgrounds () const |
const vector< types::NodeId > & | get_fgrounds_init () const |
vector< types::NodeId > & | get_fgrounds_in_closed_areas () |
const std::vector< double > & | get_freq_harbours () const |
const std::vector< double > & | get_freq_fgrounds () const |
const std::vector< double > & | get_freq_fgrounds_init () const |
const std::vector< double > & | get_cumcatch_fgrounds () const |
const std::vector< double > & | get_cumdiscard_fgrounds () const |
const std::vector< double > & | get_experienced_bycatch_prop_on_fgrounds () const |
const std::vector< double > & | get_experienced_avoided_stks_bycatch_prop_on_fgrounds () const |
const std::vector< std::vector< double > > & | get_cumcatch_fgrounds_per_pop () const |
const std::vector< std::vector< double > > & | get_cumdiscard_fgrounds_per_pop () const |
const std::vector< double > & | get_cumeffort_fgrounds () const |
const std::vector< double > & | get_experiencedcpue_fgrounds () const |
const std::vector< std::vector< double > > & | get_experiencedcpue_fgrounds_per_pop () const |
const std::vector< double > & | get_freq_experiencedcpue_fgrounds () const |
const std::vector< std::vector< double > > & | get_freq_experiencedcpue_fgrounds_per_pop () const |
const std::vector< double > & | get_vessel_betas_per_pop () const |
const std::vector< double > & | get_percent_tac_per_pop () const |
const std::vector< double > & | get_fishing_credits () const |
const std::vector< int > & | get_idx_used_metiers_this_trip () |
const multimap< types::NodeId, int > & | get_possible_metiers () const |
const multimap< types::NodeId, double > & | get_freq_possible_metiers () const |
const std::list< types::NodeId > & | get_roadmap () const |
bool | get_inharbour () const |
bool | get_inactive () const |
int | get_is_vessel_exited () const |
bool | get_natio () const |
int | get_state () const |
int | get_reason_to_go_back () const |
int | get_tstep_dep () const |
double | get_x () const |
double | get_y () const |
double | get_course () const |
double | get_timeforrest () const |
double | get_fuelcons () const |
double | get_cumfuelcons () const |
double | get_consotogetthere () const |
double | get_cumsteaming () const |
double | get_distprevpos () const |
double | get_timeatsea () const |
double | get_traveled_dist_this_trip () const |
double | get_sweptareathistrip () const |
double | get_subsurfacesweptareathistrip () const |
double | get_tankcapacity () const |
double | get_carrycapacity () const |
int | get_nbfpingspertrip () const |
double | get_resttime_par1 () const |
double | get_resttime_par2 () const |
double | get_av_trip_duration () const |
double | get_mult_fuelcons_when_steaming () const |
double | get_mult_fuelcons_when_fishing () const |
double | get_mult_fuelcons_when_returning () const |
double | get_mult_fuelcons_when_inactive () const |
double | get_cumcatches () const |
double | get_cumdiscards () const |
double | get_this_vessel_nb_crew () const |
double | get_annual_other_income () const |
double | get_landing_costs_percent () const |
double | get_crewshare_and_unpaid_labour_costs_percent () const |
double | get_other_variable_costs_per_unit_effort () const |
double | get_annual_insurance_costs_per_crew () const |
double | get_standard_labour_hour_opportunity_costs () const |
double | get_standard_annual_full_time_employement_hours () const |
double | get_other_annual_fixed_costs () const |
double | get_vessel_value () const |
double | get_annual_depreciation_rate () const |
double | get_opportunity_interest_rate () const |
double | get_annual_discount_rate () const |
double | getDaysSpentInRestrictedAreaThisMonth (int idx_met) |
types::NodeId | get_smartcatch () const |
types::NodeId | get_highpotentialcatch () const |
types::NodeId | get_notthatfar () const |
types::NodeId | get_lowesttariff () const |
types::NodeId | get_mosthistoricallyused () const |
const std::vector< std::vector< double > > & | get_gshape_cpue_nodes_species () const |
const std::vector< std::vector< double > > & | get_gscale_cpue_nodes_species () const |
const std::vector< std::vector< double > > & | get_catch_pop_at_szgroup () const |
const std::vector< std::vector< double > > & | get_ping_catch_pop_at_szgroup () const |
const std::vector< std::vector< double > > & | get_discards_pop_at_szgroup () const |
int | read_message () const |
types::NodeId | get_previous_harbour_idx () const |
int | get_individual_tac (int sp) const |
vector< double > | get_is_choked () const |
int | get_individual_tac_per_pop_at_year_start (int sp) const |
double | get_prop_remaining_individual_quotas (int sp) const |
double | get_prop_remaining_global_quotas (int sp) const |
double | get_min_prop_remaining_individual_quotas_on_avoided_stks () |
double | get_min_prop_remaining_global_quotas_on_avoided_stks () |
double | get_min_prop_remaining_individual_quotas () |
double | get_min_prop_remaining_global_quotas () |
int | get_targeting_non_tac_pop_only () const |
double | get_GVA () const |
double | get_GVAPerRevenue () const |
double | get_LabourSurplus () const |
double | get_GrossProfit () const |
double | get_NetProfit () const |
double | get_NetProfitMargin () const |
double | get_GVAPerFTE () const |
double | get_RoFTA () const |
double | get_BER () const |
double | get_CRBER () const |
double | get_NetPresentValue () const |
int | get_numTrips () const |
double | get_effort_multiplier () const |
void | addADayPortionToDaysSpentInRestrictedAreaThisMonth (int idx_met, double a_portion) |
void | reinitDaysSpentInRestrictedAreaThisMonthtoZero () |
void | set_map_of_nodes (const vector< Node * > &_map_of_nodes) |
void | set_firm_id (int val) |
void | set_vid_is_active (int val) |
void | set_vid_is_part_of_ref_fleet (int val) |
void | set_speed (double val) |
void | set_vessel_value (double val) |
void | set_resttime_par1 (double val) |
void | set_resttime_par2 (double val) |
void | set_av_trip_duration (double val) |
void | set_fuelcons (double val) |
void | set_course (double val) |
void | set_fgrounds (int val) |
void | set_fgrounds_init (int val) |
void | set_harbours (int val) |
void | set_spe_harbours (const std::vector< types::NodeId > &_harbours) |
void | set_spe_fgrounds (const vector< types::NodeId > &_fgrounds) |
void | set_spe_fgrounds_init (const vector< types::NodeId > &_fgrounds_init) |
void | set_fgrounds_in_closed_areas (const vector< types::NodeId > &_fgrounds) |
void | set_spe_freq_harbours (const std::vector< double > &_harbours) |
void | set_spe_freq_fgrounds (const std::vector< double > &_fgrounds) |
void | set_spe_freq_fground (int index, double _fground) |
void | set_spe_freq_fgrounds_init (const std::vector< double > &_fgrounds_init) |
void | set_fishing_credits (const std::vector< double > &_fishing_credits) |
void | set_spe_cumcatch_fgrounds (const std::vector< double > &_cumcatch) |
void | set_spe_cumdiscard_fgrounds (const std::vector< double > &_cumdiscard) |
void | set_spe_experienced_bycatch_prop_on_fgrounds (const std::vector< double > &_experienced_bycatch_prop_on_fgrounds) |
void | set_spe_experienced_avoided_stks_bycatch_prop_on_fgrounds (const std::vector< double > &_experienced_avoided_stks_bycatch_prop_on_fgrounds) |
void | set_spe_cumeffort_fgrounds (const std::vector< double > &_cumeffort) |
void | set_spe_experiencedcpue_fgrounds (const std::vector< double > &_experiencedcpue) |
void | set_spe_betas_per_pop (const std::vector< double > &_betas_per_pop) |
void | set_spe_percent_tac_per_pop (const std::vector< double > &_tacs_per_pop) |
void | set_spe_possible_metiers (const std::multimap< types::NodeId, int > &_possible_metiers) |
void | set_spe_freq_possible_metiers (const std::multimap< types::NodeId, double > &_freq_possible_metiers) |
void | init_cpue_nodes_species (int nbnodes, int nbspecies) |
void | set_cpue_nodes_species (int sp, const std::vector< double > &newval) |
void | init_gshape_cpue_nodes_species (int nbnodes, int nbspecies) |
void | set_gshape_cpue_nodes_species (int sp, const std::vector< double > &newval) |
void | init_gscale_cpue_nodes_species (int nbnodes, int nbspecies) |
void | set_gscale_cpue_nodes_species (int sp, const std::vector< double > &newval) |
void | set_cumcatch_fgrounds (const std::vector< double > &newval) |
void | set_cumdiscard_fgrounds (const std::vector< double > &newval) |
void | set_experienced_bycatch_prop_on_fgrounds (const std::vector< double > &newval) |
void | set_experienced_avoided_stks_bycatch_prop_on_fgrounds (const std::vector< double > &newval) |
void | set_cumcatch_fgrounds_per_pop (const std::vector< std::vector< double > > &newval) |
void | set_cumdiscard_fgrounds_per_pop (const std::vector< std::vector< double > > &newval) |
void | set_cumeffort_fgrounds (const std::vector< double > &newval) |
void | set_experiencedcpue_fgrounds (const std::vector< double > &newval) |
void | set_experiencedcpue_fgrounds_per_pop (const std::vector< std::vector< double > > &newval) |
void | set_freq_experiencedcpue_fgrounds (const std::vector< double > &newval) |
void | set_freq_experiencedcpue_fgrounds_per_pop (const std::vector< std::vector< double > > &newval) |
void | clear_idx_used_metiers_this_trip () |
void | set_roadmap (const std::list< types::NodeId > &_roadmap) |
void | set_inharbour (bool logic) |
void | set_inactive (bool logic) |
void | set_vessel_exited (int logic) |
void | set_natio (bool logic) |
void | set_smartcatch (types::NodeId smartcatch) |
void | set_highpotentialcatch (types::NodeId highpotentialcatch) |
void | set_notthatfar (types::NodeId notthatfar) |
void | set_lowesttariff (types::NodeId lowesttariff) |
void | set_mosthistoricallyused (types::NodeId mosthistoricallyused) |
void | set_state (int _state) |
void | set_previous_harbour_idx (types::NodeId previous_harbour_idx) |
void | set_reason_to_go_back (int _reason_to_go_back) |
void | set_tstep_dep (int _tstep) |
void | set_timeforrest (double _timeforrest) |
void | set_cumfuelcons (double _cumfuelcons) |
void | set_distprevpos (double _distprevpos) |
void | set_cumsteaming (double _cumsteaming) |
void | set_consotogetthere (double _consotogetthere) |
void | set_timeatsea (double _timeatsea) |
void | set_traveled_dist_this_trip (double _traveled_dist_this_trip) |
void | set_sweptareathistrip (double _sweptareathistrip) |
void | set_subsurfacesweptareathistrip (double _subsurfacesweptareathistrip) |
void | set_cumcatches (double _cumcatches) |
void | set_cumdiscards (double _cumdiscards) |
void | set_nbfpingspertrip (int _nbfpingspertrip) |
void | set_xy (double _x, double _y) |
void | set_next_xy (double nx, double ny) |
void | set_effort_multiplier (double multi) |
void | erode_roadmap () |
void | move_to (double nx, double ny) |
void | move_to (Node *next_node) |
void | set_metier (Metier *new_metier) |
void | set_is_choked (int pop, int val) |
void | find_next_point_on_the_graph (std::vector< Node * > &nodes) |
void | do_catch (std::ofstream &export_individual_tacs, std::vector< Population * > &populations, std::vector< Node * > &nodes, vector< Benthos * > &benthoshabs, std::vector< int > &implicit_pops, vector< int > &grouped_tacs, int &tstep, vector< double > &graph_res, bool &is_tacs, bool &is_individual_vessel_quotas, bool &check_all_stocks_before_going_fishing, bool &is_discard_ban, bool &is_grouped_tacs, double &tech_creeping_multiplier, bool &is_fishing_credits, bool &direct_killing_on_benthos, bool &resuspension_effect_on_benthos, bool &is_benthos_in_numbers) |
void | clear_catch_pop_at_szgroup () |
void | clear_ping_catch_pop_at_szgroup () |
void | clear_discards_pop_at_szgroup () |
void | compute_experiencedcpue_fgrounds () |
void | compute_experiencedcpue_fgrounds_per_pop () |
void | clear_cumcatch_and_cumeffort () |
void | receive_message (int message) |
void | reset_message () |
void | export_loglike_prop_met (std::ofstream &loglike_prop_met, int tstep, int nbpops) |
void | reinit_after_a_trip () |
void | alter_freq_fgrounds_for_nodes_in_polygons (std::multimap< int, int > nodes_in_polygons) |
void | alloc_on_high_previous_cpue (int tstep, std::ofstream &freq_cpue) |
void | alloc_on_high_profit_grounds (int tstep, int use_static_paths, vector< Node * > &nodes, const std::vector< types::NodeId > &relevant_nodes, const std::vector< PathShop > &pathshops, std::ofstream &freq_profit) |
std::vector< double > | expected_profit_on_grounds (int use_static_paths, vector< Node * > &nodes, const std::vector< types::NodeId > &relevant_nodes, const std::vector< PathShop > &pathshops) |
void | alloc_while_saving_fuel (int tstep, int use_static_paths, vector< Node * > &nodes, const std::vector< types::NodeId > &relevant_nodes, const std::vector< PathShop > &pathshops) |
void | alloc_on_closer_grounds (int tstep, int use_static_paths, vector< Node * > &nodes, const std::vector< types::NodeId > &relevant_nodes, const std::vector< PathShop > &pathshops, std::ofstream &freq_distance) |
bool | choose_a_ground_and_go_fishing (int tstep, const displace::commons::Scenario &scenario, bool use_the_tree, const DynAllocOptions &dyn_alloc_sce, int use_static_paths, const std::vector< PathShop > &pathshops, adjacency_map_t &adjacencymap, vector< types::NodeId > &relevant_nodes, std::multimap< int, int > &nodes_in_polygons, std::vector< Node * > &nodes, std::vector< Metier * > &metiers, std::ofstream &freq_cpue, std::ofstream &freq_profit, std::ofstream &freq_distance) |
int | choose_another_ground_and_go_fishing (int tstep, const DynAllocOptions &dyn_alloc_sce, int use_static_paths, const std::vector< PathShop > &pathshops, adjacency_map_t &adjacency_map, vector< types::NodeId > &relevant_nodes, const std::multimap< int, int > &nodes_in_polygons, std::vector< Node * > &nodes, std::vector< Metier * > &metiers, std::ofstream &freq_cpue, std::ofstream &freq_distance) |
void | choose_a_port_and_then_return (int tstep, const DynAllocOptions &dyn_alloc_sce, int use_static_paths, const std::vector< PathShop > &pathshops, adjacency_map_t &adjacency_map, vector< types::NodeId > &relevant_nodes, std::vector< Node * > &nodes, std::vector< Metier * > &metiers, std::ofstream &freq_cpue, std::ofstream &freq_distance, std::vector< double > &dist_to_ports) |
void | which_metier_should_i_go_for (std::vector< Metier * > &metiers) |
int | should_i_go_fishing (int tstep, std::vector< Population * > &populations, bool use_the_tree, const DynAllocOptions &dyn_alloc_sce, std::vector< int > &implicit_pops, int is_individual_vessel_quotas, int check_all_stocks_before_going_fishing) |
types::NodeId | should_i_choose_this_ground (int tstep, int use_static_paths, std::vector< Node * > &nodes, const std::vector< types::NodeId > &relevant_nodes, const std::vector< PathShop > &pathshops, const DynAllocOptions &dyn_alloc_sce) |
int | should_i_change_ground (std::map< std::string, int > &external_states, bool use_the_tree) |
int | should_i_stop_fishing (const std::map< std::string, int > &external_states, bool use_the_tree, int tstep, const DynAllocOptions &dyn_alloc_sce, int use_static_paths, const std::vector< PathShop > &pathshops, adjacency_map_t &adjacency_map, const vector< types::NodeId > &relevant_nodes, std::vector< Node * > &nodes, std::vector< Metier * > &metiers, std::ofstream &freq_cpue, std::ofstream &freq_distance, std::vector< double > &dist_to_ports) |
int | should_i_choose_this_port (std::map< std::string, int > &external_states, bool use_the_tree) |
void | set_individual_tac_this_pop (std::ofstream &export_individual_tacs, int tstep, std::vector< Population * > &populations, std::vector< int > implicit_pops, int pop, int init, double a_tac) |
void | set_targeting_non_tac_pop_only (int targeting_non_tac_pop_only) |
double | getLastTripRevenues () const |
double | getLastTripExplicitRevenues () const |
double | getAvgTripRevenues () const |
double | getLastTripProfit () const |
double | getAvgTripProfit () const |
int | getNumTrips () const |
void | updateTripsStatistics (const std::vector< Population * > &populations, std::vector< int > &implicit_pops, int tstep, const DynAllocOptions &dyn_alloc_sce) |
double | traverseDtree (int tstep, dtree::DecisionTree *tree) |
Starting from the dtree root, traverse it evaluating any node and the relative Variable. The return value from StateEvaluator::evaluate() is rounded and casted to int to define the next node. More... | |
void | updateCalendar (const VesselCalendar &c) |
int | getWeekEndStartDay () const |
int | getWeekEndEndDay () const |
int | getWorkDayStartHour () const |
int | getWorkDayEndHour () const |
Static Public Member Functions | |
static std::string | nationalityFromName (const std::string &name) |
Static Public Attributes | |
static std::vector< std::shared_ptr< dtree::StateEvaluator > > | mStateEvaluators |
the State evaluators. Since the current vessel is passed as variable to evaluate() we can put a static instance and avoid wasting a lot of memory. The table is initialized once in init() (lazy initialization) More... | |
Protected Member Functions | |
void | init () |
void | find_next_point_on_the_graph_unlocked (std::vector< Node * > &nodes) |
enum Vessel::LengthClass |
Vessel::Vessel | ( | std::string | name, |
Node * | a_location | ||
) |
Vessel::Vessel | ( | Node * | a_location, |
int | idx_vessel, | ||
std::string | name | ||
) |
Vessel::Vessel | ( | Node * | a_location, |
int | idx_vessel, | ||
std::string | name, | ||
int | nbpops, | ||
int | nbszgroups, | ||
const vector< types::NodeId > & | harbours, | ||
const std::vector< types::NodeId > & | fgrounds, | ||
const std::vector< types::NodeId > & | fgrounds_init, | ||
const std::vector< double > & | freq_harbours, | ||
const std::vector< double > & | freq_fgrounds, | ||
const std::vector< double > & | freq_fgrounds_init, | ||
const std::vector< double > & | vessel_betas_per_pop, | ||
const std::vector< double > & | percent_tac_per_pop, | ||
const multimap< types::NodeId, int > & | possible_metiers, | ||
const multimap< types::NodeId, double > & | freq_possible_metiers, | ||
int | vid_is_active, | ||
int | vid_is_part_of_ref_fleet, | ||
double | speed, | ||
double | fuelcons, | ||
double | length, | ||
double | KW, | ||
double | carrycapacity, | ||
double | tankcapacity, | ||
double | nbfpingspertrip, | ||
double | resttime_par1, | ||
double | resttime_par2, | ||
double | av_trip_duration, | ||
double | mult_fuelcons_when_steaming, | ||
double | mult_fuelcons_when_fishing, | ||
double | mult_fuelcons_when_returning, | ||
double | mult_fuelcons_when_inactive, | ||
int | _firm_id, | ||
VesselCalendar | cd, | ||
double | this_vessel_nb_crew, | ||
double | annual_other_income, | ||
double | landing_costs_percent, | ||
double | crewshare_and_unpaid_labour_costs_percent, | ||
double | other_variable_costs_per_unit_effort, | ||
double | annual_insurance_costs_per_crew, | ||
double | standard_labour_hour_opportunity_costs, | ||
double | standard_annual_full_time_employement_hours, | ||
double | other_annual_fixed_costs, | ||
double | vessel_value, | ||
double | annual_depreciation_rate, | ||
double | opportunity_interest_rate, | ||
double | annual_discount_rate | ||
) |
Vessel::Vessel | ( | ) |
Vessel::~Vessel | ( | ) |
void Vessel::addADayPortionToDaysSpentInRestrictedAreaThisMonth | ( | int | idx_met, |
double | a_portion | ||
) |
void Vessel::alloc_on_closer_grounds | ( | int | tstep, |
int | use_static_paths, | ||
vector< Node * > & | nodes, | ||
const std::vector< types::NodeId > & | relevant_nodes, | ||
const std::vector< PathShop > & | pathshops, | ||
std::ofstream & | freq_distance | ||
) |
void Vessel::alloc_on_high_previous_cpue | ( | int | tstep, |
std::ofstream & | freq_cpue | ||
) |
void Vessel::alloc_on_high_profit_grounds | ( | int | tstep, |
int | use_static_paths, | ||
vector< Node * > & | nodes, | ||
const std::vector< types::NodeId > & | relevant_nodes, | ||
const std::vector< PathShop > & | pathshops, | ||
std::ofstream & | freq_profit | ||
) |
void Vessel::alloc_while_saving_fuel | ( | int | tstep, |
int | use_static_paths, | ||
vector< Node * > & | nodes, | ||
const std::vector< types::NodeId > & | relevant_nodes, | ||
const std::vector< PathShop > & | pathshops | ||
) |
void Vessel::alter_freq_fgrounds_for_nodes_in_polygons | ( | std::multimap< int, int > | nodes_in_polygons | ) |
bool Vessel::choose_a_ground_and_go_fishing | ( | int | tstep, |
const displace::commons::Scenario & | scenario, | ||
bool | use_the_tree, | ||
const DynAllocOptions & | dyn_alloc_sce, | ||
int | use_static_paths, | ||
const std::vector< PathShop > & | pathshops, | ||
adjacency_map_t & | adjacencymap, | ||
vector< types::NodeId > & | relevant_nodes, | ||
std::multimap< int, int > & | nodes_in_polygons, | ||
std::vector< Node * > & | nodes, | ||
std::vector< Metier * > & | metiers, | ||
std::ofstream & | freq_cpue, | ||
std::ofstream & | freq_profit, | ||
std::ofstream & | freq_distance | ||
) |
void Vessel::choose_a_port_and_then_return | ( | int | tstep, |
const DynAllocOptions & | dyn_alloc_sce, | ||
int | use_static_paths, | ||
const std::vector< PathShop > & | pathshops, | ||
adjacency_map_t & | adjacency_map, | ||
vector< types::NodeId > & | relevant_nodes, | ||
std::vector< Node * > & | nodes, | ||
std::vector< Metier * > & | metiers, | ||
std::ofstream & | freq_cpue, | ||
std::ofstream & | freq_distance, | ||
std::vector< double > & | dist_to_ports | ||
) |
int Vessel::choose_another_ground_and_go_fishing | ( | int | tstep, |
const DynAllocOptions & | dyn_alloc_sce, | ||
int | use_static_paths, | ||
const std::vector< PathShop > & | pathshops, | ||
adjacency_map_t & | adjacency_map, | ||
vector< types::NodeId > & | relevant_nodes, | ||
const std::multimap< int, int > & | nodes_in_polygons, | ||
std::vector< Node * > & | nodes, | ||
std::vector< Metier * > & | metiers, | ||
std::ofstream & | freq_cpue, | ||
std::ofstream & | freq_distance | ||
) |
void Vessel::clear_catch_pop_at_szgroup | ( | ) |
void Vessel::clear_cumcatch_and_cumeffort | ( | ) |
void Vessel::clear_discards_pop_at_szgroup | ( | ) |
void Vessel::clear_idx_used_metiers_this_trip | ( | ) |
void Vessel::clear_ping_catch_pop_at_szgroup | ( | ) |
void Vessel::compute_experiencedcpue_fgrounds | ( | ) |
void Vessel::compute_experiencedcpue_fgrounds_per_pop | ( | ) |
void Vessel::do_catch | ( | std::ofstream & | export_individual_tacs, |
std::vector< Population * > & | populations, | ||
std::vector< Node * > & | nodes, | ||
vector< Benthos * > & | benthoshabs, | ||
std::vector< int > & | implicit_pops, | ||
vector< int > & | grouped_tacs, | ||
int & | tstep, | ||
vector< double > & | graph_res, | ||
bool & | is_tacs, | ||
bool & | is_individual_vessel_quotas, | ||
bool & | check_all_stocks_before_going_fishing, | ||
bool & | is_discard_ban, | ||
bool & | is_grouped_tacs, | ||
double & | tech_creeping_multiplier, | ||
bool & | is_fishing_credits, | ||
bool & | direct_killing_on_benthos, | ||
bool & | resuspension_effect_on_benthos, | ||
bool & | is_benthos_in_numbers | ||
) |
void Vessel::erode_roadmap | ( | ) |
vector< double > Vessel::expected_profit_on_grounds | ( | int | use_static_paths, |
vector< Node * > & | nodes, | ||
const std::vector< types::NodeId > & | relevant_nodes, | ||
const std::vector< PathShop > & | pathshops | ||
) |
void Vessel::export_loglike_prop_met | ( | std::ofstream & | loglike_prop_met, |
int | tstep, | ||
int | nbpops | ||
) |
void Vessel::find_next_point_on_the_graph | ( | std::vector< Node * > & | nodes | ) |
|
protected |
double Vessel::get_annual_depreciation_rate | ( | ) | const |
double Vessel::get_annual_discount_rate | ( | ) | const |
double Vessel::get_annual_insurance_costs_per_crew | ( | ) | const |
double Vessel::get_annual_other_income | ( | ) | const |
double Vessel::get_av_trip_duration | ( | ) | const |
double Vessel::get_BER | ( | ) | const |
double Vessel::get_carrycapacity | ( | ) | const |
const vector< vector< double > > & Vessel::get_catch_pop_at_szgroup | ( | ) | const |
double Vessel::get_consotogetthere | ( | ) | const |
double Vessel::get_course | ( | ) | const |
double Vessel::get_CRBER | ( | ) | const |
double Vessel::get_crewshare_and_unpaid_labour_costs_percent | ( | ) | const |
const vector< double > & Vessel::get_cumcatch_fgrounds | ( | ) | const |
const vector< vector< double > > & Vessel::get_cumcatch_fgrounds_per_pop | ( | ) | const |
double Vessel::get_cumcatches | ( | ) | const |
const vector< double > & Vessel::get_cumdiscard_fgrounds | ( | ) | const |
const vector< vector< double > > & Vessel::get_cumdiscard_fgrounds_per_pop | ( | ) | const |
double Vessel::get_cumdiscards | ( | ) | const |
const vector< double > & Vessel::get_cumeffort_fgrounds | ( | ) | const |
double Vessel::get_cumfuelcons | ( | ) | const |
double Vessel::get_cumsteaming | ( | ) | const |
const vector< vector< double > > & Vessel::get_discards_pop_at_szgroup | ( | ) | const |
double Vessel::get_distprevpos | ( | ) | const |
double Vessel::get_effort_multiplier | ( | ) | const |
const vector< double > & Vessel::get_experienced_avoided_stks_bycatch_prop_on_fgrounds | ( | ) | const |
const vector< double > & Vessel::get_experienced_bycatch_prop_on_fgrounds | ( | ) | const |
const vector< double > & Vessel::get_experiencedcpue_fgrounds | ( | ) | const |
const vector< vector< double > > & Vessel::get_experiencedcpue_fgrounds_per_pop | ( | ) | const |
const vector< types::NodeId > & Vessel::get_fgrounds | ( | ) | const |
vector< types::NodeId > & Vessel::get_fgrounds_in_closed_areas | ( | ) |
const vector< types::NodeId > & Vessel::get_fgrounds_init | ( | ) | const |
int Vessel::get_firm_id | ( | ) | const |
const vector< double > & Vessel::get_fishing_credits | ( | ) | const |
const vector< double > & Vessel::get_freq_experiencedcpue_fgrounds | ( | ) | const |
const vector< vector< double > > & Vessel::get_freq_experiencedcpue_fgrounds_per_pop | ( | ) | const |
const vector< double > & Vessel::get_freq_fgrounds | ( | ) | const |
const vector< double > & Vessel::get_freq_fgrounds_init | ( | ) | const |
const vector< double > & Vessel::get_freq_harbours | ( | ) | const |
const multimap< types::NodeId, double > & Vessel::get_freq_possible_metiers | ( | ) | const |
double Vessel::get_fuelcons | ( | ) | const |
double Vessel::get_GrossProfit | ( | ) | const |
const vector< vector< double > > & Vessel::get_gscale_cpue_nodes_species | ( | ) | const |
const vector< vector< double > > & Vessel::get_gshape_cpue_nodes_species | ( | ) | const |
double Vessel::get_GVA | ( | ) | const |
double Vessel::get_GVAPerFTE | ( | ) | const |
double Vessel::get_GVAPerRevenue | ( | ) | const |
const vector< types::NodeId > & Vessel::get_harbours | ( | ) | const |
types::NodeId Vessel::get_highpotentialcatch | ( | ) | const |
int Vessel::get_idx | ( | ) | const |
const vector< int > & Vessel::get_idx_used_metiers_this_trip | ( | ) |
bool Vessel::get_inactive | ( | ) | const |
int Vessel::get_individual_tac | ( | int | sp | ) | const |
int Vessel::get_individual_tac_per_pop_at_year_start | ( | int | sp | ) | const |
bool Vessel::get_inharbour | ( | ) | const |
vector< double > Vessel::get_is_choked | ( | ) | const |
int Vessel::get_is_vessel_exited | ( | ) | const |
double Vessel::get_KW | ( | ) | const |
double Vessel::get_LabourSurplus | ( | ) | const |
double Vessel::get_landing_costs_percent | ( | ) | const |
double Vessel::get_length | ( | ) | const |
int Vessel::get_length_class | ( | ) | const |
Node * Vessel::get_loc | ( | ) | const |
types::NodeId Vessel::get_lowesttariff | ( | ) | const |
const std::vector< Node * > & Vessel::get_map_of_nodes | ( | ) | const |
Metier * Vessel::get_metier | ( | ) | const |
double Vessel::get_min_prop_remaining_global_quotas | ( | ) |
double Vessel::get_min_prop_remaining_global_quotas_on_avoided_stks | ( | ) |
double Vessel::get_min_prop_remaining_individual_quotas | ( | ) |
double Vessel::get_min_prop_remaining_individual_quotas_on_avoided_stks | ( | ) |
types::NodeId Vessel::get_mosthistoricallyused | ( | ) | const |
double Vessel::get_mult_fuelcons_when_fishing | ( | ) | const |
double Vessel::get_mult_fuelcons_when_inactive | ( | ) | const |
double Vessel::get_mult_fuelcons_when_returning | ( | ) | const |
double Vessel::get_mult_fuelcons_when_steaming | ( | ) | const |
string Vessel::get_name | ( | ) | const |
bool Vessel::get_natio | ( | ) | const |
string Vessel::get_nationality | ( | ) | const |
int Vessel::get_nbfpingspertrip | ( | ) | const |
double Vessel::get_NetPresentValue | ( | ) | const |
double Vessel::get_NetProfit | ( | ) | const |
double Vessel::get_NetProfitMargin | ( | ) | const |
types::NodeId Vessel::get_notthatfar | ( | ) | const |
int Vessel::get_numTrips | ( | ) | const |
double Vessel::get_opportunity_interest_rate | ( | ) | const |
double Vessel::get_other_annual_fixed_costs | ( | ) | const |
double Vessel::get_other_variable_costs_per_unit_effort | ( | ) | const |
const vector< double > & Vessel::get_percent_tac_per_pop | ( | ) | const |
const vector< vector< double > > & Vessel::get_ping_catch_pop_at_szgroup | ( | ) | const |
const multimap< types::NodeId, int > & Vessel::get_possible_metiers | ( | ) | const |
types::NodeId Vessel::get_previous_harbour_idx | ( | ) | const |
double Vessel::get_prop_remaining_global_quotas | ( | int | sp | ) | const |
double Vessel::get_prop_remaining_individual_quotas | ( | int | sp | ) | const |
int Vessel::get_reason_to_go_back | ( | ) | const |
double Vessel::get_resttime_par1 | ( | ) | const |
double Vessel::get_resttime_par2 | ( | ) | const |
const list< types::NodeId > & Vessel::get_roadmap | ( | ) | const |
double Vessel::get_RoFTA | ( | ) | const |
types::NodeId Vessel::get_smartcatch | ( | ) | const |
double Vessel::get_speed | ( | ) | const |
double Vessel::get_standard_annual_full_time_employement_hours | ( | ) | const |
double Vessel::get_standard_labour_hour_opportunity_costs | ( | ) | const |
int Vessel::get_state | ( | ) | const |
double Vessel::get_subsurfacesweptareathistrip | ( | ) | const |
double Vessel::get_sweptareathistrip | ( | ) | const |
double Vessel::get_tankcapacity | ( | ) | const |
int Vessel::get_targeting_non_tac_pop_only | ( | ) | const |
double Vessel::get_this_vessel_nb_crew | ( | ) | const |
double Vessel::get_timeatsea | ( | ) | const |
double Vessel::get_timeforrest | ( | ) | const |
double Vessel::get_traveled_dist_this_trip | ( | ) | const |
int Vessel::get_tstep_dep | ( | ) | const |
const vector< double > & Vessel::get_vessel_betas_per_pop | ( | ) | const |
double Vessel::get_vessel_value | ( | ) | const |
int Vessel::get_vid_is_active | ( | ) | const |
int Vessel::get_vid_is_part_of_ref_fleet | ( | ) | const |
double Vessel::get_x | ( | ) | const |
double Vessel::get_y | ( | ) | const |
|
inline |
|
inline |
double Vessel::getDaysSpentInRestrictedAreaThisMonth | ( | int | idx_met | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
void Vessel::init_cpue_nodes_species | ( | int | nbnodes, |
int | nbspecies | ||
) |
void Vessel::init_gscale_cpue_nodes_species | ( | int | nbnodes, |
int | nbspecies | ||
) |
void Vessel::init_gshape_cpue_nodes_species | ( | int | nbnodes, |
int | nbspecies | ||
) |
|
inline |
void Vessel::move_to | ( | double | nx, |
double | ny | ||
) |
void Vessel::move_to | ( | Node * | next_node | ) |
|
static |
int Vessel::read_message | ( | ) | const |
void Vessel::receive_message | ( | int | message | ) |
void Vessel::reinit_after_a_trip | ( | ) |
void Vessel::reinitDaysSpentInRestrictedAreaThisMonthtoZero | ( | ) |
void Vessel::reset_message | ( | ) |
void Vessel::set_av_trip_duration | ( | double | val | ) |
void Vessel::set_consotogetthere | ( | double | _consotogetthere | ) |
void Vessel::set_course | ( | double | val | ) |
void Vessel::set_cpue_nodes_species | ( | int | sp, |
const std::vector< double > & | newval | ||
) |
void Vessel::set_cumcatch_fgrounds | ( | const std::vector< double > & | newval | ) |
void Vessel::set_cumcatch_fgrounds_per_pop | ( | const std::vector< std::vector< double > > & | newval | ) |
void Vessel::set_cumcatches | ( | double | _cumcatches | ) |
void Vessel::set_cumdiscard_fgrounds | ( | const std::vector< double > & | newval | ) |
void Vessel::set_cumdiscard_fgrounds_per_pop | ( | const std::vector< std::vector< double > > & | newval | ) |
void Vessel::set_cumdiscards | ( | double | _cumdiscards | ) |
void Vessel::set_cumeffort_fgrounds | ( | const std::vector< double > & | newval | ) |
void Vessel::set_cumfuelcons | ( | double | _cumfuelcons | ) |
void Vessel::set_cumsteaming | ( | double | _cumsteaming | ) |
void Vessel::set_distprevpos | ( | double | _distprevpos | ) |
void Vessel::set_effort_multiplier | ( | double | multi | ) |
void Vessel::set_experienced_avoided_stks_bycatch_prop_on_fgrounds | ( | const std::vector< double > & | newval | ) |
void Vessel::set_experienced_bycatch_prop_on_fgrounds | ( | const std::vector< double > & | newval | ) |
void Vessel::set_experiencedcpue_fgrounds | ( | const std::vector< double > & | newval | ) |
void Vessel::set_experiencedcpue_fgrounds_per_pop | ( | const std::vector< std::vector< double > > & | newval | ) |
void Vessel::set_fgrounds | ( | int | val | ) |
void Vessel::set_fgrounds_in_closed_areas | ( | const vector< types::NodeId > & | _fgrounds | ) |
void Vessel::set_fgrounds_init | ( | int | val | ) |
void Vessel::set_firm_id | ( | int | val | ) |
void Vessel::set_fishing_credits | ( | const std::vector< double > & | _fishing_credits | ) |
void Vessel::set_freq_experiencedcpue_fgrounds | ( | const std::vector< double > & | newval | ) |
void Vessel::set_freq_experiencedcpue_fgrounds_per_pop | ( | const std::vector< std::vector< double > > & | newval | ) |
void Vessel::set_fuelcons | ( | double | val | ) |
void Vessel::set_gscale_cpue_nodes_species | ( | int | sp, |
const std::vector< double > & | newval | ||
) |
void Vessel::set_gshape_cpue_nodes_species | ( | int | sp, |
const std::vector< double > & | newval | ||
) |
void Vessel::set_harbours | ( | int | val | ) |
void Vessel::set_highpotentialcatch | ( | types::NodeId | highpotentialcatch | ) |
void Vessel::set_inactive | ( | bool | logic | ) |
void Vessel::set_individual_tac_this_pop | ( | std::ofstream & | export_individual_tacs, |
int | tstep, | ||
std::vector< Population * > & | populations, | ||
std::vector< int > | implicit_pops, | ||
int | pop, | ||
int | init, | ||
double | a_tac | ||
) |
void Vessel::set_inharbour | ( | bool | logic | ) |
void Vessel::set_is_choked | ( | int | pop, |
int | val | ||
) |
void Vessel::set_lowesttariff | ( | types::NodeId | lowesttariff | ) |
void Vessel::set_map_of_nodes | ( | const vector< Node * > & | _map_of_nodes | ) |
void Vessel::set_metier | ( | Metier * | new_metier | ) |
void Vessel::set_mosthistoricallyused | ( | types::NodeId | mosthistoricallyused | ) |
void Vessel::set_natio | ( | bool | logic | ) |
void Vessel::set_nbfpingspertrip | ( | int | _nbfpingspertrip | ) |
void Vessel::set_next_xy | ( | double | nx, |
double | ny | ||
) |
void Vessel::set_notthatfar | ( | types::NodeId | notthatfar | ) |
void Vessel::set_previous_harbour_idx | ( | types::NodeId | previous_harbour_idx | ) |
void Vessel::set_reason_to_go_back | ( | int | _reason_to_go_back | ) |
void Vessel::set_resttime_par1 | ( | double | val | ) |
void Vessel::set_resttime_par2 | ( | double | val | ) |
void Vessel::set_roadmap | ( | const std::list< types::NodeId > & | _roadmap | ) |
void Vessel::set_smartcatch | ( | types::NodeId | smartcatch | ) |
void Vessel::set_spe_betas_per_pop | ( | const std::vector< double > & | _betas_per_pop | ) |
void Vessel::set_spe_cumcatch_fgrounds | ( | const std::vector< double > & | _cumcatch | ) |
void Vessel::set_spe_cumdiscard_fgrounds | ( | const std::vector< double > & | _cumdiscard | ) |
void Vessel::set_spe_cumeffort_fgrounds | ( | const std::vector< double > & | _cumeffort | ) |
void Vessel::set_spe_experienced_avoided_stks_bycatch_prop_on_fgrounds | ( | const std::vector< double > & | _experienced_avoided_stks_bycatch_prop_on_fgrounds | ) |
void Vessel::set_spe_experienced_bycatch_prop_on_fgrounds | ( | const std::vector< double > & | _experienced_bycatch_prop_on_fgrounds | ) |
void Vessel::set_spe_experiencedcpue_fgrounds | ( | const std::vector< double > & | _experiencedcpue | ) |
void Vessel::set_spe_fgrounds | ( | const vector< types::NodeId > & | _fgrounds | ) |
void Vessel::set_spe_fgrounds_init | ( | const vector< types::NodeId > & | _fgrounds_init | ) |
void Vessel::set_spe_freq_fground | ( | int | index, |
double | _fground | ||
) |
void Vessel::set_spe_freq_fgrounds | ( | const std::vector< double > & | _fgrounds | ) |
void Vessel::set_spe_freq_fgrounds_init | ( | const std::vector< double > & | _fgrounds_init | ) |
void Vessel::set_spe_freq_harbours | ( | const std::vector< double > & | _harbours | ) |
void Vessel::set_spe_freq_possible_metiers | ( | const std::multimap< types::NodeId, double > & | _freq_possible_metiers | ) |
void Vessel::set_spe_harbours | ( | const std::vector< types::NodeId > & | _harbours | ) |
void Vessel::set_spe_percent_tac_per_pop | ( | const std::vector< double > & | _tacs_per_pop | ) |
void Vessel::set_spe_possible_metiers | ( | const std::multimap< types::NodeId, int > & | _possible_metiers | ) |
void Vessel::set_speed | ( | double | val | ) |
void Vessel::set_state | ( | int | _state | ) |
void Vessel::set_subsurfacesweptareathistrip | ( | double | _subsurfacesweptareathistrip | ) |
void Vessel::set_sweptareathistrip | ( | double | _sweptareathistrip | ) |
void Vessel::set_targeting_non_tac_pop_only | ( | int | targeting_non_tac_pop_only | ) |
void Vessel::set_timeatsea | ( | double | _timeatsea | ) |
void Vessel::set_timeforrest | ( | double | _timeforrest | ) |
void Vessel::set_traveled_dist_this_trip | ( | double | _traveled_dist_this_trip | ) |
void Vessel::set_tstep_dep | ( | int | _tstep | ) |
void Vessel::set_vessel_exited | ( | int | logic | ) |
void Vessel::set_vessel_value | ( | double | val | ) |
void Vessel::set_vid_is_active | ( | int | val | ) |
void Vessel::set_vid_is_part_of_ref_fleet | ( | int | val | ) |
void Vessel::set_xy | ( | double | _x, |
double | _y | ||
) |
int Vessel::should_i_change_ground | ( | std::map< std::string, int > & | external_states, |
bool | use_the_tree | ||
) |
types::NodeId Vessel::should_i_choose_this_ground | ( | int | tstep, |
int | use_static_paths, | ||
std::vector< Node * > & | nodes, | ||
const std::vector< types::NodeId > & | relevant_nodes, | ||
const std::vector< PathShop > & | pathshops, | ||
const DynAllocOptions & | dyn_alloc_sce | ||
) |
int Vessel::should_i_choose_this_port | ( | std::map< std::string, int > & | external_states, |
bool | use_the_tree | ||
) |
int Vessel::should_i_go_fishing | ( | int | tstep, |
std::vector< Population * > & | populations, | ||
bool | use_the_tree, | ||
const DynAllocOptions & | dyn_alloc_sce, | ||
std::vector< int > & | implicit_pops, | ||
int | is_individual_vessel_quotas, | ||
int | check_all_stocks_before_going_fishing | ||
) |
int Vessel::should_i_stop_fishing | ( | const std::map< std::string, int > & | external_states, |
bool | use_the_tree, | ||
int | tstep, | ||
const DynAllocOptions & | dyn_alloc_sce, | ||
int | use_static_paths, | ||
const std::vector< PathShop > & | pathshops, | ||
adjacency_map_t & | adjacency_map, | ||
const vector< types::NodeId > & | relevant_nodes, | ||
std::vector< Node * > & | nodes, | ||
std::vector< Metier * > & | metiers, | ||
std::ofstream & | freq_cpue, | ||
std::ofstream & | freq_distance, | ||
std::vector< double > & | dist_to_ports | ||
) |
double Vessel::traverseDtree | ( | int | tstep, |
dtree::DecisionTree * | tree | ||
) |
Starting from the dtree root, traverse it evaluating any node and the relative Variable. The return value from StateEvaluator::evaluate() is rounded and casted to int to define the next node.
|
inline |
|
inline |
void Vessel::updateTripsStatistics | ( | const std::vector< Population * > & | populations, |
std::vector< int > & | implicit_pops, | ||
int | tstep, | ||
const DynAllocOptions & | dyn_alloc_sce | ||
) |
void Vessel::which_metier_should_i_go_for | ( | std::vector< Metier * > & | metiers | ) |
|
static |
the State evaluators. Since the current vessel is passed as variable to evaluate() we can put a static instance and avoid wasting a lot of memory. The table is initialized once in init() (lazy initialization)