1st Price Auction-PV

這是 first Price Auction game (for 6 persons) written by yinung

# 1st Price Auction for 6 persons by yinung
# 2011.03.29: 
M TimeToStart = 2011-04-01 09:43:09
M InitialSteps=0
M TimeSpan = 25
M TERMINATE = if(SimStep>=10,1,0)
M NumberFormat = "#,##0.##"

M ROLEASSIGN = "random"
M showidentity=0

# 分組指令: 6 人一組
G person = {"bidder1", "bidder2", "bidder3", "bidder4", "bidder5", "bidder6"}
V upper = 11
V lower = 0

V pv = int(randbetween(lower,upper))
V myPV = previous(pv,0)
P myPV.label="當期我的最高願付價格"

D bid={0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,8.5,9,9.5,10}
V mybid=bid
P mybid.label="出價"

# 用小數點的 decimal 用來決定整數位相同時, 誰得標
V decimal = randbetween(0,09)
V bid0=bid+decimal

####使用 G_Maxt來抓群組中之最大值
   v max_bid=G_max("bid0")
   v max_bid_original=G_max("bid")
     P max_bid_original.label="所有人之最高出價"

v payoff= if(SimStep<1,0,if(bid0=max_bid,myPV-bid,0))
  P payoff.label="當期報酬"

v acc_payoff=ACCUM(payoff,0)
P acc_payoff.label="累計報酬"

T table 1={"myPV","mybid","max_bid_original","payoff","acc_payoff"}
#T table 2={"pv","myPV","mybid","bid0","max_bid","payoff","acc_payoff"}
M TextInformation = "1st-p-auc.htm"

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: