41 lines
914 B
Python
41 lines
914 B
Python
from lightmatchingengine.lightmatchingengine import LightMatchingEngine,Side,Trade,Order
|
|
from econ.exchange import Exchange
|
|
from econ.simulation import Simulation
|
|
from econ.business.Price_Believe_Business import Price_Believe_Business
|
|
from econ.commoditys import commoditys
|
|
from econ.cells import db, cell
|
|
|
|
db.load_world("db/world.json")
|
|
|
|
commoditys.search_yaml_files()
|
|
|
|
cell_realm=[]
|
|
|
|
for c in db.world["cells"]["cells"]:
|
|
if c["province"]==187:
|
|
cell_realm.append(c)
|
|
|
|
cells=cell.create_cells_from_world_cells(cell_realm)
|
|
|
|
|
|
w="world"
|
|
cx=Exchange()
|
|
cxs=[cx]
|
|
# Init World
|
|
|
|
# Create Demand
|
|
cx.submit_order(w,"Wood",0,1000,Side.BUY)
|
|
cx.submit_order(2,"Gem",1,10,Side.SELL)
|
|
|
|
sim=Simulation()
|
|
bus=Price_Believe_Business(1,{
|
|
'name': 'Wood',
|
|
'amount': 1,
|
|
'craft': {
|
|
'Raw_Wood': 1,
|
|
}
|
|
},50,cxs,sim)
|
|
|
|
for i in range(100):
|
|
sim.tick_random_order()
|
|
print("help") |