2011-2nd Price Auction-PV

This is a second-price private-value auction game for powebe written by yinung

#=============================================================================
# 2nd Price Auction for 6 persons by yinung
# 2011.03.31: 
#  
#=============================================================================
M TimeToStart = 2011-04-01 10:03:15
M InitialSteps=0
M TimeSpan = 25
M ENDTIME = 15
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,0.09)
V bid0=bid+decimal

#### 使用 G_Maxt來抓群組中之最大值
   v max_bid=G_max("bid0")
#### original max bid
   v max_bid_original = G_max("bid")
     P max_bid_original.label="最高價"
####  P max_bid.label="所有人之最高出價"
   v LowerThanMax = if(bid<max_bid_original,1,0)
   V LowerThanMaxBid=LowerThanMax*bid
   V second_max_bid = G_max(LowerThanMaxbid)
     P second_max_bid.label="次高價"
   v payoff= if(SimStep<1,0,if(bid0=max_bid,myPV-second_max_bid,0))
     P payoff.label="當期報酬"

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

T table 1={"myPV","mybid","max_bid_original","second_max_bid","payoff","acc_payoff"}
      # T table 2={"LowerThanMax","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: