def test_forecast_seed(self): """ Checks that same forecasts is used for same seed """ env1 = ActiveEnv(seed=3) env2 = ActiveEnv(seed=3) env3 = ActiveEnv(seed=4) solar1 = env1.get_episode_solar_forecast() solar2 = env2.get_episode_solar_forecast() solar3 = env3.get_episode_solar_forecast() assert norm(solar1 - solar2) < 10e-5 assert norm(solar1 - solar3) > 10e-3 demand1 = env1.get_episode_demand_forecast() demand2 = env2.get_episode_demand_forecast() demand3 = env3.get_episode_demand_forecast() assert norm(demand1 - demand2) < 10e-5 assert norm(demand1 - demand3) > 10e-3
def plot_forecasts(): """ Plots solar and load forecast. :return: """ hours = 100 env = ActiveEnv() load = env.get_episode_demand_forecast()[0] sol = env.get_episode_solar_forecast() fig, ax = plt.subplots() plt.plot(2000 * sol[:hours], axes=ax) plt.plot(load[:hours], axes=ax) plt.show()