2015-03-30 37 views
0

我想通過formBuyerAggressiveness到一個bidTargetPrice過程。它給出了「預期的記者」錯誤消息。這是我迄今爲止的代碼。我想通過一個過程變量作爲輸入到另一個過程netlogo

to bidTargetPrice [tradeID] 

    let buyerAggressiveness [formBuyerAggresiveness] of tradeID 

    ; if (buyerAggresiveness <= 1) [ 
    ifelse (- 1 < buyerAggresiveness) and (buyerAggresiveness <= 0) 
     [report equilibriumPrice * (1 - (((e^(- buyerAggresiveness * theta)) - 1)/(e^theta - 1))) 
      ] 

     [report equilibriumPrice + ((value - equilibriumPrice) * (((e^(buyerAggresiveness * theta)) - 1)/((e^theta) - 1))) 
      ] 
; ] 

以下是我在上述過程中調用的過程。我打算把買方的侵略性參數轉化爲幫助形成價格的代理人。

to formBuyerAggresiveness 
    ;define some local parameters 


     ifelse (transactionPrice > 0.0) 
     [ ifelse (bidTargetPrice >= transactionPrice) 
      [ let desiredAggressiveness (((1 - C2) * rshout) - C1) ;rshout is the degree of aggressiveness that would form a price equal to the last bid 
       report buyerAggressiveness (degreeOfAggressiveness + B1 * (desiredAggressiveness - degreeOfAggressiveness))    ;degreeOfAggressiveness is a random of individual trader aggressiveness from -1 to 1 range. *defined during init user/buyer 
      ] 

      [ let desiredAggressiveness (((1 + C2) * rshout) + C1) ;buyer must be more aggresive 
      report degreeOfAggressiveness + B1 * (desiredAggressiveness - degreeOfAggressiveness) 
       ] 
     ] 

     [ if (bid?) and (bidTargetPrice <= bestBid) 
      [let desiredAggressiveness (((1 + C2) * rshout) + C1) 
      report degreeOfAggressiveness + B1 * (desiredAggressiveness - degreeOfAggressiveness) 
       ] 
     ] 
end   
+0

你爲什麼使用報表formBuyerAggresiveness?對我來說,這不是一個記者的背景,你可以使用set。但我不知道你在哪裏打電話'formBuyerAggresiveness' – delaye 2015-03-31 07:49:14

回答

1

問題出在線let buyerAggressiveness [formBuyerAggresiveness] of tradeID。有錯誤消息告訴你,[formBuyerAggresiveness]不是記者。短語[attrA] of myagent僅在myagent(i)是代理並且(ii)具有此屬性時才起作用。

要解決這個問題,至少有兩個選擇。

  1. 給你代理的aggressiveness屬性,並寫了一個程序來set它,這樣你就可以用[aggressiveness] of myagent訪問它,或者
  2. 記者接受一個代理作爲參數和返回侵略性值代理
+0

感謝您的領導。我決定讓一位記者似乎已經解決了這個問題。我也考慮了德拉耶所說的。我對相關問題有疑問。是否有可能在另一個報告程序中使用報告程序輸出作爲if語句的一部分? – Anesu 2015-03-31 18:22:33

+0

如果您有新問題,請打開一個新問題,而不僅僅是將評論添加到現有問題。 – 2015-03-31 21:06:26

相關問題