
Make Common Fleets Across Operating Models
MakeCommonFleets.RdCombines fleets within each single-stock OM, adds dummy fleets where required, and reorders all OMs so they share an identical fleet structure. Optionally saves the resulting OM objects to disk.
Usage
MakeCommonFleets(
OM_List = NULL,
CommonFleets,
StockFleetList,
OMpath = "Objects/OM",
save = TRUE
)Arguments
- OM_List
Optional named list of single-stock
omobjects. IfNULL(default), OMs are loaded fromOMpathviaLoadOM().- CommonFleets
Character vector of fleet names that every OM must contain after processing, in the desired order.
- StockFleetList
Named list where each element corresponds to a stock in
OM_List(matched by name) and contains a fleet list passed toMSEtool::CombineFleets(). Used to combine multiple fleets within each stock into a single fleet.- OMpath
Path to the directory containing OM objects. Used both for loading (when
OM_List = NULL) and saving. Defaults to"Objects/OM".- save
Logical. If
TRUE(default), each processed OM is saved to<OMpath>/MultiStock/<StockName>.om.
Value
A named list of processed om objects, returned invisibly. Each OM
has fleets combined per StockFleetList, dummy fleets added for any
missing CommonFleets, and all fleets reordered to match CommonFleets.
Processing proceeds in three steps:
Combine fleets — for each stock named in
StockFleetList,MSEtool::CombineFleets()is called with the supplied fleet list.Add dummy fleets —
MissingFleets()identifies anyCommonFleetsabsent from each OM;MSEtool::AddFleet()adds an empty placeholder for each.Reorder —
MSEtool::Reorder()reorders every OM's fleets to matchCommonFleetsexactly.
An error is thrown if, after steps 1 and 2, any OM contains fleets not in
CommonFleets, or if any name in StockFleetList is not found in
OM_List.