2012-技術移轉模式-2-person (III)


# ============================================================
 # 2011-技術移轉模式-2-person
 # author: Yi-Nung Yang
 # version: v0.12
 # scenario: Player A and B each has an IP, say, IP_a and IP_b worth $x and $y, respectively.
 #           These values are only known privately for themselves.
 #           However, these two IP's if combined together makes a larger value, $z (> $x+$y).
 # v0.11:    2012.05.07 新增 treatment: bidder 了解 seller 是不看到 鑑價資訊
 # v0.12:    2012.05.07 新增 treatment: 固定 組合後 IP 價值 = 120
 # ============================================================

# ------可變動之參數------------------------
 M TimetoStart = 2012-05-22 18:56:52
 # ---- treatment 設定 ------------
 # ---- (取決於 seller 所產生的) 若 info_treatment =0, 則只有 bidder 知道; 否則雙方皆知道
 # -----
 # ========= v0.12:    2012.05.07 新增 treatment: 固定 組合後 IP 價值 = 120
 V info_treatment=1
 #  V info_treatment=if(mod(simStep,PER)=0,if(randbetween(0,2)<=1,0,1),previous(info_treatment,0))
 v ginfo_treatment=g_get("seller","info_treatment")
 # 控制 seller/buyer 是否看到第 3 方鑑價資訊 (利用 CSS 語法)
 S info_mkt_seller = if(info_treatment=0,"display:none","")
 # ---- 若 info_mkt_bidder = "", 表示 bidder 永遠知道 info_treatment
 S info_mkt_bidder = ""
 # 讓 seller 在第1期看不到前期交易資料
 S info_show_pre=if(simStep<=1,"display:none","")
 # ------實驗環境變數-------------------------------------------------------
 M StartTime = 0
 M EndTime = 30
 M InitialSteps=0
 M TimeFormat = "期 #0"
 M NumberFormat = "#,##0.##"
 M TimeSpan =60
 #M TERMINATE = IF (simstep>=20 , 1 , 0)

# seller 是 a1; bidder 是 b1
 G player = {"seller", "bidder1"}

# periods in each round (PER)
 v PER = 2

# ----- 我的決策變數 --------------------------
 D accept =if(player="seller",if(mod(simStep,PER)=1,{0,1},NA),NA)
 P accept.desc = {"拒絕", "接受"}
 # ---- 我的 payoff ---------
 v myDecision = accept
 v gOffer_b1=g_get("bidder1","offer_b1")
 p Offer_b1.label=if(player="seller","對手出價","我的出價")
 v gDecision=g_get("seller","myDecision")
 p gDecision.label=if(player="seller","我的決定","對手的決定")
 v myProfit =if(simStep=0,0,if(player="seller",if(mod(simStep,PER)=0,if(myDecision=1,previous(gOffer_b1)*myDecision,previous(IP_a1_Value,0)),0),if(mod(simStep,PER)=1,0,if(gDecision=1,previous(IP_mkt_value,0)-previous(gOffer_b1),previous(IP_b1_value,0)))))
 #   v myIP_value=if(simStep=0,0,if(player="seller",g_get("seller","IP_a1_Value"),g_get("seller","IP_b1_value")))
 p myProfit.label="我的獲利"
 v myIP_value=if(player="seller",IP_a1_Value,IP_b1_value)
 #   v myIP_value=if(player="seller",g_get("seller","IP_a1_Value"),g_get("seller","IP_b1_value"))
 p myIP_value.label="我的個別IP價值"
 v pre_myIP_value=previous(myIP_value,0)
 # --- 累計獲利
 v acc_myProfit=ACCUM(myProfit,0)

# -------------my IP_a1 設定 --------------------------------
 v upperValue_a1 = 30
 v lowerValue_a1 = 30
 # --- 我的個別 IP 市場價值
 v IP_a1_Value = if(mod(simStep,PER)=0,int(randbetween(lowerValue_a1,upperValue_a1)),previous(IP_a1_Value,upperValue_a1))

# ------ IP_b1 設定 (對手是 bidder, 擁有 IP_b1, 向你要求授權) ------------
 v upperValue_b1 = 30
 v lowerValue_b1 = 30
 # --- 對手的研發成本
 # ------- IP_b1_Value 取決於 seller 所產生的 IP_b1_Value ---------------------------
 V IP_b0_Value=if(mod(simStep,PER)=0,int(randbetween(lowerValue_b1,upperValue_b1)),previous(IP_b0_Value,upperValue_b1))
 # ----   V IP_b0_Value=int(randbetween(lowerValue_b1,upperValue_b1))
 v IP_b1_Value =g_get("bidder1","IP_b0_Value")

