我正在尝试将formBuyerAggressiveness传递给bidTargetPrice过程。它正在给一位预期的记者"错误信息。到目前为止,这是我的代码。
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 :(得分:1)
问题在于行let buyerAggressiveness [formBuyerAggresiveness] of tradeID
。有错误消息告诉您[formBuyerAggresiveness]
不是记者。短语[attrA] of myagent
仅在myagent
(i)为代理且(ii)具有此属性时有效。
要解决此问题,您至少有两个选择。
aggressiveness
属性,并为set
编写一个程序,然后您可以使用[aggressiveness] of myagent
或