its starting to get stable

This commit is contained in:
2023-06-26 17:03:15 +02:00
parent 4cec35935f
commit 5514f3f1d9
19 changed files with 96 additions and 50 deletions

View File

@@ -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)