# --- 對手 (robot) 之出價
 # ---   v robot_offer = randbetween(IP_low, IP_high)
 #   v offer_b1 =if(mod(simStep,PER)=0,robot_offer,previous(robot_offer))
 # --- v offer_b1 =if(mod(simStep,PER)=1,robot_offer,NA)
 D offer_b1 =if(player="bidder1",if(mod(simStep,PER)=0,none,NA),NA)

# ------- market condition (如果成交的話) -----------
 # ========= v0.12:    2012.05.07 新增 treatment: 固定 組合後 IP 價值 = 120
 v IP_high = 120
 v IP_low = 120
 # --- v0.1 IP 價值不確定, 有高有低 -------------
 #  v IP_high = 140
 #  v IP_low = 100
 # --- 市場 outcome 的機率, 每 2 期的 市場 outcome 是相同的
 v market_outcome =if(mod(simStep,PER)=0,randbetween(0,10),previous(market_outcome))
 # --- threshold 決定兩種 outcome 的機率,
 v threshold = 5
 # ------- IP_mkt_value 取決於 seller 所產生的 market_outcome ---------------------------
 # ----  v IP_mkt_value = if(simStep=0,NA,if(g_get("seller","market_outcome")<threshold,IP_low, IP_high))
 v IP_mkt_value = if(g_get("seller","market_outcome")<threshold,IP_low, IP_high)
 v IP_mkt_value_pre = if(simstep=0,none,if(mod(simstep,PER)=0,previous(IP_mkt_value,0),none))
 p IP_mkt_value_pre.label="市場實際價值"

# ----- 第 3 方 鑑價結果 --------
 # --- 第 3 方 鑑價結果正確機率
 v prob_3rdParty=0.6
 # --- 若 predict=1 表示預測正確
 v predict = if(randbetween(0,1)<prob_3rdParty,1,0)
 v mkt_estimate=if(mod(simStep,PER)=0,if(predict=1,IP_mkt_value,if(IP_mkt_value=IP_high,IP_low,IP_high)),previous(mkt_estimate,0))
 #   v ThirdParty_estimate =if(mod(simStep,PER)=0,mkt_estimate,previous(mkt_estimate))
 # ------- ThirdParty_estimate 取決於 seller 所產生的 mkt_estimate ---------------------------
 v ThirdParty_estimate =if(mod(simStep,PER)=0,g_get("seller","mkt_estimate"),previous(ThirdParty_estimate,0))
 v pre_ThirdParty_estimate = if(simstep=0,none,previous(ThirdParty_estimate))
 p pre_ThirdParty_estimate.label="第三方鑑價"
 # ------ text messages ---------------
 S sMessage=if(mod(simStep,PER)=0,"等待對手出價...","等待對手是否接受...")
 v pre_gOffer_b1=previous(gOffer_b1)
 v pre2_gOffer_b1=previous(previous(gOffer_b1))
 S pre_gDecision=if(previous(gDecision)=1,"接受","拒絕")
 S pre2_gDecision=if(previous(previous(gDecision))=1,"接受","拒絕")
 S now_gDecision=if(gDecision=1,"接受","拒絕")
 v period=simStep
 V pre_IP_mkt_value=previous(IP_mkt_value)
 V pre_myProfit=previous(myProfit)
 V pre2_myProfit=previous(previous(myProfit))

M TextInformation=if(player="seller",if(mod(simStep,PER)=0,"2012IPinf.htm","2012IPs.htm"),if(mod(simStep,PER)=1,"2012IPinf.htm","2012IPb.htm"))
 T Table 1 = {"myProfit"}
 #T Table 1 = {"ThirdParty_estimate","IP_mkt_value_pre","gOffer_b1","gDecision","pre_myIP_Value","myProfit"}
 #T Table 2 = {"ginfo_treatment","ThirdParty_estimate","IP_mkt_value","gOffer_b1","gDecision","IP_a1_Value","IP_b1_Value","IP_b0_Value","myProfit","market_outcome","predict"}
 #R Report 1 = if(player="seller",{"ThirdParty_estimate","gOffer_b1","myIP_Value"},{"ThirdParty_estimate","gOffer_b1","myIP_Value"})

,

  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: