Commit 53a4faea authored by Winstead, Christopher's avatar Winstead, Christopher
Browse files

mostly path issues again

parent 2f5a9d3f
......@@ -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(SynchronizingPubSubAgent):
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())
......@@ -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(
]
}
)
{"maxZones": 72, "numZones": 146}
\ No newline at end of file
{
"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
}
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment