Exemple #1
0
def iaa2():
    lower_market = FakeMarket([Offer('id', 2, 2, 'other', 2)], m_id=123)
    higher_market = FakeMarket([], m_id=234)
    owner = FakeArea('owner')
    owner.future_market = lower_market
    iaa = OneSidedAgent(owner=owner, lower_market=lower_market, higher_market=higher_market)
    iaa.event_tick()
    iaa.owner.current_tick += 2
    iaa.event_tick()
    return iaa
Exemple #2
0
def iaa():
    lower_market = FakeMarket([Offer('id', 1, 1, 'other')])
    higher_market = FakeMarket([Offer('id2', 3, 3, 'owner'), Offer('id3', 0.5, 1, 'owner')])
    owner = FakeArea('owner')
    iaa = OneSidedAgent(owner=owner,
                        higher_market=higher_market,
                        lower_market=lower_market)
    iaa.event_tick()
    iaa.owner.current_tick = 14
    iaa.event_tick()
    return iaa
Exemple #3
0
def iaa_grid_fee():
    lower_market = FakeMarket([Offer('id', 1, 1, 'other')], transfer_fee_ratio=0.1,
                              transfer_fee_const=2)
    higher_market = FakeMarket([Offer('id2', 3, 3, 'owner'), Offer('id3', 0.5, 1, 'owner')],
                               transfer_fee_ratio=0.1, transfer_fee_const=2)
    owner = FakeArea('owner')
    iaa = OneSidedAgent(owner=owner,
                        higher_market=higher_market,
                        lower_market=lower_market)
    iaa.event_tick()
    iaa.owner.current_tick = 14
    iaa.event_tick()
    return iaa
def iaa_grid_fee():
    lower_market = FakeMarket([Offer('id', pendulum.now(), 1, 1, 'other', 1)],
                              transfer_fees=TransferFees(grid_fee_percentage=0.1,
                                                         transfer_fee_const=2))
    higher_market = FakeMarket([Offer('id2', pendulum.now(), 3, 3, 'owner', 3),
                                Offer('id3', pendulum.now(), 0.5, 1, 'owner', 0.5)],
                               transfer_fees=TransferFees(grid_fee_percentage=0.1,
                                                          transfer_fee_const=2))
    owner = FakeArea('owner')
    iaa = OneSidedAgent(owner=owner,
                        higher_market=higher_market,
                        lower_market=lower_market)
    iaa.event_tick()
    iaa.owner.current_tick = 14
    iaa.event_tick()
    return iaa