i think it is working
This commit is contained in:
@@ -1,13 +1,32 @@
|
||||
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()
|
||||
cx.add_to_account(0,"balance",1500)
|
||||
cx.add_to_account(1,"food",50)
|
||||
cx.add_to_account(2,"food",50)
|
||||
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)
|
||||
|
||||
order_1=cx.submit_order(1,"food",50,2,side=Side.SELL)
|
||||
order_2=cx.submit_order(2,"food",50,1,side=Side.SELL)
|
||||
order_3=cx.submit_order(0,"food",100,2,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")
|
||||
Reference in New Issue
Block a user