コード例 #1
0
 def post_tariffs( self ):
     prices = []
     for element in self.asks:
         prices += [element[0]]
     avg_price = int(sum(prices)/len(prices))
     price = avg_price + random.randint(40,50)
     return [Tariff( self.idx, price=price, duration=12, exitfee=random.randint(10,20))]
コード例 #2
0
    def post_tariffs(self,step):
        time_of_day=step%24
        if time_of_day<=4 or time_of_day>=20:
            tar_price=self.genetic_table["TarifPrice"]["Section I"]+self.genetic_table["AskPrice"]["Section I"]
            duration=self.genetic_table["Duration"]["Section I"]
            exit_fee=self.genetic_table["ExitFee"]["Section I"]
        elif time_of_day>8 and time_of_day<16:
            tar_price = self.genetic_table["TarifPrice"]["Section III"]+self.genetic_table["AskPrice"]["Section III"]
            duration = self.genetic_table["Duration"]["Section III"]
            exit_fee = self.genetic_table["ExitFee"]["Section III"]
        else:
            tar_price = self.genetic_table["TarifPrice"]["Section II"]+self.genetic_table["AskPrice"]["Section II"]
            duration = self.genetic_table["Duration"]["Section II"]
            exit_fee = self.genetic_table["ExitFee"]["Section II"]
        duration=min(duration,7)
        exit_fee = min(2000, exit_fee)

        tar = [Tariff( self.idx, price=tar_price*self.demand[time_of_day], duration= duration, exitfee= duration)]
        # print(tar[0])

        return tar
コード例 #3
0
ファイル: Broker.py プロジェクト: alfarozavalae/SimMarket
    def post_tariffs(self, time):

        return [Tariff(self.idx, price=100, duration=3, exitfee=0)]
コード例 #4
0
 def get_default_tariff(self):
     return Tariff(0, price=1000, duration=1, exitfee=500)