Beispiel #1
0
    def _setup(self):
        load_client = RedisAssetClient("forecast-measurement-load", pubsub_thread=self.pubsub)
        load_client.select_aggregator(self.aggregator_uuid)
        self.load_uuid = load_client.area_uuid

        pv_client = RedisAssetClient("forecast-measurement-pv", pubsub_thread=self.pubsub)
        pv_client.select_aggregator(self.aggregator_uuid)
        self.pv_uuid = pv_client.area_uuid
Beispiel #2
0
 def _setup(self):
     pv = RedisAssetClient("pv", pubsub_thread=self.pubsub)
     pv.select_aggregator(self.aggregator_uuid)
    def on_tick(self, tick_info):
        logging.debug("AGGREGATOR_TICK_INFO: %s", tick_info)

    def on_trade(self, trade_info):
        logging.debug("AGGREGATOR_TRADE_INFO: %s", trade_info)

    def on_finish(self, finish_info):
        self.is_finished = True
        logging.debug("AGGREGATOR_FINISH_INFO: %s", finish_info)

    def on_batch_response(self, market_stats):
        """Log the contents of a batch response when it's received."""
        logging.debug("AGGREGATORS_BATCH_RESPONSE: %s", market_stats)


aggregator = AutoAggregator(aggregator_name="test_aggr")

load = RedisAssetClient("load",
                        autoregister=True,
                        pubsub_thread=aggregator.pubsub)
load.select_aggregator(aggregator.aggregator_uuid)

pv = RedisAssetClient("pv", autoregister=True, pubsub_thread=aggregator.pubsub)
pv.select_aggregator(aggregator.aggregator_uuid)

redis_market = RedisMarketClient("house-2")
redis_market.select_aggregator(aggregator.aggregator_uuid)

while not aggregator.is_finished:
    sleep(0.5)
Beispiel #4
0
 def _setup(self):
     storage = RedisAssetClient("storage", pubsub_thread=self.pubsub)
     storage.select_aggregator(self.aggregator_uuid)
Beispiel #5
0
    def _setup(self):
        load_asset = RedisAssetClient("load", pubsub_thread=self.pubsub)
        pv_asset = RedisAssetClient("pv", pubsub_thread=self.pubsub)
        forecast_load_asset = RedisAssetClient("forecast-measurement-load")

        load_asset.select_aggregator(self.aggregator_uuid)
        pv_asset.select_aggregator(self.aggregator_uuid)
        forecast_load_asset.select_aggregator(self.aggregator_uuid)

        self.redis_market = RedisMarketClient("house-2")
        self.redis_market.select_aggregator(self.aggregator_uuid)
Beispiel #6
0
        response = self.execute_batch_commands(batch_commands)
        logging.info("Batch command placed on the new market: %s", response)

    def on_tick(self, tick_info):
        logging.info("AGGREGATOR_TICK_INFO: %s", tick_info)

    def on_trade(self, trade_info):
        logging.info("AGGREGATOR_TRADE_INFO: %s", trade_info)

    def on_finish(self, finish_info):
        self.is_finished = True
        logging.info("AGGREGATOR_FINISH_INFO: %s", finish_info)


aggregator = AutoAggregator(aggregator_name="faizan_aggregator",
                            autoregister=True)

sleep(10)
# aggregator.delete_aggregator(is_blocking=True)

# Connects one client to the storage device
storage = RedisAssetClient("storage", autoregister=True)

sleep(5)
selected = storage.select_aggregator(aggregator.aggregator_uuid)  # pylint: disable=invalid-name
logging.info("SELECTED: %s", selected)

while not aggregator.is_finished:
    sleep(0.5)
 def _setup(self):
     load = RedisAssetClient("load", pubsub_thread=self.pubsub)
     load.select_aggregator(self.aggregator_uuid)