Files
econ_emt/main.py
2023-01-23 11:28:12 +01:00

32 lines
783 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
w="world"
cx=Exchange()
cxs=[cx]
# Init World
cx.add_to_account(w,"balance",15000)
cx.add_to_account(w,"Raw_Wood",1000)
cx.add_to_account(w,"Raw_Stone",1000)
cx.submit_order(w,"Raw_Stone",1000,0,Side.SELL)
cx.submit_order(w,"Raw_Wood",1000,0,Side.SELL)
# Create Demand
cx.submit_order(w,"Wood",10,10,Side.BUY)
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")