DISPLACE  1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
displacemodel.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // DISPLACE: DYNAMIC INDIVIDUAL VESSEL-BASED SPATIAL PLANNING
3 // AND EFFORT DISPLACEMENT
4 // Copyright (c) 2012-2019 Francois Bastardie <fba@aqua.dtu.dk>
5 
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 // --------------------------------------------------------------------------
20 
21 #ifndef DISPLACEMODEL_H
22 #define DISPLACEMODEL_H
23 
24 #include <scenario.h>
25 #include <config.h>
26 #include <nodepenalty.h>
27 
28 #include <modelobjects/nodedata.h>
30 #include <modelobjects/firmdata.h>
31 #include <modelobjects/shipdata.h>
34 #include <modelobjects/benthos.h>
40 #include <outputfileparser.h>
41 #include <graphbuilder_shp.h>
42 #include <objects/metiersentity.h>
43 #include <utils/interestinglist.h>
45 #include <stats/benthosstats.h>
46 #include <stats/fishfarmsstats.h>
47 #include <stats/shipsstats.h>
48 #include <stats/windfarmsstats.h>
49 
50 #include <QObject>
51 #include <QString>
52 #include <QList>
53 #include <QMap>
54 #include <QThread>
55 #include <QMutex>
56 
57 #include <memory>
58 #include <functional>
59 
60 #include <ogrsf_frmts.h>
61 
62 #include <QDebug>
63 
64 class DbHelper;
66 class Calendar;
67 class MapsDataProvider;
68 
70 
71 class DisplaceModel : public QObject
72 {
73  Q_OBJECT
74 public:
78 
79  enum ModelType {
82  };
83 
86 
87  DisplaceModel();
89 
90  ModelType modelType() const { return mModelType; }
91 
93 
94  bool edit(QString modelname);
95  void setIndex(int idx) { mIndex = idx; }
96  int index() const { return mIndex; }
97 
98  bool load (QString path, ModelType type);
99  bool loadDatabase (QString path);
100  bool clearStats();
101  bool saveScenarioAs(const QString &path);
102  bool saveScenario();
103  bool saveConfig();
104 
105  std::shared_ptr<Calendar> calendar() const { return mCalendar; }
106 
108  void Q_DECL_DEPRECATED simulationEnded();
109 
110  // Getter
111  QString fullpath() const { return mFullPath; }
112  QString outDir() const { return mOutDir; }
113  QString inputName() const { return mInputName; }
114  QString basepath() const { return mBasePath; }
115  QString outputName() const { return mOutputName; }
116  void setOutDir(const QString &name) { mOutDir = name; }
117  void setOutputName(const QString &name) { mOutputName = name; }
118  QString simulationName() const { return mSimuName; }
119  void setSimulationName(const QString &name) { mSimuName = name; }
120  void setSimulationSqlStorage(const QString &path);
121 
122  QString linkedDatabase() const { return mLinkedDbName; }
123  bool isModelLoaded() const { return !mInputName.isEmpty(); }
124 
125  int getNBPops() const {
126  return mConfig.getNbpops();
127  }
128  int getNBBenthosPops() const {
129  return mConfig.getNbbenthospops();
130  }
131  int getSzGrupsCount() const {
132  return mConfig.getSzGroups();
133  }
134  int getBenthosIdx(int benthosId) const;
135 
136  QString getOutDir() const;
137  int getSimulationSteps() const;
138  void setSimulationSteps(int value);
139  int getUseStaticPaths() const;
140  void setUseStaticPaths(int value);
141 
142  /* Graphs operation */
143 
144  const QList<std::shared_ptr<HarbourData> > &getHarboursList() const { return mHarbours; }
145  int getHarboursCount() const;
146  QString getHarbourId(int idx) const;
147 
148  const QList<std::shared_ptr<NodeData> > &getNodesList() const { return mNodes; }
149  int getNodesCount() const;
150  QString getNodeId(int idx) const;
151  QList<std::shared_ptr<NodeData> > getAllNodesWithin (const QPointF &centerpoint, double dist_km) const;
152 
159  void updateNodesStatFromSimu(QString);
160 
161  const QList<std::shared_ptr<VesselData> > &getVesselList() const { return mVessels; }
162  int getVesselCount() const;
163  QString getVesselId(int idx) const;
164  void updateVessel (int tstep, int idx, float x, float y, float course, float fuel, int state );
165 
166  const QList<std::shared_ptr<FishfarmData> > &getFishfarmList() const { return mFishfarms; }
167  int getFishfarmsCount() const;
168  QString getFishfarmId(int idx) const;
169  void updateFishfarm (int idx, float x, float y);
170 
171 
172  const QList<std::shared_ptr<FirmData> > &getFirmList() const { return mFirms; }
173  int getFirmCount() const;
174  QString getFirmId(int idx) const;
175  void updateFirm (int idx, float x, float y);
176 
177 
178  const QList<std::shared_ptr<WindmillData> > &getWindmillList() const { return mWindmills; }
179  int getWindmillCount() const;
180  QString getWindmillId(int idx) const;
181  void updateWindmill (int idx, float x, float y);
182 
183  const QList<std::shared_ptr<ShipData> > &getShipList() const { return mShips; }
184  int getShipsCount() const;
185  QString getShipId(int idx) const;
186  void updateShip (int tstep, int idx, float x, float y, float course);
187 
188  const QList<std::shared_ptr<Benthos> > &getBenthosList() const { return mBenthos; }
189  int getBenthosCount() const;
190 
191  const QList<std::shared_ptr<objecttree::MetiersInterest> > &getMetiersList() const { return mMetiers; }
192  int getMetiersCount() const {
193  return mMetiers.size();
194  }
195  void addMetier(int id);
196 
197  /* Access to Population statistics */
198  int getPopulationsCount() const;
199  int getBenthosPopulationsCount() const;
200  const QList<std::shared_ptr<PopulationData> > &getPopulationsList() const { return mPops; }
201  const PopulationData &getPop(int idx) const { return *mPops.at(idx); }
202 
203  /* Access to Nations statistics */
204 
205  const QList<std::shared_ptr<NationData> > &getNationsList() const { return mNations; }
206  const NationData &getNation(int idx) const { return *mNations.at(idx); }
207 
208  /* Access to Vessels statistics */
209 
210  const QList<std::shared_ptr<VesselData> > &getVesselsList() const { return mVessels; }
211  const VesselData &getVessel(int idx) const { return *mVessels.at(idx); }
212 
213  /* Access to Harbour statistics */
214 
215  const QList<std::shared_ptr<HarbourData> > &getHarbourList() const { return mHarbours; }
216  const HarbourData &getHarbourData(int idx) const { return *mHarbours.at(idx); }
217 
219  HarbourStats retrieveHarbourIdxStatAtStep (int idx, int step);
220 
221  /* Benthos Statistics */
222  const BenthosStatsContainer &getBenthosStatistics() { return mStatsBenthos; }
223 
224  /* Fishfarms Statistics */
225  const FishfarmsStatsContainer &getFishfarmsStatistics() { return mStatsFishfarms; }
226 
227  /* Ships Statistics */
228  const ShipsStatsContainer &getShipsStatistics() { return mStatsShips; }
229 
230  /* Scenario and configuration */
231 
232  Scenario scenario() const;
233  void setScenario(const Scenario &scenario);
234 
235  Config config() const;
236  void setConfig(const Config &config);
237 
238  /* Stock names */
239 
240  const QMap<QString, int> getStockNames() const { return mStockNames; }
241  void setStockNames (const QMap<QString,int> &names) { mStockNames = names; }
242 
243  /* Live Simulation data */
244 
245  void setCurrentStep(int step);
246  int getCurrentStep() const { return mCurrentStep; }
247  int getLastStep() const { return mLastStep; }
248 
249 
250  /* Interesting pop access functions */
251  const QList<int> &getInterestingPops() const { return mInterestingPop; }
252  const QList<int> &getInterestingPops2() const { return mInterestingPop2; }
253 
255  void setInterestingPop(int n);
256  void setInterestingPop2(int n);
257 
259  void remInterestingPop(int n);
260  void remInterestingPop2(int n);
261  bool isInterestingPop(int n);
262  bool isInterestingPop2(int n);
263  void clearInterestingPop();
264  void clearInterestingPop2();
265 
266  QList<int> getInterestingBenthos() const { return mInterestingBenthos.list(); }
267  void setInterestingBenthos(int n) { mInterestingBenthos.set(n); }
268  void remInterestingBenthos(int n) { mInterestingBenthos.rem(n); }
269  bool isInterestingBenthos(int n) const { return mInterestingBenthos.has(n); }
270  void clrInterestingBenthos() { mInterestingBenthos.clear(); }
271 
272  QList<int> getInterestingFishfarms() const { return mInterestingFishfarms.list(); }
273  void setInterestingFishfarms(int n) { mInterestingFishfarms.set(n); }
274  void remInterestingFishfarms(int n) { mInterestingFishfarms.rem(n); }
275  bool isInterestingFishfarms(int n) const { return mInterestingFishfarms.has(n); }
276  void clrInterestingFishfarms() { mInterestingFishfarms.clear(); }
277 
278  QList<int> getInterestingWindfarms() const { return mInterestingWindfarms.list(); }
279  void setInterestingWindfarms(int n) { mInterestingWindfarms.set(n); }
280  void remInterestingWindfarms(int n) { mInterestingWindfarms.rem(n); }
281  bool isInterestingWindfarms(int n) const { return mInterestingWindfarms.has(n); }
282  void clrInterestingWindfarms() { mInterestingWindfarms.clear(); }
283 
284  QList<int> getInterestingShips() const { return mInterestingShips.list(); }
285  void setInterestingShips(int n) { mInterestingShips.set(n); }
286  void remInterestingShips(int n) { mInterestingShips.rem(n); }
287  bool isInterestingShips(int n) const { return mInterestingShips.has(n); }
288  void clrInterestingShips() { mInterestingShips.clear(); }
289 
290  /* Interesting pop access functions */
291  bool isInterestingSizeTotal() const { return mInterestingSizeTotal; }
292  void setInterestingSizeTotal(bool b) { mInterestingSizeTotal = b; }
293  bool isInterestingSizeAvg() const { return mInterestingSizeAvg; }
294  void setInterestingSizeAvg(bool b) { mInterestingSizeAvg = b; }
295  bool isInterestingSizeMin() const { return mInterestingSizeMin; }
296  void setInterestingSizeMin(bool b) { mInterestingSizeMin = b; }
297  bool isInterestingSizeMax() const { return mInterestingSizeMax; }
298  void setInterestingSizeMax(bool b) { mInterestingSizeMax = b; }
299 
300  const QList<int> &getInterestingSizes() const { return mInterestingSizes; }
301 
302  int getNumFuncGroups() const;
303  std::shared_ptr<InterestingListWithSpecialValues<int>> getFunctionalGroupsList() const { return mFuncGroups; }
304 
305  int getNumFishfarmsTypes() const;
306  std::shared_ptr<InterestingListWithSpecialValues<int>> getFishfarmsTypesList() const { return mFishfarmsTypes; }
307 
308  int getNumWindfarmsTypes() const;
309  std::shared_ptr<InterestingListWithSpecialValues<int>> getWindfarmsTypesList() const { return mWindfarmsTypes; }
310 
311  int getNumShipsTypes() const;
312  std::shared_ptr<InterestingListWithSpecialValues<int>> getShipsTypesList() const { return mShipsTypes; }
313 
315  void setInterestingSize(int n);
316 
318  void remInterestingSize(int n);
319  bool isInterestingSize(int n);
320 
321  /* Interesting harbours - see pop */
322  const QList<types::NodeId> &getInterestingHarbours() const { return mInterestingHarb; }
323 
326 
330 
331  /* Interesting Nations */
332  const QList<int> &getInterestingNations() const { return mInterestingNations; }
333 
334 
336  void setInterestingNations(int n) {
337  if (!mInterestingNations.contains(n))
338  mInterestingNations.append(n);
339  qSort(mInterestingNations);
340  }
341 
343  void remInterestingNations(int n) {
344  mInterestingNations.removeAll(n);
345  }
346  bool isInterestingNations(int n) {
347  return mInterestingNations.contains(n);
348  }
349 
350 
351  /* Interesting Vessels */
352  const QList<int> &getInterestingVessels() const { return mInterestingVessels; }
353 
354  void setInterestingVessels(int n) {
355  if (!mInterestingVessels.contains(n))
356  mInterestingVessels.append(n);
357  qSort(mInterestingVessels);
358  }
359 
361  void remInterestingVessels(int n) {
362  mInterestingVessels.removeAll(n);
363  }
364  bool isInterestingVessels(int n) {
365  return mInterestingVessels.contains(n);
366  }
367 
368 
369 
370  //
371 
372  QString getLastError() const { return mLastError; }
373 
374  void parseOutputStatsFile (QString file, int tstep);
375 
376  void commitNodesStatsFromSimu(int tstep, bool force = false);
377 
378  // Stats collecting. Must store data to db
379  void startCollectingStats();
380  void endCollectingStats();
381  void collectNodePopStats (int tstep, int node_idx, const QList<double> &stats, const QList<double> &stats_w, double tot, double wtot);
382  void collectPopCumftime(int step, int node_idx, double cumftime);
383  void collectPopCumsweptarea(int step, int node_idx, double cumsweptarea);
384  void collectPopCumsubsurfacesweptarea(int step, int node_idx, double cumsubsurfacesweptarea);
385  void collectPopCumcatches(int step, int node_idx, double cumcatches);
386  void collectPopCumcatchesWithThreshold(int step, int node_idx, double cumcatches_with_threshold);
387  void collectPopCumdiscards(int step, int node_idx, double cumdiscards);
388  void collectPopCumdiscardsratio(int step, int node_idx, double cumdiscardsratio);
389  void collectPopNbchoked(int step, int node_idx, double nbchoked);
390  void collectPopTariffs(int step, int node_idx, vector<double> tariffs);
391  void collectPopImpact(int step, int node_idx, int popid, double impact);
392  void collectPopCumcatchesPerPop(int step, int node_idx, int popid, double cumcatchesperpop);
393 
394  void collectSalinity(int step, int node_idx, double salinity);
395  void collectWind(int step, int node_idx, double wind);
396  void collectSST(int step, int node_idx, double sst);
397  void collectNitrogen(int step, int node_idx, double nitrogen);
398  void collectPhosphorus(int step, int node_idx, double phosphorus);
399  void collectOxygen(int step, int node_idx, double oxygen);
400  void collectDissolvedCarbon(int step, int node_idx, double dissolvedcarbon);
401  void collectBathymetry(int step, int node_idx, double bathymetry);
402  void collectShippingdensity(int step, int node_idx, double shippingdensity);
403  void collectSiltfraction(int step, int node_idx, double siltfraction);
404 
405 
406 
407  void collectPopBenthosBiomass(int step, int node_idx, int funcid, double benthosbiomass);
408  void collectPopBenthosNumber(int step, int node_idx, int funcid, double benthosnumber);
409  void collectPopBenthosMeanWeight (int step, int node_idx, int funcid, double meanweight);
410  void collectPopBenthosBiomassOverK(int step, int node_idx, int funcid, double benthosbiomassoverK);
411  void collectPopBenthosNumberOverK(int step, int node_idx, int funcid, double benthosnumberoverK);
412  void commitPopBenthosStats(int tstep);
413 
414  void collectFishfarmFishMeanWeight (int step, int node_idx, int farmid, int farmtype, double meanw_kg);
415  void collectFishfarmFishHarvestedKg (int step, int node_idx, int farmid, int farmtype, double fish_harvested_kg);
416  void collectFishfarmEggsHarvestedKg (int step, int node_idx, int farmid, int farmtype, double eggs_harvested_kg);
417  void collectFishfarmAnnualProfit (int step, int node_idx, int farmid, int farmtype, double fishfarm_annualprofit);
418  void collectFishfarmNetDischargeN (int step, int node_idx, int farmid, int farmtype, double fishfarm_netdischargeN);
419  void collectFishfarmNetDischargeP (int step, int node_idx, int farmid, int farmtype, double fishfarm_netdischargeP);
420  void collectFishfarmCumulNetDischargeN (int step, int node_idx, int farmid, int farmtype, double fishfarm_cumulnetdischargeN);
421  void collectFishfarmCumulNetDischargeP (int step, int node_idx, int farmid, int farmtype, double fishfarm_cumulnetdischargeP);
422  void commitFishfarmsStats(int tstep);
423 
424  void collectShipNbTransportedUnits (int step, int node_idx, int shipid, int shiptype, double nb_transported_units);
425  void collectShipFuelUseHour (int step, int node_idx, int shipid, int shiptype, double fuel_use_h);
426  void collectShipNOxEmissiongPerkW (int step, int node_idx, int shipid, int shiptype, double NOx_emission_gperkW);
427  void collectShipSOxEmissionPercentPerTotalFuelmass (int step, int node_idx, int shipid, int shiptype, double SOx_emission_percentpertotalfuelmass);
428  void collectShipGHGemissiongPerkW (int step, int node_idx, int shipid, int shiptype, double GHG_emission_gperkW);
429  void collectShipPMEemissiongPerkW (int step, int node_idx, int shipid, int shiptype, double PME_emission_gperkW);
430  void collectShipfuelUseLitre(int step, int node_idx, int shipid, int shiptype, double fuel_use_litre);
431  void collectShipNOxEmission (int step, int node_idx, int shipid, int shiptype, double NOx_emission);
432  void collectShipSOxEmission (int step, int node_idx, int shipid, int shiptype, double SOx_emission);
433  void collectShipGHGemission (int step, int node_idx, int shipid, int shiptype, double GHG_emission);
434  void collectShipPMEemission (int step, int node_idx, int shipid, int shiptype, double PME_emission);
435  void commitShipsStats(int tstep);
436 
437  void collectVesselStats (int step, const VesselStats &stats);
438  void commitVesselsStats(int tstep);
439 
440  /* Editor stuff */
441 
442  void clearAllNodes();
443  bool addGraph(const QList<GraphBuilder::Node> &points, MapObjectsController *controller);
444  bool removeNode(std::shared_ptr<NodeData> node);
445  int addEdge(std::shared_ptr<NodeData> nodedata, types::NodeId targetidx, double weight);
446  int addEdge(types::NodeId srcidx, types::NodeId targetidx, double weight);
447  bool exportGraph(const QString &path);
448  bool importHarbours (QList<std::shared_ptr<HarbourData> > &list);
449  void addPenaltyToNodesByAddWeight(const QList<QPointF> &poly, double weight, double nbOfDaysClosedPerMonth, bool onQ1, bool onQ2, bool onQ3, bool onQ4, vector<bool> checkedMonths, const vector<int> &checkedVesSizes, vector<int> bannedMetiers);
450  void addPenaltyToNodesByAddWeight(OGRGeometry *geometry, double weight, double nbOfDaysClosedPerMonth, bool onQ1, bool onQ2, bool onQ3, bool onQ4, vector<bool> checkedMonths, const vector<int> &checkedVesSizes, vector<int> bannedMetiers);
451 
452  const QList<displace::NodePenalty> getPenaltyCollection() const { return mPenaltyNodes; }
453 
454  bool isShortestPathFolderLinked() const { return !mShortestPathFolder.isEmpty(); }
455  void linkShortestPathFolder(QString path) { mShortestPathFolder = path; }
456  QString linkedShortestPathFolder() const { return mShortestPathFolder; }
457 
458  bool isGraphFolderLinked() const { return !mGraphFolder.isEmpty(); }
459  void linkGraphFolder(QString path) { mGraphFolder = path; }
460  QString linkedGraphFolder() const { return mGraphFolder; }
461 
462  void setLandscapeCodesFromFeature(OGRGeometry *geometry, int code);
463  void setWindFromFeature(OGRGeometry *geometry, double wind);
464  void setSSTFromFeature(OGRGeometry *geometry, double sst);
465  void setSalinityFromFeature(OGRGeometry *geometry, double psu);
466  void setNitrogenFromFeature(OGRGeometry *geometry, double nit);
467  void setPhosphorusFromFeature(OGRGeometry *geometry, double phos);
468  void setOxygenFromFeature(OGRGeometry *geometry, double oxygen);
469  void setDissolvedCarbonFromFeature(OGRGeometry *geometry, double dissc);
470  void setBenthosBiomassFromFeature(OGRGeometry *geometry, double bio);
471  void setBenthosNumberFromFeature(OGRGeometry *geometry, double nb);
472  void setAreaCodesFromFeature(OGRGeometry *geometry, int code);
473 
474  std::shared_ptr<SQLiteOutputStorage> getOutputStorage() const { return mOutSqlite; }
475 protected:
476  bool loadNodes();
477  bool loadVessels();
478  bool loadGraphs();
479  bool initShips();
480  bool initFirm();
481  bool initFishfarm();
482  bool initWindmill();
483  bool initBenthos();
484  bool initPopulations();
485  bool initNations();
486  void createFeaturesLayer();
487 
488  bool loadNodesFromDb();
489  bool loadVesselsFromDb();
490  bool loadFishfarmsFromDb();
491 
492  void checkStatsCollection(int tstep);
493  bool parse(const QString &path, QString *basepath, QString *inputname, QString *outputname);
494  void setCodeFromFeature(OGRGeometry *geometry, int code, std::function<void (std::shared_ptr<NodeData>, int)> func);
495  void setWdFromFeature(OGRGeometry *geometry, double wd, std::function<void (std::shared_ptr<NodeData>, int)> func);
496  void setTFromFeature(OGRGeometry *geometry, double t, std::function<void (std::shared_ptr<NodeData>, int)> func);
497  void setSalFromFeature(OGRGeometry *geometry, double sal, std::function<void (std::shared_ptr<NodeData>, int)> func);
498  void setNitroFromFeature(OGRGeometry *geometry, double sal, std::function<void (std::shared_ptr<NodeData>, int)> func);
499  void setPhosFromFeature(OGRGeometry *geometry, double sal, std::function<void (std::shared_ptr<NodeData>, int)> func);
500  void setOxyFromFeature(OGRGeometry *geometry, double sal, std::function<void (std::shared_ptr<NodeData>, int)> func);
501  void setDissoFromFeature(OGRGeometry *geometry, double sal, std::function<void (std::shared_ptr<NodeData>, int)> func);
502  void setBenthosBioFromFeature(OGRGeometry *geometry, double bio, std::function<void (std::shared_ptr<NodeData>, double)> func);
503  void setBenthosNbFromFeature(OGRGeometry *geometry, double bio, std::function<void (std::shared_ptr<NodeData>, double)> func);
504 
505 signals:
506  void parseOutput(QString, int);
507  void outputParsed();
508  void errorParsingStatsFile(QString);
509 
510 private:
511  mutable QMutex mMutex;
512 
513  ModelType mModelType;
514  DbHelper *mDb;
515  std::shared_ptr<MapsDataProvider> mMapsDataProvider;
516  std::shared_ptr<SQLiteOutputStorage> mOutSqlite;
517  std::shared_ptr<Calendar> mCalendar;
518  QString mOutDir;
519  QString mFullPath;
520  QString mInputName;
521  QString mBasePath;
522  QString mOutputName;
523  QString mSimuName;
524  QString mLinkedDbName;
525  int mIndex;
526 
527  int mSimulSteps;
528  int mUseStaticPaths;
529  int mCurrentStep, mLastStep;
530  int mLastStats;
531  bool mNodesStatsDirty;
532  bool mVesselsStatsDirty; // TODO: refactor this using an opaque class as for FishFarms
533  int m_vessel_last_step; // TODO: Same as above
534  bool mFirmsStatsDirty;
535  bool mShipsStatsDirty;
536 
537  Scenario mScenario;
538  Config mConfig;
539 
540  QList<int> mInterestingPop;
541  QList<int> mInterestingPop2;
542  bool mInterestingSizeTotal, mInterestingSizeAvg, mInterestingSizeMin, mInterestingSizeMax;
543  QList<int> mInterestingSizes;
544  QList<types::NodeId> mInterestingHarb;
545  QList<int> mInterestingNations;
546  QList<int> mInterestingVessels;
547  InterestingList<int> mInterestingBenthos;
548  InterestingList<int> mInterestingFishfarms;
549  InterestingList<int> mInterestingWindfarms;
550  InterestingList<int> mInterestingShips;
551  std::shared_ptr<InterestingListWithSpecialValues<int>> mFuncGroups;
552  std::shared_ptr<InterestingListWithSpecialValues<int>> mFishfarmsTypes;
553  std::shared_ptr<InterestingListWithSpecialValues<int>> mWindfarmsTypes;
554 
555  std::shared_ptr<InterestingListWithSpecialValues<int>> mShipsTypes;
556 
557  QList<displace::NodePenalty> mPenaltyNodes;
558  QList<std::shared_ptr<HarbourData>> mHarbours;
559  QList<std::shared_ptr<NodeData> > mNodes;
560  QList<std::shared_ptr<VesselData> > mVessels;
561  QList<std::shared_ptr<PopulationData> > mPops;
562  QList<std::shared_ptr<FishfarmData> > mFishfarms;
563  QList<std::shared_ptr<FirmData> > mFirms;
564  QList<std::shared_ptr<WindmillData> > mWindmills;
565  QList<std::shared_ptr<ShipData> > mShips;
566  QList<std::shared_ptr<Benthos> > mBenthos;
567  QList<std::shared_ptr<objecttree::MetiersInterest>> mMetiers;
568 
569  QList<std::shared_ptr<NationData> > mNations;
570  BenthosStatsContainer mStatsBenthos;
571  BenthosStats mStatsBenthosCollected;
572  FishfarmsStatsContainer mStatsFishfarms;
573  FishfarmsStats mStatsFishfarmsCollected;
574  ShipsStatsContainer mStatsShips;
575 
576  ShipsStats mStatsShipsCollected;
577  QMap<int, std::shared_ptr<Benthos> > mBenthosInfo;
578  QMap<int, std::shared_ptr<Fishfarm> > mFishfarmInfo;
579 
580  QMap<QString, int> mStockNames;
581 
582  // --- Working objects
583  OutputFileParser *mOutputFileParser;
584 
585  QThread *mParserThread;
586 
587  QString mLastError;
588  /* Editor stuff */
589  enum OgrType { OgrTypeNode = 0, OgrTypeEdge = 1 };
590  GDALDataset *mDataSource;
591  OGRLayer *mNodesLayer;
592 
593  int mNodesLayerIndex;
594 
595  OGRSpatialReference *mSpatialRef;
596  QString mShortestPathFolder;
597 
598  QString mGraphFolder;
599 };
600 
601 #endif // DISPLACEMODEL_H
void collectShipGHGemission(int step, int node_idx, int shipid, int shiptype, double GHG_emission)
Definition: displacemodel.cpp:949
void collectFishfarmCumulNetDischargeN(int step, int node_idx, int farmid, int farmtype, double fishfarm_cumulnetdischargeN)
Definition: displacemodel.cpp:848
void Q_DECL_DEPRECATED simulationEnded()
Signals the simulation has ended. Flush all buffers.
Definition: displacemodel.cpp:335
bool loadDatabase(QString path)
Definition: displacemodel.cpp:251
int getVesselCount() const
Definition: displacemodel.cpp:1601
const FishfarmsStatsContainer & getFishfarmsStatistics()
Definition: displacemodel.h:225
void setIndex(int idx)
Definition: displacemodel.h:95
void collectWind(int step, int node_idx, double wind)
Definition: displacemodel.cpp:652
void setInterestingFishfarms(int n)
Definition: displacemodel.h:273
void setInterestingSizeMin(bool b)
Definition: displacemodel.h:296
void collectFishfarmNetDischargeP(int step, int node_idx, int farmid, int farmtype, double fishfarm_netdischargeP)
Definition: displacemodel.cpp:836
Definition: outputfileparser.h:53
void clear()
Definition: interestinglist.h:29
Definition: displacemodel.h:80
HistoricalDataCollector< FishfarmsStats > FishfarmsStatsContainer
Definition: displacemodel.h:76
void setCurrentStep(int step)
Definition: displacemodel.cpp:1762
HistoricalDataCollector< BenthosStats > BenthosStatsContainer
Definition: displacemodel.h:75
QList< int > getInterestingWindfarms() const
Definition: displacemodel.h:278
void addMetier(int id)
Definition: displacemodel.cpp:1715
int getFishfarmsCount() const
Definition: displacemodel.cpp:1642
Definition: benthosstats.h:7
void collectShipSOxEmissionPercentPerTotalFuelmass(int step, int node_idx, int shipid, int shiptype, double SOx_emission_percentpertotalfuelmass)
Definition: displacemodel.cpp:899
Definition: nationdata.h:27
Definition: displacemodel.h:85
const QList< std::shared_ptr< WindmillData > > & getWindmillList() const
Definition: displacemodel.h:178
const QList< std::shared_ptr< FirmData > > & getFirmList() const
Definition: displacemodel.h:172
int getShipsCount() const
Definition: displacemodel.cpp:1622
int getHarboursCount() const
Definition: displacemodel.cpp:361
Scenario scenario() const
Definition: displacemodel.cpp:1741
void collectSST(int step, int node_idx, double sst)
Definition: displacemodel.cpp:666
bool saveConfig()
Definition: displacemodel.cpp:324
void parseOutput(QString, int)
Definition: moc_displacemodel.cpp:146
bool clearStats()
Definition: displacemodel.cpp:287
const QList< std::shared_ptr< objecttree::MetiersInterest > > & getMetiersList() const
Definition: displacemodel.h:191
bool loadNodesFromDb()
Definition: displacemodel.cpp:3442
void collectPopCumdiscards(int step, int node_idx, double cumdiscards)
Definition: displacemodel.cpp:587
int getWindmillCount() const
Definition: displacemodel.cpp:1653
int getNumShipsTypes() const
Definition: displacemodel.cpp:1836
void setConfig(const Config &config)
Definition: displacemodel.cpp:1756
void setOutDir(const QString &name)
Definition: displacemodel.h:116
void startCollectingStats()
Definition: displacemodel.cpp:535
QString inputName() const
Definition: displacemodel.h:113
void setTFromFeature(OGRGeometry *geometry, double t, std::function< void(std::shared_ptr< NodeData >, int)> func)
Definition: displacemodel.cpp:1378
void collectPopCumftime(int step, int node_idx, double cumftime)
Definition: displacemodel.cpp:552
void collectPopTariffs(int step, int node_idx, vector< double > tariffs)
Definition: displacemodel.cpp:608
bool isInterestingNations(int n)
Definition: displacemodel.h:346
void collectSalinity(int step, int node_idx, double salinity)
Definition: displacemodel.cpp:659
Config config() const
Definition: displacemodel.cpp:1751
int getNumWindfarmsTypes() const
Definition: displacemodel.cpp:1830
QList< int > getInterestingShips() const
Definition: displacemodel.h:284
void collectSiltfraction(int step, int node_idx, double siltfraction)
Definition: displacemodel.cpp:644
int index() const
Definition: displacemodel.h:96
void commitPopBenthosStats(int tstep)
Definition: displacemodel.cpp:757
std::shared_ptr< InterestingListWithSpecialValues< int > > getWindfarmsTypesList() const
Definition: displacemodel.h:309
void collectShipNOxEmission(int step, int node_idx, int shipid, int shiptype, double NOx_emission)
Definition: displacemodel.cpp:933
bool loadVesselsFromDb()
Definition: displacemodel.cpp:3450
int getNBPops() const
Definition: displacemodel.h:125
void collectVesselStats(int step, const VesselStats &stats)
Definition: displacemodel.cpp:965
void collectPopBenthosMeanWeight(int step, int node_idx, int funcid, double meanweight)
Definition: displacemodel.cpp:723
void collectNodePopStats(int tstep, int node_idx, const QList< double > &stats, const QList< double > &stats_w, double tot, double wtot)
Definition: displacemodel.cpp:543
void setInterestingPop2(int n)
Definition: displacemodel.cpp:1782
int getUseStaticPaths() const
Definition: displacemodel.cpp:437
Definition: harbourdata.h:29
void collectFishfarmFishMeanWeight(int step, int node_idx, int farmid, int farmtype, double meanw_kg)
Definition: displacemodel.cpp:772
void set(T n)
Definition: interestinglist.h:15
bool importHarbours(QList< std::shared_ptr< HarbourData > > &list)
Definition: displacemodel.cpp:1230
bool isInterestingPop(int n)
Definition: displacemodel.cpp:1799
void errorParsingStatsFile(QString)
Definition: moc_displacemodel.cpp:159
int getSimulationSteps() const
Definition: displacemodel.cpp:421
bool initWindmill()
Definition: displacemodel.cpp:3273
int getNBBenthosPops() const
Definition: displacemodel.h:128
void addPenaltyToNodesByAddWeight(const QList< QPointF > &poly, double weight, double nbOfDaysClosedPerMonth, bool onQ1, bool onQ2, bool onQ3, bool onQ4, vector< bool > checkedMonths, const vector< int > &checkedVesSizes, vector< int > bannedMetiers)
Definition: displacemodel.cpp:1247
void setDissolvedCarbonFromFeature(OGRGeometry *geometry, double dissc)
Definition: displacemodel.cpp:1316
void setInterestingShips(int n)
Definition: displacemodel.h:285
const QList< types::NodeId > & getInterestingHarbours() const
Definition: displacemodel.h:322
void updateShip(int tstep, int idx, float x, float y, float course)
Definition: displacemodel.cpp:1632
void collectPhosphorus(int step, int node_idx, double phosphorus)
Definition: displacemodel.cpp:680
const QList< std::shared_ptr< HarbourData > > & getHarbourList() const
Definition: displacemodel.h:215
void clrInterestingShips()
Definition: displacemodel.h:288
void collectFishfarmEggsHarvestedKg(int step, int node_idx, int farmid, int farmtype, double eggs_harvested_kg)
Definition: displacemodel.cpp:798
void commitShipsStats(int tstep)
Definition: displacemodel.cpp:515
void setBenthosBiomassFromFeature(OGRGeometry *geometry, double bio)
Definition: displacemodel.cpp:1325
std::shared_ptr< Calendar > calendar() const
Definition: displacemodel.h:105
const QList< int > & getInterestingVessels() const
Definition: displacemodel.h:352
void collectPopCumcatchesWithThreshold(int step, int node_idx, double cumcatches_with_threshold)
Definition: displacemodel.cpp:580
bool isInterestingVessels(int n)
Definition: displacemodel.h:364
QString getHarbourId(int idx) const
Definition: displacemodel.cpp:366
HarbourStats retrieveHarbourIdxStatAtStep(int idx, int step)
Definition: displacemodel.cpp:1732
void collectShipNbTransportedUnits(int step, int node_idx, int shipid, int shiptype, double nb_transported_units)
Definition: displacemodel.cpp:874
void setCodeFromFeature(OGRGeometry *geometry, int code, std::function< void(std::shared_ptr< NodeData >, int)> func)
Definition: displacemodel.cpp:1346
Definition: idtypes.h:52
int getNodesCount() const
Definition: displacemodel.cpp:371
QString outputName() const
Definition: displacemodel.h:115
bool isInterestingPop2(int n)
Definition: displacemodel.cpp:1804
void collectShipGHGemissiongPerkW(int step, int node_idx, int shipid, int shiptype, double GHG_emission_gperkW)
Definition: displacemodel.cpp:908
QList< std::shared_ptr< NodeData > > getAllNodesWithin(const QPointF &centerpoint, double dist_km) const
Definition: displacemodel.cpp:382
void setInterestingSize(int n)
insert the pop into the list of interest for pops
Definition: displacemodel.cpp:1842
void collectPopCumsweptarea(int step, int node_idx, double cumsweptarea)
Definition: displacemodel.cpp:559
QString outDir() const
Definition: displacemodel.h:112
int tstep
Definition: main.cpp:205
const QList< std::shared_ptr< FishfarmData > > & getFishfarmList() const
Definition: displacemodel.h:166
bool loadFishfarmsFromDb()
Definition: displacemodel.cpp:3460
int getNbpops() const
Definition: config.cpp:108
void setSimulationSteps(int value)
Definition: displacemodel.cpp:432
Definition: displacemodel.h:80
void setInterestingPop(int n)
insert the pop into the list of interest for pops
Definition: displacemodel.cpp:1775
void setInterestingSizeMax(bool b)
Definition: displacemodel.h:298
void remInterestingWindfarms(int n)
Definition: displacemodel.h:280
void collectDissolvedCarbon(int step, int node_idx, double dissolvedcarbon)
Definition: displacemodel.cpp:694
bool initNations()
Definition: displacemodel.cpp:3414
void collectPopBenthosNumber(int step, int node_idx, int funcid, double benthosnumber)
Definition: displacemodel.cpp:712
void setSalinityFromFeature(OGRGeometry *geometry, double psu)
Definition: displacemodel.cpp:1288
void collectFishfarmFishHarvestedKg(int step, int node_idx, int farmid, int farmtype, double fish_harvested_kg)
Definition: displacemodel.cpp:786
Definition: vesseldata.h:152
const QList< std::shared_ptr< VesselData > > & getVesselsList() const
Definition: displacemodel.h:210
void remInterestingShips(int n)
Definition: displacemodel.h:286
const QList< std::shared_ptr< VesselData > > & getVesselList() const
Definition: displacemodel.h:161
~DisplaceModel()
Definition: displacemodel.cpp:133
void remInterestingPop(int n)
remove the pop from the list of interest for pops
Definition: displacemodel.cpp:1789
bool isModelLoaded() const
Definition: displacemodel.h:123
Definition: calendar.h:51
QString getFirmId(int idx) const
Definition: displacemodel.cpp:1664
Definition: mapsdataprovider.h:9
void commitNodesStatsFromSimu(int tstep, bool force=false)
Definition: displacemodel.cpp:524
Definition: shipsstats.h:8
bool initPopulations()
Definition: displacemodel.cpp:3369
void collectPopBenthosBiomassOverK(int step, int node_idx, int funcid, double benthosbiomassoverK)
Definition: displacemodel.cpp:735
const NationData & getNation(int idx) const
Definition: displacemodel.h:206
int getSzGrupsCount() const
Definition: displacemodel.h:131
void setNitrogenFromFeature(OGRGeometry *geometry, double nit)
Definition: displacemodel.cpp:1295
void clearAllNodes()
Definition: displacemodel.cpp:1044
Definition: displacemodel.h:84
bool loadVessels()
Definition: displacemodel.cpp:2441
void setSimulationName(const QString &name)
Definition: displacemodel.h:119
int getBenthosPopulationsCount() const
Definition: displacemodel.cpp:1727
void setInterestingHarb(types::NodeId n)
insert the pop into the list of interest for pops
Definition: displacemodel.cpp:1859
bool loadGraphs()
Definition: displacemodel.cpp:2995
void outputParsed()
Definition: moc_displacemodel.cpp:153
bool isInterestingFishfarms(int n) const
Definition: displacemodel.h:275
void setWdFromFeature(OGRGeometry *geometry, double wd, std::function< void(std::shared_ptr< NodeData >, int)> func)
Definition: displacemodel.cpp:1362
void updateFishfarm(int idx, float x, float y)
Definition: displacemodel.cpp:1674
const BenthosStatsContainer & getBenthosStatistics()
Definition: displacemodel.h:222
MapsDataProvider & getMapDataProvider()
Definition: displacemodel.cpp:141
const PopulationData & getPop(int idx) const
Definition: displacemodel.h:201
int getNumFishfarmsTypes() const
Definition: displacemodel.cpp:1824
Definition: config.h:49
const QList< std::shared_ptr< HarbourData > > & getHarboursList() const
Definition: displacemodel.h:144
QString getVesselId(int idx) const
Definition: displacemodel.cpp:1606
void setBenthosNbFromFeature(OGRGeometry *geometry, double bio, std::function< void(std::shared_ptr< NodeData >, double)> func)
Definition: displacemodel.cpp:1490
int getSzGroups() const
Definition: config.cpp:129
bool exportGraph(const QString &path)
Definition: displacemodel.cpp:1212
bool initBenthos()
Definition: displacemodel.cpp:3334
const QList< std::shared_ptr< ShipData > > & getShipList() const
Definition: displacemodel.h:183
Definition: harbourdata.h:46
ModelType modelType() const
Definition: displacemodel.h:90
int getNbbenthospops() const
Definition: config.cpp:118
std::shared_ptr< InterestingListWithSpecialValues< int > > getFunctionalGroupsList() const
Definition: displacemodel.h:303
void setLandscapeCodesFromFeature(OGRGeometry *geometry, int code)
Definition: displacemodel.cpp:1267
const QList< std::shared_ptr< PopulationData > > & getPopulationsList() const
Definition: displacemodel.h:200
void setScenario(const Scenario &scenario)
Definition: displacemodel.cpp:1746
void remInterestingNations(int n)
remove the pop from the list of interest for pops
Definition: displacemodel.h:343
void createFeaturesLayer()
Definition: displacemodel.cpp:146
void setStockNames(const QMap< QString, int > &names)
Definition: displacemodel.h:241
std::shared_ptr< InterestingListWithSpecialValues< int > > getShipsTypesList() const
Definition: displacemodel.h:312
void collectFishfarmCumulNetDischargeP(int step, int node_idx, int farmid, int farmtype, double fishfarm_cumulnetdischargeP)
Definition: displacemodel.cpp:861
Definition: displacemodel.h:71
const QList< T > & list() const
Definition: interestinglist.h:37
void setWindFromFeature(OGRGeometry *geometry, double wind)
Definition: displacemodel.cpp:1274
QString basepath() const
Definition: displacemodel.h:114
int getMetiersCount() const
Definition: displacemodel.h:192
QString linkedGraphFolder() const
Definition: displacemodel.h:460
DisplaceModel()
Definition: displacemodel.cpp:47
void collectShipfuelUseLitre(int step, int node_idx, int shipid, int shiptype, double fuel_use_litre)
Definition: displacemodel.cpp:925
bool removeNode(std::shared_ptr< NodeData > node)
Definition: displacemodel.cpp:1140
const QList< std::shared_ptr< NationData > > & getNationsList() const
Definition: displacemodel.h:205
void collectPopImpact(int step, int node_idx, int popid, double impact)
Definition: displacemodel.cpp:616
void setSalFromFeature(OGRGeometry *geometry, double sal, std::function< void(std::shared_ptr< NodeData >, int)> func)
Definition: displacemodel.cpp:1394
void collectShipPMEemissiongPerkW(int step, int node_idx, int shipid, int shiptype, double PME_emission_gperkW)
Definition: displacemodel.cpp:916
void checkStatsCollection(int tstep)
Definition: displacemodel.cpp:413
void collectFishfarmAnnualProfit(int step, int node_idx, int farmid, int farmtype, double fishfarm_annualprofit)
Definition: displacemodel.cpp:811
void setInterestingNations(int n)
insert the pop into the list of interest for pops
Definition: displacemodel.h:336
std::shared_ptr< SQLiteOutputStorage > getOutputStorage() const
Definition: displacemodel.h:474
bool isInterestingShips(int n) const
Definition: displacemodel.h:287
std::pair< box, unsigned > value
Definition: diffusion.cpp:30
bool saveScenario()
Definition: displacemodel.cpp:313
void setOutputName(const QString &name)
Definition: displacemodel.h:117
QString getFishfarmId(int idx) const
Definition: displacemodel.cpp:1659
std::shared_ptr< InterestingListWithSpecialValues< int > > getFishfarmsTypesList() const
Definition: displacemodel.h:306
void clrInterestingFishfarms()
Definition: displacemodel.h:276
bool initFirm()
Definition: displacemodel.cpp:3291
bool isShortestPathFolderLinked() const
Definition: displacemodel.h:454
void remInterestingFishfarms(int n)
Definition: displacemodel.h:274
bool loadNodes()
Definition: displacemodel.cpp:1884
void collectShipPMEemission(int step, int node_idx, int shipid, int shiptype, double PME_emission)
Definition: displacemodel.cpp:957
QString getWindmillId(int idx) const
Definition: displacemodel.cpp:1669
bool isInterestingBenthos(int n) const
Definition: displacemodel.h:269
int getBenthosCount() const
Definition: displacemodel.cpp:1708
void parseOutputStatsFile(QString file, int tstep)
Definition: displacemodel.cpp:1876
void clearInterestingPop()
Definition: displacemodel.cpp:1809
const QList< int > & getInterestingNations() const
Definition: displacemodel.h:332
void updateVessel(int tstep, int idx, float x, float y, float course, float fuel, int state)
Definition: displacemodel.cpp:1611
HistoricalDataCollector< ShipsStats > ShipsStatsContainer
Definition: displacemodel.h:77
void remInterestingSize(int n)
remove the pop from the list of interest for pops
Definition: displacemodel.cpp:1849
Definition: fishfarmsstats.h:8
const QList< std::shared_ptr< NodeData > > & getNodesList() const
Definition: displacemodel.h:148
QString linkedDatabase() const
Definition: displacemodel.h:122
void setSimulationSqlStorage(const QString &path)
Definition: displacemodel.cpp:339
void setInterestingSizeAvg(bool b)
Definition: displacemodel.h:294
Definition: mapobjectscontroller.h:91
void endCollectingStats()
Definition: displacemodel.cpp:539
int getBenthosIdx(int benthosId) const
Definition: displacemodel.cpp:349
void collectNitrogen(int step, int node_idx, double nitrogen)
Definition: displacemodel.cpp:673
QString getLastError() const
Definition: displacemodel.h:372
Definition: statsutils.h:4
void setPhosphorusFromFeature(OGRGeometry *geometry, double phos)
Definition: displacemodel.cpp:1302
bool isInterestingHarb(types::NodeId n)
Definition: displacemodel.cpp:1871
void setDissoFromFeature(OGRGeometry *geometry, double sal, std::function< void(std::shared_ptr< NodeData >, int)> func)
Definition: displacemodel.cpp:1458
const QList< int > & getInterestingPops() const
Definition: displacemodel.h:251
void updateWindmill(int idx, float x, float y)
Definition: displacemodel.cpp:1696
QString getShipId(int idx) const
Definition: displacemodel.cpp:1627
void setNitroFromFeature(OGRGeometry *geometry, double sal, std::function< void(std::shared_ptr< NodeData >, int)> func)
Definition: displacemodel.cpp:1410
void collectPopBenthosBiomass(int step, int node_idx, int funcid, double benthosbiomass)
Definition: displacemodel.cpp:701
Definition: displacemodel.h:84
bool parse(const QString &path, QString *basepath, QString *inputname, QString *outputname)
Definition: displacemodel.cpp:234
void clrInterestingBenthos()
Definition: displacemodel.h:270
const QList< int > & getInterestingPops2() const
Definition: displacemodel.h:252
const HarbourData & getHarbourData(int idx) const
Definition: displacemodel.h:216
void setAreaCodesFromFeature(OGRGeometry *geometry, int code)
Definition: displacemodel.cpp:1339
bool isInterestingSizeTotal() const
Definition: displacemodel.h:291
const VesselData & getVessel(int idx) const
Definition: displacemodel.h:211
bool addGraph(const QList< GraphBuilder::Node > &points, MapObjectsController *controller)
Definition: displacemodel.cpp:1053
const QList< displace::NodePenalty > getPenaltyCollection() const
Definition: displacemodel.h:452
bool isInterestingSizeMax() const
Definition: displacemodel.h:297
int getCurrentStep() const
Definition: displacemodel.h:246
bool isInterestingWindfarms(int n) const
Definition: displacemodel.h:281
QList< int > getInterestingFishfarms() const
Definition: displacemodel.h:272
void remInterestingHarb(types::NodeId n)
remove the pop from the list of interest for pops
Definition: displacemodel.cpp:1866
void updateNodesStatFromSimu(QString)
receive a Stats update for nodes from the Simulator
Definition: displacemodel.cpp:448
int getFirmCount() const
Definition: displacemodel.cpp:1648
void collectPopCumcatches(int step, int node_idx, double cumcatches)
Definition: displacemodel.cpp:573
Definition: populationdata.h:26
void remInterestingBenthos(int n)
Definition: displacemodel.h:268
void setUseStaticPaths(int value)
Definition: displacemodel.cpp:442
void collectFishfarmNetDischargeN(int step, int node_idx, int farmid, int farmtype, double fishfarm_netdischargeN)
Definition: displacemodel.cpp:823
void setBenthosNumberFromFeature(OGRGeometry *geometry, double nb)
Definition: displacemodel.cpp:1332
Definition: vesseldata.h:31
void commitVesselsStats(int tstep)
Definition: displacemodel.cpp:1037
bool initShips()
Definition: displacemodel.cpp:3052
const QList< std::shared_ptr< Benthos > > & getBenthosList() const
Definition: displacemodel.h:188
void clrInterestingWindfarms()
Definition: displacemodel.h:282
Definition: sqliteoutputstorage.h:37
void collectPopNbchoked(int step, int node_idx, double nbchoked)
Definition: displacemodel.cpp:601
const QList< int > & getInterestingSizes() const
Definition: displacemodel.h:300
bool isInterestingSize(int n)
Definition: displacemodel.cpp:1854
bool isInterestingSizeMin() const
Definition: displacemodel.h:295
bool isInterestingSizeAvg() const
Definition: displacemodel.h:293
Definition: displacemodel.h:84
void linkGraphFolder(QString path)
Definition: displacemodel.h:459
bool saveScenarioAs(const QString &path)
Definition: displacemodel.cpp:304
SpecialGroups
Definition: displacemodel.h:84
void collectPopCumsubsurfacesweptarea(int step, int node_idx, double cumsubsurfacesweptarea)
Definition: displacemodel.cpp:566
QString linkedShortestPathFolder() const
Definition: displacemodel.h:456
int getNumFuncGroups() const
Definition: displacemodel.cpp:1819
void collectPopBenthosNumberOverK(int step, int node_idx, int funcid, double benthosnumberoverK)
Definition: displacemodel.cpp:746
void rem(T n)
Definition: interestinglist.h:21
bool edit(QString modelname)
Definition: displacemodel.cpp:162
Definition: dbhelper.h:66
int addEdge(std::shared_ptr< NodeData > nodedata, types::NodeId targetidx, double weight)
DisplaceModel::addEdge.
Definition: displacemodel.cpp:1179
void setOxyFromFeature(OGRGeometry *geometry, double sal, std::function< void(std::shared_ptr< NodeData >, int)> func)
Definition: displacemodel.cpp:1442
QString simulationName() const
Definition: displacemodel.h:118
void remInterestingPop2(int n)
Definition: displacemodel.cpp:1794
bool initFishfarm()
Definition: displacemodel.cpp:3123
ModelType
Definition: displacemodel.h:79
void clearInterestingPop2()
Definition: displacemodel.cpp:1814
const ShipsStatsContainer & getShipsStatistics()
Definition: displacemodel.h:228
int getLastStep() const
Definition: displacemodel.h:247
bool has(T n) const
Definition: interestinglist.h:25
void updateFirm(int idx, float x, float y)
Definition: displacemodel.cpp:1685
QString fullpath() const
Definition: displacemodel.h:111
void collectShipSOxEmission(int step, int node_idx, int shipid, int shiptype, double SOx_emission)
Definition: displacemodel.cpp:941
void setPhosFromFeature(OGRGeometry *geometry, double sal, std::function< void(std::shared_ptr< NodeData >, int)> func)
Definition: displacemodel.cpp:1426
void setOxygenFromFeature(OGRGeometry *geometry, double oxygen)
Definition: displacemodel.cpp:1309
void collectOxygen(int step, int node_idx, double oxygen)
Definition: displacemodel.cpp:687
Definition: displacemodel.h:84
void collectShippingdensity(int step, int node_idx, double shippingdensity)
Definition: displacemodel.cpp:637
void collectPopCumcatchesPerPop(int step, int node_idx, int popid, double cumcatchesperpop)
Definition: displacemodel.cpp:623
QList< int > getInterestingBenthos() const
Definition: displacemodel.h:266
bool isGraphFolderLinked() const
Definition: displacemodel.h:458
void remInterestingVessels(int n)
remove the pop from the list of interest for pops
Definition: displacemodel.h:361
QString getOutDir() const
Definition: displacemodel.cpp:426
void setBenthosBioFromFeature(OGRGeometry *geometry, double bio, std::function< void(std::shared_ptr< NodeData >, double)> func)
Definition: displacemodel.cpp:1474
void setInterestingWindfarms(int n)
Definition: displacemodel.h:279
Definition: displacemodel.h:80
void linkShortestPathFolder(QString path)
Definition: displacemodel.h:455
void collectShipNOxEmissiongPerkW(int step, int node_idx, int shipid, int shiptype, double NOx_emission_gperkW)
Definition: displacemodel.cpp:891
void setInterestingSizeTotal(bool b)
Definition: displacemodel.h:292
void collectBathymetry(int step, int node_idx, double bathymetry)
Definition: displacemodel.cpp:630
void collectPopCumdiscardsratio(int step, int node_idx, double cumdiscardsratio)
Definition: displacemodel.cpp:594
void setSSTFromFeature(OGRGeometry *geometry, double sst)
Definition: displacemodel.cpp:1281
Definition: scenario.h:51
void collectShipFuelUseHour(int step, int node_idx, int shipid, int shiptype, double fuel_use_h)
Definition: displacemodel.cpp:883
void setInterestingBenthos(int n)
Definition: displacemodel.h:267
const QMap< QString, int > getStockNames() const
Definition: displacemodel.h:240
void commitFishfarmsStats(int tstep)
Definition: displacemodel.cpp:506
bool load(QString path, ModelType type)
Definition: displacemodel.cpp:175
QString getNodeId(int idx) const
Definition: displacemodel.cpp:376
void setInterestingVessels(int n)
Definition: displacemodel.h:354
Definition: displacemodel.h:81
int getPopulationsCount() const
Definition: displacemodel.cpp:1722