Skip to content

Commit

Permalink
JSON and pytype fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCN7 committed Aug 3, 2023
1 parent 1c3a030 commit c2a751d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 37 deletions.
20 changes: 2 additions & 18 deletions scripts/load_agent_example.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
{
"id": "LoadExample",
"environment": "Eplus-5Zone-hot-continuous-stochastic-v1",
"environment": "Eplus-5zone-hot-continuous-stochastic-v1",
"episodes": 5,
"algorithm": {
"name": "SB3-PPO"
},
"env_params": {
"reward": "LinearReward",
"reward_kwargs": {
"temperature_variable": [
"Zone Air Temperature(SPACE1-1)",
"Zone Air Temperature(SPACE1-2)"
],
"energy_variable": "Facility Total HVAC Electricity Demand Rate(Whole Building)",
"range_comfort_winter": [
20.0,
23.5
],
"range_comfort_summer": [
23.0,
26.0
]
},
"act_repeat": 1
"reward": "LinearReward"
},
"seed": 3,
"model": "alex_ugr/sinergym/training:latest",
Expand Down
18 changes: 1 addition & 17 deletions scripts/train_agent_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,7 @@
}
},
"env_params": {
"reward": "LinearReward",
"reward_kwargs": {
"temperature_variable": [
"Zone Air Temperature(SPACE1-1)",
"Zone Air Temperature(SPACE1-2)"
],
"energy_variable": "Facility Total HVAC Electricity Demand Rate(Whole Building)",
"range_comfort_winter": [
20.0,
23.5
],
"range_comfort_summer": [
23.0,
26.0
]
},
"act_repeat": 1
"reward": "LinearReward"
},
"seed": 3,
"model": null,
Expand Down
5 changes: 3 additions & 2 deletions sinergym/utils/evaluation.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Custom policy evaluations for Evaluation Callbacks."""

from typing import Any, Callable, Dict, Optional, Union, Tuple, List
from typing import Any, Callable, Dict, List, Optional, Tuple, Union

import gymnasium as gym
import numpy as np
from stable_baselines3.common import type_aliases
from stable_baselines3.common.vec_env import VecEnv


Expand All @@ -17,7 +18,7 @@ def evaluate_policy(
reward_threshold: Optional[float] = None,
return_episode_rewards: bool = False,
warn: bool = True,
) -> Union[Tuple[float, float], Tuple[List[float], List[int]]]:
) -> Dict[str, list]:
"""
Runs policy for ``n_eval_episodes`` episodes and returns average reward and other Sinergym metrics.
Expand Down

0 comments on commit c2a751d

Please sign in to comment.