its starting to be more stable
This commit is contained in:
Binary file not shown.
@@ -14,7 +14,7 @@ class Price_Believe_Business(Business):
|
||||
self.expense_per_prod=-1
|
||||
self.income_per_unit = -1
|
||||
self.distribute = Price_Believe_Distribiute_Agent(
|
||||
simulation, self, production["name"], exchange, 0.2,production["amount"], 20)
|
||||
simulation, self, production["name"], exchange, 0.2,production["amount"]*2, 20)
|
||||
self.craft = AutoProductionAgent(simulation, self)
|
||||
self.aquire = {}
|
||||
|
||||
|
||||
Binary file not shown.
+11
-1
@@ -66,12 +66,20 @@ class Simulation():
|
||||
tasks=[]
|
||||
for k in keys:
|
||||
fun=self.tick_funcs[k]
|
||||
#row=[fun,self.tick_count,self.episode_count]
|
||||
#tasks.append(row)
|
||||
#self.taskpool.submit(self._execute_tick,row)
|
||||
|
||||
fun(self.tick_count,self.episode_count)
|
||||
self.taskpool.map(self._execute_tick,tasks)
|
||||
|
||||
def _execute_tick(args):
|
||||
|
||||
|
||||
def _execute_tick(self,args):
|
||||
fun=args[0]
|
||||
fun(args[1],args[2])
|
||||
|
||||
return True
|
||||
|
||||
def tick(self,episode_length):
|
||||
"""
|
||||
@@ -188,6 +196,8 @@ class Simulation():
|
||||
|
||||
for b in self.businesses:
|
||||
id=b.production["id"]
|
||||
if len(b.balance_history)<2:
|
||||
continue
|
||||
diff=b.balance-b.balance_history[-2]
|
||||
if id not in profit:
|
||||
profit[id]=0
|
||||
|
||||
Reference in New Issue
Block a user