-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I have been trying to run the WRT with the genetic algorithm but it seems to run upto the init phase and then crash.
I have selected an appropriate bounding box and downloaded the weather and depth data. Here's my config.json file:
{
"DEFAULT_MAP": [55.412,17.771, 55.575, 17.947],
"DEFAULT_ROUTE": [55.421,17.776,55.527,17.913],
"DEPARTURE_TIME": "2025-09-11T11:11Z",
"CONSTRAINTS_LIST":["land_crossing_global_land_mask", "water_depth", "on_map"],
"DEPTH_DATA": "/home/ash/code/wrt/depth_data.nc",
"WEATHER_DATA": "/home/ash/code/wrt/weather_data.nc",
"ROUTE_PATH": "/home/ash/code/wrt/route.json",
"COURSES_FILE":"/home/ash/code/wrt/courses",
"INTERMEDIATE_WAYPOINTS":[[55.47265, 17.826]],
"BOAT_TYPE": "direct_power_method",
"BOAT_LENGTH": 180,
"BOAT_BREADTH": 32,
"BOAT_HBR": 40,
"BOAT_SMCR_POWER" : 12000,
"BOAT_FUEL_RATE": 225,
"BOAT_SPEED": 6.2,
"BOAT_SMCR_SPEED":7.2,
"ALGORITHM_TYPE":"genetic",
"GENETIC_NUMBER_GENERATIONS": 20,
"GENETIC_NUMBER_OFFSPRINGS":2,
"GENETIC_POPULATION_SIZE":4,
"GENETIC_POPULATION_TYPE": "grid_based"
}
On running cli.py with the above config, I get the following (with debug=True):
2026-03-15 10:04:19,210 - WRT.Config : INFO arrival time: None
2026-03-15 10:04:19,210 - WRT.Config : INFO speed: 6.2
2026-03-15 10:04:19,210 - WRT.Config : DEBUG Config is valid!
2026-03-15 10:04:19,210 - WRT.ShipConfig: DEBUG ShipConfig is valid!
---------------------------------------------------
2026-03-15 10:04:19,210 - WRT.weather : INFO Initialising weather
2026-03-15 10:04:19,210 - WRT.weather : INFO Reading weather data from file: /home/ash/code/wrt/weather_data.nc
2026-03-15 10:04:19,210 - WRT.weather : INFO time resolution: 3:00:00 hours
2026-03-15 10:04:19,211 - WRT.weather : DEBUG Reading dataset from/home/ash/code/wrt/weather_data.nc
2026-03-15 10:04:19,227 - WRT.weather : INFO forecast from 2025-09-11 09:00:00 to 2025-09-15 06:00:00
2026-03-15 10:04:19,227 - WRT.weather : INFO nof time steps 31
---------------------------------------------------
---------------------------------------------------
2026-03-15 10:04:19,227 - WRT : INFO Initialising ship
2026-03-15 10:04:19,227 - WRT : INFO Use direct power method for modeling fuel consumption.
2026-03-15 10:04:19,230 - WRT.ship : INFO The boat speed provided is assumed to be the speed that corresponds to 75% SMCR power.
2026-03-15 10:04:19,232 - WRT.ship : INFO SMCR power: 9000.0 kW
2026-03-15 10:04:19,232 - WRT.ship : INFO SMCR speed: 7.2 m / s
2026-03-15 10:04:19,232 - WRT.ship : INFO fuel rate: 0.225 kg / (h kW)
---------------------------------------------------
2026-03-15 10:04:19,232 - WRT.Constraints: INFO Downloading depth data from file: /home/ash/code/wrt/depth_data.nc
2026-03-15 10:04:19,237 - WRT.Constraints: INFO Downloading depth data from file: /home/ash/code/wrt/depth_data.nc
---------------------------------------------------
2026-03-15 10:04:19,241 - WRT.Constraints: DEBUG Print settings of Constraint Pars:
2026-03-15 10:04:19,241 - WRT.Constraints: DEBUG resolution=0.05
2026-03-15 10:04:19,241 - WRT.Constraints: DEBUG bCheckEndPoints=True
2026-03-15 10:04:19,241 - WRT.Constraints: INFO Constraints activated:
2026-03-15 10:04:19,241 - WRT.Constraints: INFO no land crossing
2026-03-15 10:04:19,241 - WRT.Constraints: INFO minimum water depth=30.0m
2026-03-15 10:04:19,241 - WRT.Constraints: INFO stay on wheather map
---------------------------------------------------
---------------------------------------------------
2026-03-15 10:04:19,241 - WRT : INFO Initialising and starting routing procedure. For log output check the files 'info.log' and 'performance.log'.
2026-03-15 10:04:19,244 - matplotlib.pyplot: DEBUG Loaded backend Agg version v2.2.
2026-03-15 10:04:19,245 - WRT.genetic : INFO Initializing Routing......
2026-03-15 10:04:19,245 - WRT.genetic : INFO route from (55.421, 17.776) to (55.527, 17.913)
2026-03-15 10:04:19,245 - WRT.genetic : INFO route from (55.421, 17.776) to (55.527, 17.913)
2026-03-15 10:04:19,478 - WRT.genetic.crossover: DEBUG Setting crossover type of genetic algorithm to "random".
2026-03-15 10:04:19,478 - WRT.genetic.mutation: DEBUG Setting mutation type of genetic algorithm to "random".
2026-03-15 10:04:19,478 - WRT.genetic.patcher: DEBUG Setting patch type of genetic algorithm for Route plateau mutation to "gcr".
2026-03-15 10:04:19,478 - WRT.genetic.repair: DEBUG Setting repair type of genetic algorithm to [waypoints_infill & constraint_violation]
2026-03-15 10:04:19,486 - WRT.genetic.patcher: DEBUG Setting patch type of genetic algorithm for WaypointsInfillRepair to "gcr".
2026-03-15 10:04:19,487 - WRT.genetic.patcher: DEBUG Setting patch type of genetic algorithm for ConstraintViolationRepair to "isofuel_singleton".
2026-03-15 10:04:19,487 - WRT.Config : WARNING Your 'BOAT_SPEED' is higher than 10 m/s. Have you considered that this program works with m/s?
2026-03-15 10:04:19,510 - WRT.Config : INFO arrival time: None
2026-03-15 10:04:19,511 - WRT.Config : INFO speed: 600.0
2026-03-15 10:04:19,511 - WRT.ShipConfig: DEBUG ShipConfig is valid!
self.config: ALGORITHM_TYPE='speedy_isobased' ARRIVAL_TIME=None BOAT_TYPE='speedy_isobased' BOAT_SPEED=600.0 BOAT_SPEED_MAX=10 CONSTRAINTS_LIST=['land_crossing_global_land_mask', 'water_depth', 'on_map'] DEFAULT_ROUTE=[55.421, 17.776, 55.527, 17.913] DEFAULT_MAP=[55.412, 17.771, 55.575, 17.947] DELTA_FUEL=10000.0 DELTA_TIME_FORECAST=3.0 DEPARTURE_TIME=datetime.datetime(2025, 9, 11, 11, 11) DIJKSTRA_MASK_FILE=None DIJKSTRA_NOF_NEIGHBORS=1 DIJKSTRA_STEP=1 GCR_SLIDER_ANGLE_STEP=30 GCR_SLIDER_DISTANCE_MOVE=10000 GCR_SLIDER_DYNAMIC_PARAMETERS=True GCR_SLIDER_LAND_BUFFER=1000 GCR_SLIDER_INTERPOLATE=True GCR_SLIDER_INTERP_DIST=0.1 GCR_SLIDER_INTERP_NORMALIZED=True GCR_SLIDER_MAX_POINTS=300 GCR_SLIDER_THRESHOLD=10000 GENETIC_NUMBER_GENERATIONS=20 GENETIC_NUMBER_OFFSPRINGS=2 GENETIC_POPULATION_SIZE=20 GENETIC_POPULATION_TYPE='grid_based' GENETIC_POPULATION_PATH=None GENETIC_REPAIR_TYPE=['waypoints_infill', 'constraint_violation'] GENETIC_MUTATION_TYPE='random' GENETIC_CROSSOVER_TYPE='random' GENETIC_CROSSOVER_PATCHER='isofuel' GENETIC_FIX_RANDOM_SEED=False INTERMEDIATE_WAYPOINTS=[] ISOCHRONE_MAX_ROUTING_STEPS=500 ISOCHRONE_MINIMISATION_CRITERION='squareddist_over_disttodest' ISOCHRONE_NUMBER_OF_ROUTES=1 ISOCHRONE_PRUNE_GROUPS='branch' ISOCHRONE_PRUNE_SECTOR_DEG_HALF=91 ISOCHRONE_PRUNE_SEGMENTS=4 ISOCHRONE_PRUNE_SYMMETRY_AXIS='headings_based' ROUTER_HDGS_SEGMENTS=30 ROUTER_HDGS_INCREMENTS_DEG=6 ROUTE_POSTPROCESSING=False ROUTING_STEPS=60 TIME_FORECAST=90.0 COURSES_FILE=PosixPath('/home/ash/code/wrt/courses') DEPTH_DATA=PosixPath('/home/ash/code/wrt/depth_data.nc') WEATHER_DATA=PosixPath('/home/ash/code/wrt/weather_data.nc') ROUTE_PATH=PosixPath('/home/ash/code/wrt/route.json') CONFIG_PATH=PosixPath('/home/ash/code/wrt/WeatherRoutingTool/algorithms/genetic/configs/config.isofuel_single_route.json')
---------------------------------------------------
2026-03-15 10:04:19,511 - WRT.weather : INFO Initialising weather
2026-03-15 10:04:19,511 - WRT.weather : INFO Reading weather data from file: /home/ash/code/wrt/weather_data.nc
2026-03-15 10:04:19,511 - WRT.weather : INFO time resolution: 3:00:00 hours
2026-03-15 10:04:19,511 - WRT.weather : DEBUG Reading dataset from/home/ash/code/wrt/weather_data.nc
2026-03-15 10:04:19,522 - WRT.weather : INFO forecast from 2025-09-11 09:00:00 to 2025-09-15 06:00:00
2026-03-15 10:04:19,522 - WRT.weather : INFO nof time steps 31
---------------------------------------------------
2026-03-15 10:04:19,523 - WRT.ShipConfig: DEBUG ShipConfig is valid!
---------------------------------------------------
2026-03-15 10:04:19,523 - WRT : INFO Initialising ship
2026-03-15 10:04:19,523 - WRT : INFO Use speedy isobased model for modeling fuel consumption.
2026-03-15 10:04:19,523 - WRT.ship : INFO boat fuel rate167.0 kg / s
---------------------------------------------------
2026-03-15 10:04:19,523 - WRT.Constraints: INFO Downloading depth data from file: /home/ash/code/wrt/depth_data.nc
2026-03-15 10:04:19,529 - WRT.Constraints: INFO Downloading depth data from file: /home/ash/code/wrt/depth_data.nc
---------------------------------------------------
2026-03-15 10:04:19,534 - WRT.Constraints: DEBUG Print settings of Constraint Pars:
2026-03-15 10:04:19,534 - WRT.Constraints: DEBUG resolution=0.05
2026-03-15 10:04:19,534 - WRT.Constraints: DEBUG bCheckEndPoints=True
2026-03-15 10:04:19,534 - WRT.Constraints: INFO Constraints activated:
2026-03-15 10:04:19,534 - WRT.Constraints: INFO no land crossing
2026-03-15 10:04:19,534 - WRT.Constraints: INFO minimum water depth=30.0m
2026-03-15 10:04:19,534 - WRT.Constraints: INFO stay on wheather map
---------------------------------------------------
2026-03-15 10:04:19,534 - WRT.genetic.patcher: DEBUG Setting patch type of genetic algorithm for Isofuel patcher to "gcr_singleton".
==========================================================================================
n_gen | n_eval | n_nds | cv_min | cv_avg | eps | indicator
==========================================================================================
1 | 1 | 1 | 0.000000E+00 | 0.000000E+00 | - | -
2026-03-15 10:04:20,048 - WRT.genetic.patcher: DEBUG Setting patch type of genetic algorithm for WaypointsInfillRepair to "gcr".
2026-03-15 10:04:20,049 - WRT.genetic.patcher: DEBUG Setting patch type of genetic algorithm for ConstraintViolationRepair to "isofuel_singleton".
Traceback (most recent call last):
File "/home/ash/code/wrt/cli.py", line 40, in <module>
execute_routing(config, ship_config)
File "/home/ash/code/wrt/WeatherRoutingTool/execute_routing.py", line 67, in execute_routing
min_fuel_route, error_code = alg.execute_routing(boat, wt, constraint_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/WeatherRoutingTool/algorithms/genetic/__init__.py", line 101, in execute_routing
res_minimize = self.optimize(
^^^^^^^^^^^^^^
File "/home/ash/code/wrt/WeatherRoutingTool/algorithms/genetic/__init__.py", line 145, in optimize
algorithm.next()
File "/home/ash/code/wrt/lib/python3.12/site-packages/pymoo/core/algorithm.py", line 149, in next
infills = self.infill()
^^^^^^^^^^^^^
File "/home/ash/code/wrt/lib/python3.12/site-packages/pymoo/core/algorithm.py", line 185, in infill
infills = self._infill()
^^^^^^^^^^^^^^
File "/home/ash/code/wrt/lib/python3.12/site-packages/pymoo/algorithms/base/genetic.py", line 86, in _infill
off = self.mating.do(self.problem, self.pop, self.n_offsprings, algorithm=self, random_state=self.random_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/lib/python3.12/site-packages/pymoo/core/infill.py", line 39, in do
_off = self._do(problem, pop, n_remaining, random_state=random_state, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/lib/python3.12/site-packages/pymoo/core/mating.py", line 34, in _do
off = self.mutation(problem, off, random_state=random_state, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/lib/python3.12/site-packages/pymoo/core/operator.py", line 33, in __call__
out = self.do(problem, elem, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/lib/python3.12/site-packages/pymoo/util/__init__.py", line 21, in wrapper
return func(*args, random_state=random_state, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/lib/python3.12/site-packages/pymoo/core/mutation.py", line 28, in do
Xp = self._do(problem, X, *args, random_state=random_state, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/WeatherRoutingTool/algorithms/genetic/mutation.py", line 545, in _do
return opt._do(problem, X, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/WeatherRoutingTool/algorithms/genetic/mutation.py", line 129, in _do
mut_temp = self.mutate(problem, rt, **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ash/code/wrt/WeatherRoutingTool/algorithms/genetic/mutation.py", line 444, in mutate
start = np.random.randint(0, route_length - self.min_length)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "numpy/random/mtrand.pyx", line 801, in numpy.random.mtrand.RandomState.randint
File "numpy/random/_bounded_integers.pyx", line 1334, in numpy.random._bounded_integers._rand_int64
ValueError: high <= 0
I am not sure what is wrong here. Also not sure where the following warning comes from:
2026-03-15 10:04:19,487 - WRT.Config : WARNING Your 'BOAT_SPEED' is higher than 10 m/s. Have you considered that this program works with m/s?
Since as per the above config file, my BOAT_SPEED is set to 6.2. Is WRT running some conversions and treating the values in my config in another unit?
Any help will be greatly appreciated!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working