Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Winstead, Christopher
EnergyPlus-PBC
Commits
53a4faea
Commit
53a4faea
authored
Jan 31, 2018
by
Winstead, Christopher
Browse files
mostly path issues again
parent
2f5a9d3f
Changes
6
Hide whitespace changes
Inline
Side-by-side
agents/PBCagent/PBC/agent.py
View file @
53a4faea
...
...
@@ -2,12 +2,13 @@ import logging
import
sys
from
datetime
import
datetime
from
volttron.platform.agent
import
utils
from
volttron.platform.vip.agent
import
Core
,
PubSub
from
volttron.platform.vip.agent
import
Core
,
PubSub
,
Agent
from
volttron.platform.messaging
import
headers
as
headers_mod
from
pnnl.pubsubagent.pubsub.agent
import
SynchronizingPubSubAgent
import
time
import
math
import
json
import
os
utils
.
setup_logging
()
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -21,12 +22,14 @@ class Tstat():
self
.
can_switch
=
switch_ok
class
PBCAgent
(
Agent
):
class
PBCAgent
(
SynchronizingPubSub
Agent
):
def
__init__
(
self
,
config_path
,
**
kwargs
):
super
(
PBCAgent
,
self
).
__init__
(
config_path
,
**
kwargs
)
zone_cfg
=
json
.
load
(
open
(
'./zones.config'
,
'r'
))
print
(
os
.
getcwd
())
zonecfg
=
json
.
load
(
open
(
'../PBC/zones.py'
,
'r'
))
self
.
numZones
=
zonecfg
[
"numZones"
]
self
.
maxZones
=
zonecfg
[
"maxZones"
]
...
...
@@ -247,15 +250,14 @@ class PBCAgent(Agent):
return
status
def
main
(
argv
=
sys
.
argv
):
'''Main method called by the eggsecutable.'''
try
:
utils
.
vip_main
(
PBCAgent
)
except
Exception
as
e
:
print
(
e
)
log
.
exception
(
e
)
if
__name__
==
'__main__'
:
# Entry point for script
sys
.
exit
(
main
())
agents/PBCagent/PBC/zones.
config
→
agents/PBCagent/PBC/zones.
py
View file @
53a4faea
File moved
agents/PBCagent/setup.py
View file @
53a4faea
...
...
@@ -55,15 +55,13 @@
from
setuptools
import
setup
,
find_packages
#get environ for agent name/identifier
packages
=
find_packages
(
'.'
)
package
=
packages
[
0
]
setup
(
name
=
package
,
version
=
"0.1"
,
install_requires
=
[
'volttron'
,
'./PBCcontrol/zones.config'
],
install_requires
=
[
'volttron'
],
packages
=
packages
,
entry_points
=
{
'setuptools.installation'
:
[
...
...
@@ -71,4 +69,3 @@ setup(
]
}
)
agents/PBCagent/zones.config
deleted
100644 → 0
View file @
2f5a9d3f
{
"maxZones"
:
72
,
"numZones"
:
146
}
\ No newline at end of file
config.json
View file @
53a4faea
{
"vtron_home"
:
"
/home/evw/workspace
/volttron"
,
"eplus_config"
:
"
.
/eplus_config/"
,
"eplusagenthome"
:
"
.
/agents/energyplusagent"
,
"controlagenthome"
:
"
.
/agents/PBCagent"
,
"vtron_home"
:
"
[abs path]
/volttron"
,
"eplus_config"
:
"
[abs path]/EnergyPlus-PBC
/eplus_config/"
,
"eplusagenthome"
:
"
[abs path]/EnergyPlus-PBC
/agents/energyplusagent"
,
"controlagenthome"
:
"
[abs path]/EnergyPlus-PBC
/agents/PBCagent"
,
"maxZones"
:
72
}
run_experiment.py
View file @
53a4faea
...
...
@@ -37,10 +37,10 @@ for idf, fl in enumerate(files):
ctrl_zn_cfg
=
json
.
load
(
open
(
'./config.json'
,
'r'
))
ctrlZones
=
ctrl_zn_cfg
[
"maxZones"
]
zone_cfg
=
json
.
load
(
open
(
'./agents/PBCagent/PBC/zones.
config
'
,
'r'
))
zone_cfg
=
json
.
load
(
open
(
'./agents/PBCagent/PBC/zones.
py
'
,
'r'
))
zone_cfg
[
"maxZones"
]
=
ctrlZones
with
open
(
'./agents/PBCagent/PBC/zones.
config
'
,
'w'
)
as
outfile
:
with
open
(
'./agents/PBCagent/PBC/zones.
py
'
,
'w'
)
as
outfile
:
json
.
dump
(
zone_cfg
,
outfile
)
f
=
codecs
.
open
(
'./test_buildings/'
+
fl
,
'r'
)
...
...
@@ -91,9 +91,9 @@ for idf, fl in enumerate(files):
numZones
=
max
(
reppedZones
)
+
1
# Add num of zones to config
zone_cfg
=
json
.
load
(
open
(
'./agents/PBCagent/PBC/zones.
config
'
,
'r'
))
zone_cfg
=
json
.
load
(
open
(
'./agents/PBCagent/PBC/zones.
py
'
,
'r'
))
zone_cfg
[
"numZones"
]
=
146
with
open
(
'./agents/PBCagent/PBC/zones.
config
'
,
'w'
)
as
outfile
:
with
open
(
'./agents/PBCagent/PBC/zones.
py
'
,
'w'
)
as
outfile
:
json
.
dump
(
zone_cfg
,
outfile
)
for
idx
,
l
in
enumerate
(
lines
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment