|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgame.DiscreteGame
game.DoubleAuction
public class DoubleAuction
Simulates a general double auction that implements "New York Rules". These rules dictate that every bid must be equal to or greater than the last bid. Conversely each ask must be equal to or less than the last ask.
Constructor Summary | |
---|---|
DoubleAuction(Market pMarket,
int length)
Constructor |
Method Summary | |
---|---|
void |
clearAllParticipantsInventory()
Convenience method. |
void |
clearAllParticipantsOfCommodity(Commodity pCommodity)
Convenience method. |
void |
endowAllBuyers(Commodity comm,
double amt)
For every buyer in the double auction this method endows them with the given commodity of the given amount |
void |
endowAllParticipants(Commodity comm,
double amt)
Convenience method. |
void |
endowAllSellers(Commodity comm,
double amt)
For every seller in the double auction this method endows them with the given commodity of the given amount |
Market |
getMarket()
|
java.util.ArrayList<Participant> |
getParticipants()
|
boolean |
isVerbose()
|
void |
run()
Iterates over the number of steps equal to the game length. |
void |
setMarket(Market market)
|
void |
setParticipants(java.util.ArrayList<Participant> participants)
|
void |
setRand(java.util.Random rand)
|
void |
setVerbose(boolean verbose)
|
void |
step()
Simulates a single turn in a double auction. |
Methods inherited from class game.DiscreteGame |
---|
getCurrentPeriod, getGameLength |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoubleAuction(Market pMarket, int length)
pMarket
- length
- Method Detail |
---|
public void clearAllParticipantsInventory()
public void clearAllParticipantsOfCommodity(Commodity pCommodity)
pCommodity
- public void endowAllParticipants(Commodity comm, double amt)
comm
- amt
- public void endowAllBuyers(Commodity comm, double amt)
comm
- amt
- public void endowAllSellers(Commodity comm, double amt)
comm
- amt
- public void run()
run
in class DiscreteGame
DiscreteGame.run()
public void step()
step
in class DiscreteGame
DiscreteGame.step()
public Market getMarket()
public void setMarket(Market market)
market
- public java.util.ArrayList<Participant> getParticipants()
public void setParticipants(java.util.ArrayList<Participant> participants)
participants
- public void setRand(java.util.Random rand)
rand
- public boolean isVerbose()
public void setVerbose(boolean verbose)
verbose
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |