Skip to content

Commit

Permalink
Merge pull request #816 from gridsingularity/restoring_external_devic…
Browse files Browse the repository at this point in the history
…es_setup_file

restoring_external_devices_setup_file_being_for_api_client_test
  • Loading branch information
faizan2590 authored Jul 8, 2020
2 parents a9eedea + 822ac8f commit 27d99d5
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
Empty file.
71 changes: 71 additions & 0 deletions src/d3a/setup/strategy_tests/external_devices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""
Copyright 2018 Grid Singularity
This file is part of D3A.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from d3a.models.appliance.switchable import SwitchableAppliance
from d3a.models.area import Area
from d3a.models.strategy.storage import StorageStrategy
from d3a.models.strategy.load_hours import CellTowerLoadHoursStrategy, LoadHoursStrategy
from d3a.models.appliance.pv import PVAppliance
from d3a.models.strategy.external_strategies.pv import PVExternalStrategy
from d3a.models.strategy.external_strategies.load import LoadHoursExternalStrategy
from d3a_interface.constants_limits import ConstSettings

ConstSettings.IAASettings.MARKET_TYPE = 2


def get_setup(config):
area = Area(
'Grid',
[
Area(
'House 1',
[
Area('H1 General Load', strategy=LoadHoursStrategy(avg_power_W=200,
hrs_per_day=6,
hrs_of_day=list(
range(12, 18)),
final_buying_rate=35),
appliance=SwitchableAppliance()),
Area('H1 Storage1', strategy=StorageStrategy(initial_soc=100,
battery_capacity_kWh=20),
appliance=SwitchableAppliance()),
Area('H1 Storage2', strategy=StorageStrategy(initial_soc=100,
battery_capacity_kWh=20),
appliance=SwitchableAppliance()),
],
),
Area(
'House 2',
[
Area('load', strategy=LoadHoursExternalStrategy(
avg_power_W=200, hrs_per_day=24, hrs_of_day=list(range(0, 24)),
final_buying_rate=35),
appliance=SwitchableAppliance()),
Area('pv', strategy=PVExternalStrategy(panel_count=4),
appliance=PVAppliance()),

], external_connection_available=True,
),
Area('Cell Tower', strategy=CellTowerLoadHoursStrategy(avg_power_W=100,
hrs_per_day=24,
hrs_of_day=list(range(0, 24)),
final_buying_rate=35),
appliance=SwitchableAppliance()),
],
config=config
)
return area

0 comments on commit 27d99d5

Please sign in to comment.