Loading agents/PBCagent/PBC/agent.py +7 −5 Original line number Diff line number Diff line Loading @@ -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__) Loading @@ -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"] Loading Loading @@ -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 +0 −0 File moved. View file agents/PBCagent/setup.py +1 −4 Original line number Diff line number Diff line Loading @@ -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': [ Loading @@ -71,4 +69,3 @@ setup( ] } ) agents/PBCagent/zones.configdeleted 100644 → 0 +0 −1 Original line number Diff line number Diff line {"maxZones": 72, "numZones": 146} No newline at end of file config.json +4 −4 Original line number Diff line number Diff line { "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 } Loading
agents/PBCagent/PBC/agent.py +7 −5 Original line number Diff line number Diff line Loading @@ -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__) Loading @@ -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"] Loading Loading @@ -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/setup.py +1 −4 Original line number Diff line number Diff line Loading @@ -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': [ Loading @@ -71,4 +69,3 @@ setup( ] } )
agents/PBCagent/zones.configdeleted 100644 → 0 +0 −1 Original line number Diff line number Diff line {"maxZones": 72, "numZones": 146} No newline at end of file
config.json +4 −4 Original line number Diff line number Diff line { "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 }