This is getting better and better
This commit is contained in:
@@ -20,7 +20,7 @@ spec:
|
||||
# Wood: 1
|
||||
|
||||
- name: Food
|
||||
amount: 500
|
||||
amount: 5
|
||||
prod:
|
||||
# Fuel: 1
|
||||
Fruit: 1
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@ class Price_Believe_Distribiute_Agent(Base_Distribution_Agent):
|
||||
self.lr_moment={i: 0 for i in range(len(self.exchanges))}
|
||||
self.open_orders = {i: [] for i in range(len(self.exchanges))}
|
||||
self.open_qty = 0
|
||||
self.beta=0.6
|
||||
self.beta=0.8
|
||||
self.lp_threshold=0.05
|
||||
self.hp_threshold=0.80
|
||||
|
||||
@@ -29,6 +29,8 @@ class Price_Believe_Distribiute_Agent(Base_Distribution_Agent):
|
||||
cx_id = self.select_best_cx()
|
||||
|
||||
price = round(self.price_believe[cx_id],2)
|
||||
if price==30.0:
|
||||
print("Ple")
|
||||
if price < self.min_price:
|
||||
price = self.min_price
|
||||
order = self.distribute_resource(
|
||||
|
||||
@@ -14,13 +14,13 @@ 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.5,production["amount"]*2, 20)
|
||||
simulation, self, production["name"], exchange, 0.08,production["amount"]*2, 6)
|
||||
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, 20)
|
||||
simulation, self, k, exchange, 0.02, 6)
|
||||
a.set_target(v*2)
|
||||
a.set_price_max(10)
|
||||
self.aquire[k] = a
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -24,7 +24,7 @@ class Cell:
|
||||
exchange: None
|
||||
|
||||
def __init__(self,name,x,y,area,pop,demand,world) -> None:
|
||||
pop=pop*100
|
||||
pop=pop*10
|
||||
self.name=name
|
||||
self.loc_x=x
|
||||
self.loc_y=y
|
||||
|
||||
@@ -86,12 +86,14 @@ class Simulation():
|
||||
Executes a tick of the simulation
|
||||
"""
|
||||
start=time.time()
|
||||
|
||||
|
||||
|
||||
|
||||
self.tick_agents_random_order()
|
||||
agentstep=time.time()
|
||||
for cell_id,c in self.cells.items():
|
||||
c.setup_demand_for_step(episode_length)
|
||||
setup=time.time()
|
||||
self.tick_agents_random_order()
|
||||
agentstep=time.time()
|
||||
for b in self.businesses:
|
||||
b.tick(self.tick_count)
|
||||
|
||||
|
||||
Binary file not shown.
8
main.py
8
main.py
@@ -28,8 +28,8 @@ cxs=[cx]
|
||||
# Create Demand
|
||||
#cx.submit_order(w,"Wood",0,1000,Side.BUY)
|
||||
#cx.submit_order(2,"Gem",1,10,Side.SELL)
|
||||
EPISODE_LEN=100
|
||||
NUM_EPISODES=50
|
||||
EPISODE_LEN=20
|
||||
NUM_EPISODES=20
|
||||
NUM_SEED_BUS=10
|
||||
|
||||
|
||||
@@ -51,10 +51,8 @@ for a in tqdm(range(NUM_EPISODES)):
|
||||
print(f"|Stats| Num of Businesses: {len(sim.businesses)} Num Tickfunk: {len(sim.tick_funcs)} Time Agent Tick: {sim.timings['dsa']} Time Logging {sim.timings['dbl']}")
|
||||
sim.reset()
|
||||
for i in range(NUM_SEED_BUS):
|
||||
sim.create_bussiness(1)
|
||||
sim.create_bussiness(1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
log.writeEXData()
|
||||
|
||||
@@ -2,4 +2,5 @@ lightmatchingengine
|
||||
pyyaml
|
||||
influxdb-client
|
||||
pandas
|
||||
sqlalchemy
|
||||
sqlalchemy
|
||||
tensorflow
|
||||
Reference in New Issue
Block a user