Skip to content

Commit c237121

Browse files
committed
Check if all the fields are present in the vessel specification in GenerateVesselsConfigFiles
1 parent 1b40855 commit c237121

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

GenerateVesselsConfigFiles.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@
185185
vessel_specifications[i, "WorkHoursEnd"],
186186
vessel_specifications[i, "firm_id"]
187187
)
188+
if(length(vessel_features)!=19) stop("Missing field(s) in the vessel specification input file!!!")
189+
190+
191+
188192
step_in_share <- rep(vessel_specifications[i, "N..of.vessels"]/ sum(vessel_specifications[, "N..of.vessels"], na.rm=TRUE), nb_stocks)
189193
# i.e. 100 % of each TAC per stock will be booked for these new vessels
190194
# catch equation parameters: totcatch_inkgperhour_thisspecies = exp( vesselspe_sp + metierspe_sp + (avaispe_sp_szgr * avai_sp_szgr *1000 * gearsel_szgr ) )

RunVesselsConfigFiles.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ getPolyAroundACoord <- function(dat, a_dist_m){
319319
coord <- coord[sample(x=1:nrow(coord), size=ceiling(nrow(coord)*prop_to_keep), replace=FALSE ),]
320320
# => e.g. keep 100 % of the potential grounds by default...but you might reduce this prop if untractable simus
321321

322+
# caution if prop_to_keep<1 then you´ll potentially have to redo the shortPaths library each time this present routine is re-run....
322323
#-------------------------------------------------------------------------------
323324
#-------------------------------------------------------------------------------
324325

0 commit comments

Comments
 (0)