WISDEM / WOMBAT

Windfarm Operations & Maintenance cost-Benefit Analysis Tool
https://wisdem.github.io/WOMBAT/
Apache License 2.0
20 stars 11 forks source link

Corewind - Tow to port config not working [WTG is not in list] #145

Closed Filip-OWF closed 2 months ago

Filip-OWF commented 3 months ago

Hi

Trying to reproduce the corewind tow to port case. Before starting my own simulations. When running it I get a simulation failed message as below.

Is this something that has been experienced before?

Regards Filip

library_path =  Path(r."WOMBAT\library\corewind")
config = load_yaml("corewind/project/config", "morro_bay_tow_to_port.yaml")
sim = Simulation(library_path=library_path, config=config, random_seed=2023)
sim.run()
Simulation failed at hour 118,560.500503, simulation time: 2015-07-12 00:30:02
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
File [~\OneDrive](http://localhost:8888/lab/tree/~/OneDrive) [Deducted] - \wombat\core\repair_management.py:264, in RepairManager._run_equipment_requests(self, request)
    263     return
--> 264 self.invalidate_system(system, tow=True)
    265 yield self.env.process(self.port.run_tow_to_port(request))

File [~\OneDrive](http://localhost:8888/lab/tree/~/OneDrive) - [Deducted] \wombat\core\repair_management.py:532, in RepairManager.invalidate_system(self, system, tow)
    530 self.systems_in_tow.append(system.id)
    531 _ = self.systems_waiting_for_tow.pop(
--> 532     self.systems_waiting_for_tow.index(system.id)
    533 )

ValueError: 'WTG_0607' is not in list

The above exception was the direct cause of the following exception:

ValueError                                Traceback (most recent call last)
Cell In[35], line 4
      1 # Timing for a demonstration of performance
      2 start = perf_counter()
----> 4 sim.run()
      6 end = perf_counter()
      8 timing = end - start

File [~\OneDrive](http://localhost:8888/lab/tree/~/OneDrive [Deducted] wombat\core\simulation_api.py:348, in Simulation.run(self, until, create_metrics, save_metrics_inputs)
    325 def run(
    326     self,
    327     until: int | float | Event | None = None,
    328     create_metrics: bool = True,
    329     save_metrics_inputs: bool = True,
    330 ):
    331     """Calls ``WombatEnvironment.run()`` and gathers the results for
    332     post-processing. See ``wombat.simulation.WombatEnvironment.run`` or
    333     ``simpy.Environment.run`` for more details.
   (...)
    346         False, the data will not be saved, by default True.
    347     """
--> 348     self.env.run(until=until)
    349     if save_metrics_inputs:
    350         self.save_metrics_inputs()

File [~\OneDrive](http://localhost:8888/lab/tree/~/OneDrive [Deducted]/wombat\core\environment.py:247, in WombatEnvironment.run(self, until)
    242     self._operations_csv.close()
    243     print(
    244         f"Simulation failed at hour {self.now:,.6f},"
    245         f" simulation time: {self.simulation_time}"
    246     )
--> 247     raise e
    249 # Ensure all logged events make it to their target file
    250 self._events_writer.writerows(self._events_buffer)

File [~\OneDrive](http://localhost:8888/lab/tree/~/OneDrive [Deducted] wombat\core\environment.py:234, in WombatEnvironment.run(self, until)
    232     until = self.max_run_time
    233 try:
--> 234     super().run(until=until)
    235 except BaseException as e:
    236     # Flush the logs to so the simulation up to the point of failure is logged
    237     self._events_writer.writerows(self._events_buffer)

File [~\miniconda3\envs\wombat39\lib\site-packages\simpy\core.py:246](http://localhost:8888/lab/tree/~/miniconda3/envs/wombat39/lib/site-packages/simpy/core.py#line=245), in Environment.run(self, until)
    244 try:
    245     while True:
--> 246         self.step()
    247 except StopSimulation as exc:
    248     return exc.args[0]  # == until.value

File [~\miniconda3\envs\wombat39\lib\site-packages\simpy\core.py:204](http://localhost:8888/lab/tree/~/miniconda3/envs/wombat39/lib/site-packages/simpy/core.py#line=203), in Environment.step(self)
    202 exc = type(event._value)(*event._value.args)
    203 exc.__cause__ = event._value
--> 204 raise exc

ValueError: 'WTG_0607' is not in list
RHammond2 commented 2 months ago

Hi @Filip-OWF, thanks for identifying this! I'd identified recently on my end as well, and am actively working on diagnosing this issue.

RHammond2 commented 2 months ago

Hi @Filip-OWF I may have actually addressed this issue in one of the many updates that are on the develop branch. Would you be able to install wombat from there and confirm if this is still an issue for you?

Filip-OWF commented 2 months ago

Hi @RHammond2 Thank you for taking your time. This has solved my issue. Which is not present in the latest version available in the develop branch.

Regards, Filip

RHammond2 commented 2 months ago

Thanks so much for confirming!