Beispiel #1
0
def test_grout_kwargs():

    sim = MonopileInstallation(config_wtiv)
    sim.run()

    assert "Bolt TP" in list([a["action"] for a in sim.env.actions])

    sim = MonopileInstallation(config_wtiv, tp_connection_type="grouted")
    sim.run()

    assert "Pump TP Grout" in list([a["action"] for a in sim.env.actions])
    assert "Cure TP Grout" in list([a["action"] for a in sim.env.actions])
Beispiel #2
0
def test_kwargs():

    sim = MonopileInstallation(config_wtiv)
    sim.run()
    baseline = sim.total_phase_time

    keywords = [
        "mono_embed_len",
        "mono_drive_rate",
        "mono_fasten_time",
        "mono_release_time",
        "tp_fasten_time",
        "tp_release_time",
        "tp_bolt_time",
        "site_position_time",
        "crane_reequip_time",
        "rov_survey_time",
    ]

    failed = []

    for kw in keywords:

        default = pt[kw]

        if kw == "mono_drive_rate":
            _new = default - 2

            if _new <= 0:
                raise Exception(f"'{kw}' is less than 0.")

            kwargs = {kw: _new}

        else:
            kwargs = {kw: default + 2}

        new_sim = MonopileInstallation(config_wtiv, **kwargs)
        new_sim.run()
        new_time = new_sim.total_phase_time

        if new_time > baseline:
            pass

        else:
            failed.append(kw)

    if failed:
        raise Exception(f"'{failed}' not affecting results.")

    else:
        assert True
Beispiel #3
0
def test_for_complete_logging(weather, config):

    sim = MonopileInstallation(config, weather=weather)
    sim.run()

    df = pd.DataFrame(sim.env.actions)
    df = df.assign(shift=(df["time"] - df["time"].shift(1)))

    for vessel in df["agent"].unique():
        _df = df[df["agent"] == vessel].copy()
        _df = _df.assign(shift=(_df["time"] - _df["time"].shift(1)))
        assert (_df["shift"] - _df["duration"]).abs().max() < 1e-9

    assert ~df["cost"].isnull().any()
    _ = sim.agent_efficiencies
    _ = sim.detailed_output