its starting to get stable
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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)
|
||||
|
||||
@@ -12,6 +12,7 @@ class Price_Believe_Distribiute_Agent(Base_Distribution_Agent):
|
||||
self.open_orders={i: [] for i in range(len(self.exchanges))}
|
||||
self.open_qty=0
|
||||
|
||||
|
||||
def tick(self,step,episode):
|
||||
|
||||
order_error=self.target_error()
|
||||
|
||||
Reference in New Issue
Block a user