Class: UnitAgent

UnitAgent(optionsopt)

Unit agent: uses ZIAgent algorithm if there is no previous market price, afterward, bids/asks randomly within 1 price unit of previous price see also Brewer, Paul Chapter 4 in Handbook of Experimental Economics Results, Charles R. Plott and Vernon L. Smith, eds., Elsevier: 2008 Chapter available on Google Books at https://books.google.com search for "Handbook of Experimental Economics Results" and go to pp. 31-45. or on Science Direct (paywall) at http://www.sciencedirect.com/science/article/pii/S1574072207000042

Constructor

new UnitAgent(optionsopt)

creates "Unit" robot agent similar to those described in Brewer(2008)
Parameters:
Name Type Attributes Description
options Object <optional>
passed to Trader and Agent constructors()
Source:

Classes

UnitAgent

Methods

askPrice(marginalCost, market) → {number|undefined}

Calculate price this agent is willing to accept. The returned price is within one price unit of the previous market trade price, or uses the ZIAgent random algorithm if there is no previous market trade price. Undefined (no ask) is returned if the propsed price would be lower than the marginalCost parameter If this.integer is true, the returned price will be an integer.
Parameters:
Name Type Description
marginalCost number the marginal cost of producing the next unit. sets the minimum price for allowable random price generation
market Object The market for which a bid is being prepared. An object with lastTradePrice() method.
Source:
Returns:
agent's buy price or undefined
Type
number | undefined

bidPrice(marginalValue, market) → {number|undefined}

Calculate price this agent is willing to pay. The returned price is within one price unit of the previous market trade price, or uses the ZIAgent random algorithm if there is no previous market trade price. Undefined (no bid) is returned if the propsed price would exceed the marginalValue parameter If this.integer is true, the returned price will be an integer.
Parameters:
Name Type Description
marginalValue number the marginal value of redeeming the next unit. sets the maximum price for allowable random price generation
market Object The market for which a bid is being prepared. An object with lastTradePrice() method.
Source:
Returns:
agent's buy price or undefined
Type
number | undefined

randomDelta() → {number}

calculates random change from previous transaction price
Source:
Returns:
a uniform random number on [-1,1]; or, if this.integer is set, picked randomly from the set {-1,0,1}
Type
number