Constructor
new OneupmanshipAgent(optionsopt)
create OneupmanshipAgent
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
Object |
<optional> |
Passed to Trader and Agent constructors |
Classes
Methods
askPrice(marginalCost, market) → {number|undefined}
Calculate price this agent is willing to accept.
The returned price is either this.maxPrice (no asks), or market.currentAskPrice()-1, or undefined.
Undefined (no bid) is returned if the propsed price is less than the marginalCost parameter
this.integer is ignored
Parameters:
Name | Type | Description |
---|---|---|
marginalCost |
number | the marginal cost of producing the next unit. sets the minimum price for allowable bidding |
market |
Object | The market for which a bid is being prepared. An object with currentBidPrice() and currentAskPrice() methods. |
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 either this.minPrice (no bidding), or market.currentBidPrice()+1, or undefined.
Undefined (no bid) is returned if the propsed price would exceed the marginalValue parameter
this.integer is ignored
Parameters:
Name | Type | Description |
---|---|---|
marginalValue |
number | the marginal value of redeeming the next unit. sets the maximum price for allowable bidding |
market |
Object | The market for which a bid is being prepared. An object with currentBidPrice() and currentAskPrice() methods. |
Returns:
agent's buy price or undefined
- Type
- number | undefined