this shit is it
This commit is contained in:
@@ -11,19 +11,21 @@ class Price_Believe_Business(Business):
|
||||
|
||||
self.max_storage = 10
|
||||
self.expense_per_unit = -1
|
||||
self.expense_per_prod=-1
|
||||
self.income_per_unit = -1
|
||||
self.distribute = Price_Believe_Distribiute_Agent(
|
||||
simulation, self, production["name"], exchange, 0.2, 50)
|
||||
simulation, self, production["name"], exchange, 0.2,production["amount"], 20)
|
||||
self.craft = AutoProductionAgent(simulation, self)
|
||||
self.aquire = {}
|
||||
|
||||
for k, v in production["prod"].items():
|
||||
a = Price_Believe_Aquire_Agent(
|
||||
simulation, self, k, exchange, 0.2, 5)
|
||||
simulation, self, k, exchange, 0.2, 20)
|
||||
a.set_target(v*2)
|
||||
a.set_price_max(10)
|
||||
self.aquire[k] = a
|
||||
self.distribute.set_price_min(0)
|
||||
self.distribute.max_batch_qty=production["amount"]
|
||||
self.distribute.set_target(0)
|
||||
|
||||
def tick_business_decisions(self, step):
|
||||
@@ -95,7 +97,7 @@ class Price_Believe_Business(Business):
|
||||
|
||||
ExPerProd = agent.expense/covers
|
||||
experunit += ExPerProd/amount
|
||||
|
||||
|
||||
if qtyNewProds > 0:
|
||||
# confirm new units
|
||||
for key, agent in self.aquire.items():
|
||||
@@ -116,6 +118,7 @@ class Price_Believe_Business(Business):
|
||||
estimatedQTYUnits = qtyNewUnits+self.resource_in_possesion()
|
||||
new_ex = ex_total/estimatedQTYUnits
|
||||
self.expense_per_unit = new_ex
|
||||
self.expense_per_prod=self.expense_per_unit*amount
|
||||
|
||||
def update_income_per_unit(self, step):
|
||||
qty_sold = self.distribute.qty
|
||||
@@ -140,6 +143,7 @@ class Price_Believe_Business(Business):
|
||||
data["tstep"] = step+episode*episode_length
|
||||
data["production"] = self.production["name"]
|
||||
data["expense"] = self.expense_per_unit
|
||||
data["expense_prod"]=self.expense_per_prod
|
||||
data["income"] = self.income_per_unit
|
||||
data["inventory"] = self.inventory[self.production["name"]]
|
||||
data["retain"] = self.distribute.target
|
||||
|
||||
Reference in New Issue
Block a user