ok dokey, performance ist ein wenig besser
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -29,7 +29,7 @@ class BaseAgent(ABC):
|
||||
"""
|
||||
Disables agent by removing it from the simulation
|
||||
"""
|
||||
self.simulation.unregister_agent(id)
|
||||
self.simulation.unregister_agent(self.id)
|
||||
def register(self):
|
||||
"""
|
||||
Enables agent by adding it to the simulation:
|
||||
|
||||
@@ -55,8 +55,7 @@ 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