示例#1
0
 def __init__(self,
              time_slot=None,
              area=None,
              notification_listener=None,
              readonly=False):
     super().__init__(time_slot, area, notification_listener, readonly)
     self.state = MarketClearingState()
     self.sorted_bids = []
     self.mcp_update_point = \
         self.area.config.ticks_per_slot / \
         ConstSettings.GeneralSettings.MARKET_CLEARING_FREQUENCY_PER_SLOT
示例#2
0
 def __init__(self,
              time_slot=None,
              bc=None,
              notification_listener=None,
              readonly=False,
              transfer_fees=None,
              name=None):
     super().__init__(time_slot, bc, notification_listener, readonly,
                      transfer_fees, name)
     self.state = MarketClearingState()
     self.sorted_bids = []
     self.mcp_update_point = \
         GlobalConfig.ticks_per_slot / \
         ConstSettings.GeneralSettings.MARKET_CLEARING_FREQUENCY_PER_SLOT
示例#3
0
 def _export_area_clearing_rate(self, area, directory, file_suffix,
                                is_first):
     file_path = self._file_path(directory, f"{area.slug}-{file_suffix}")
     labels = ("slot", ) + MarketClearingState._csv_fields()
     try:
         with open(file_path, 'a') as csv_file:
             writer = csv.writer(csv_file)
             if is_first:
                 writer.writerow(labels)
             for market in area.past_markets:
                 for time, clearing in market.state.clearing.items():
                     row = (market.time_slot, time, clearing[0])
                     writer.writerow(row)
     except OSError:
         _log.exception("Could not export area market_clearing_rate")
 def __init__(self, offers, bids=[], m_id=123, transfer_fees=transfer_fees, name=None):
     self.name = name
     self.id = m_id
     self.offers = {o.id: o for o in offers}
     self._bids = bids
     self.bids = {bid.id: bid for bid in self._bids}
     self.offer_call_count = 0
     self.bid_call_count = 0
     self.forwarded_offer_id = 'fwd'
     self.forwarded_bid_id = 'fwd_bid_id'
     self.calls_energy = []
     self.calls_energy_bids = []
     self.calls_offers = []
     self.calls_bids = []
     self.calls_bids_price = []
     self.time_slot = pendulum.now(tz=TIME_ZONE)
     self.time_slot_str = self.time_slot.format(TIME_FORMAT)
     self.state = MarketClearingState()
     self.fee_class = GridFees(transfer_fees.grid_fee_percentage)
示例#5
0
 def __init__(self, sorted_offers, bids=[], m_id=123, transfer_fee_ratio=0.,
              transfer_fee_const=0.):
     self.id = m_id
     self.sorted_offers = sorted_offers
     self._bids = bids
     self.offer_count = 0
     self.bid_count = 0
     self.forwarded_offer_id = 'fwd'
     self.forwarded_bid_id = 'fwd_bid_id'
     self.calls_energy = []
     self.calls_energy_bids = []
     self.calls_offers = []
     self.calls_bids = []
     self.calls_bids_price = []
     self.area = FakeArea("fake_area")
     self.time_slot = pendulum.now(tz=TIME_ZONE)
     self.time_slot_str = self.time_slot.format(TIME_FORMAT)
     self.state = MarketClearingState()
     self.transfer_fee_ratio = transfer_fee_ratio
     self.transfer_fee_const = transfer_fee_const