Exemplo n.º 1
0
def test_iceland():
    net = pn.iceland()
    pp.runpp(net)
    assert len(net.bus) == 189
    assert len(net.line) + len(net.trafo) == 206
    assert len(net.ext_grid) + len(net.gen) + len(net.sgen) == 35
    assert net.converged
Exemplo n.º 2
0
def test_iceland():
    net = pn.iceland()
    assert net.converged
    pp.runpp(net, trafo_model='pi')
    assert len(net.bus) == 189
    assert len(net.line) + len(net.trafo) == 206
    n_gen = 35
    assert len(net.ext_grid) + len(net.gen) + len(net.sgen) == n_gen
    assert len(net.polynomial_cost) == n_gen
    assert net.converged
Exemplo n.º 3
0
def test_iceland():
    net = pn.iceland()
    assert net.converged
    _ppc_element_test(net, 189, 206, 35, True)
Exemplo n.º 4
0
        if show_sun:
            rewards.append(sol[env._current_step - 1])
            hues.append('Sun')
            t_steps.append(t_step)
            hours.append(hour)

        if show_demand:
            rewards.append(demand[env._current_step - 1])
            hues.append('Demand')
            t_steps.append(t_step)
            hours.append(hour)


if __name__ == '__main__':
    flex = 0.3
    net = iceland()
    env = ActiveEnv(base_net=net, seed=3)
    env.set_parameters({'demand_std': 0, 'flexibility': flex})
    forecast = env.demand_forecasts[:, 0]

    a = -np.ones(env.action_space.shape)  # max decrease in consumption
    a = env.action_space.sample()
    env.step(a)

    net = env.powergrid
    consumption = net.res_load['p_mw'] / net.load['sn_mva']
    load_ratio = consumption / forecast
    assert np.linalg.norm(load_ratio - (1 + a * flex)) < 10e-6

    print('haha')