Skip to content

Commit

Permalink
Introduce config variables for hull roughness
Browse files Browse the repository at this point in the history
MartinPontius committed Jan 25, 2024
1 parent 20fa853 commit 1c45dbd
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -70,6 +70,8 @@ Required variables (no default values provided):

Recommended variables (default values provided but might be inaccurate/unsuitable):
- `BOAT_DRAUGHT`: in m
- `BOAT_ROUGHNESS_DISTRIBUTION_LEVEL`: numeric value (default: 1)
- `BOAT_ROUGHNESS_LEVEL`: numeric value (default: 1)
- `BOAT_SPEED`: in m/s
- `DATA_MODE`: options: 'automatic', 'from_file', 'odc'

4 changes: 4 additions & 0 deletions WeatherRoutingTool/config.py
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@

RECOMMENDED_CONFIG_VARIABLES = {
'BOAT_DRAUGHT': 10,
'BOAT_ROUGHNESS_DISTRIBUTION_LEVEL': 1,
'BOAT_ROUGHNESS_LEVEL': 1,
'BOAT_SPEED': 6,
'DATA_MODE': 'automatic'
}
@@ -51,6 +53,8 @@ def __init__(self, init_mode='from_json', file_name=None, config_dict=None):
# Details in README
self.ALGORITHM_TYPE = None # options: 'isofuel', 'genetic', 'speedy_isobased'
self.BOAT_DRAUGHT = None # in m
self.BOAT_ROUGHNESS_DISTRIBUTION_LEVEL = None # numeric value
self.BOAT_ROUGHNESS_LEVEL = None # level of hull roughness, numeric value
self.BOAT_SPEED = None # in m/s
self.CONSTRAINTS_LIST = None # options: 'land_crossing_global_land_mask', 'land_crossing_polygons', 'seamarks',
# 'water_depth', 'on_map', 'via_waypoints'
2 changes: 2 additions & 0 deletions WeatherRoutingTool/ship/ship.py
Original file line number Diff line number Diff line change
@@ -126,6 +126,8 @@ def __init__(self, config):

self.hydro_model = mariPower.ship.CBT()
self.hydro_model.Draught = np.array([config.BOAT_DRAUGHT])
self.hydro_model.Roughness_Level = np.array([config.BOAT_ROUGHNESS_LEVEL])
self.hydro_model.Roughness_Distribution_Level = np.array([config.BOAT_ROUGHNESS_DISTRIBUTION_LEVEL])
self.use_depth_data = False

def set_ship_property(self, variable, value):

0 comments on commit 1c45dbd

Please sign in to comment.