fuck man major readjustment but it is running again...
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from abc import ABC
|
||||
import log
|
||||
class Business(ABC):
|
||||
def __init__(self,id,production,balance) -> None:
|
||||
def __init__(self,id,production,balance,location) -> None:
|
||||
"""production (dict): {
|
||||
name: 'Gem',
|
||||
amount: 4,
|
||||
@@ -13,14 +13,17 @@ class Business(ABC):
|
||||
balance (int): Starting Balance
|
||||
"""
|
||||
self.id=id
|
||||
self.location=location
|
||||
self.production=production
|
||||
self.balance_history=[balance]
|
||||
self.balance=balance
|
||||
self.expense=0
|
||||
self.income=0
|
||||
#Setup Inventory
|
||||
self.inventory={production["name"]: 0}
|
||||
for l in production["prod"]:
|
||||
for k,v in l.items():
|
||||
self.inventory[k]=0
|
||||
|
||||
for k,v in production["prod"].items():
|
||||
self.inventory[k]=0
|
||||
pass
|
||||
|
||||
def tick(self,step):
|
||||
@@ -34,8 +37,10 @@ class Business(ABC):
|
||||
"""
|
||||
Call for resetting for the next episode
|
||||
"""
|
||||
self.balance_history.append(self.balance)
|
||||
self.tick_business_episode(episode_count)
|
||||
self.balance_history.append(self.balance)
|
||||
|
||||
|
||||
|
||||
|
||||
def tick_business_episode(self,episode_count):
|
||||
@@ -54,5 +59,8 @@ class Business(ABC):
|
||||
data["step"]=step
|
||||
data["tstep"]=step+episode*episode_length
|
||||
data["production"]=self.production["name"]
|
||||
data["prod_inventory"]=self.inventory[self.production["name"]]
|
||||
data["raw_inventory"]=self.inventory[self.production["name"]]
|
||||
data["balance"]=self.balance
|
||||
data["location"]=self.location
|
||||
log.BUSINESSData.append(data)
|
||||
Reference in New Issue
Block a user