its starting to get stable
This commit is contained in:
@@ -17,6 +17,7 @@ class Base_Distribution_Agent(BaseAgent,ABC):
|
||||
self.orders={i: {} for i in range(len(self.exchanges))}
|
||||
self.target=0
|
||||
self.min_price=-1
|
||||
self.max_batch_qty=10
|
||||
super().__init__(simulation)
|
||||
|
||||
def set_target(self,target: int):
|
||||
@@ -54,7 +55,8 @@ class Base_Distribution_Agent(BaseAgent,ABC):
|
||||
|
||||
if not self.business.inventory[self.resource]>=amount:
|
||||
return False # we dont have enough balance
|
||||
|
||||
if amount>self.max_batch_qty:
|
||||
amount=self.max_batch_qty
|
||||
self.business.inventory[self.resource]-=amount
|
||||
cx.add_to_account(self.id,self.resource,amount) # prepaid charge account for cx
|
||||
order=cx.submit_order(self.id,self.resource,amount,price_per,Side.SELL)
|
||||
|
||||
Reference in New Issue
Block a user