Class BasicSumAgent

java.lang.Object
  extended bySwarmObjectImpl
      extended byBasicSumAgent
Direct Known Subclasses:
LocallyImitatingAgent, MarketImitatingAgent, RandomAgent, StopLossAgent

public class BasicSumAgent
extends SwarmObjectImpl

This is the basic class of agents, that is inherited from all the others. It contains the common caracteristics of the agents.

Author:
Marco Agagliate, Antonio de Ruvo
See Also:
Serialized Form

Field Summary
 double agentProbToActWithMarketPrice
          This is the probability of placing an order with market price.
 double agentWealthAtMeanDailyPrice
          The agent's wealth at mean daily price.
 double asymmetricBuySellProb
          The asimmetry of buy and sell probability.
 double buySellSwitch
          The distribution of buy and sell order (fixed to 0.5).
 java.util.ArrayList executedPrices
          The matrix of orders' prices.
 int iMax
          The quantity of orders sending out by the agent.
 double liquidityQuantity
          The liquidity of the agent.
 int maxOrderQuantity
          The maximum number of order per agent.
 double meanOperatingPrice
          The average price of the satified order.
 int number
          This is the number of the agent.
 double price
          The price of the order.
 int printing
          If printing=1 many objects print data on the terminal window; If printing=2 BasicSumAgents print data on the terminal window.
 double shareQuantity
          The total agent's quantity of shares
 double shareValueAtMeanDailyPrice
          The value of the shares at mean daily price.
 Book theBook
          The book of the model.
 
Constructor Summary
BasicSumAgent(Zone aZone, int maxOrderQuantity)
          Constructor for a new BasicSumAgent.
 
Method Summary
 void act0()
          This method exists only for the CurrentAgent.
 void act1()
          This method exists only for the CurrentAgent.
 void act2()
          This is the method that the agent calls at the end of the day.
 double extract(java.util.ArrayList nameList, int indexOrder, int positionDatum)
          To extract data from the orders received from agents.
 double getWealthAtMeanDailyPrice()
          Return agent's wealth at mean daily price.
 void setAgentProbToActWithMarketPrice(double p)
          This method sets the probability of placing an order with market price. .
 void setAsymmetricBuySellProb(double p)
          This method sets the asymmetricBuySellProb.
 void setBook(Book b)
          This method sets the book.
 void setConfirmationOfExecutedPrice(double[] p)
          The number of executed prices is increased
 void setMaxOrderQuantity(int m)
          This method sets the maximum number of order per agent.
 void setNumber(int n)
          This method sets the number of the agent.
 void setPrinting(int p)
          Option about the agent print capability.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

number

public int number
This is the number of the agent.


iMax

public int iMax
The quantity of orders sending out by the agent. There is one share per order: the quantity of the order is the number of orders.


agentProbToActWithMarketPrice

public double agentProbToActWithMarketPrice
This is the probability of placing an order with market price.


printing

public int printing
If printing=1 many objects print data on the terminal window; If printing=2 BasicSumAgents print data on the terminal window.


price

public double price
The price of the order.


asymmetricBuySellProb

public double asymmetricBuySellProb
The asimmetry of buy and sell probability.


buySellSwitch

public double buySellSwitch
The distribution of buy and sell order (fixed to 0.5).


shareQuantity

public double shareQuantity
The total agent's quantity of shares


maxOrderQuantity

public int maxOrderQuantity
The maximum number of order per agent.


shareValueAtMeanDailyPrice

public double shareValueAtMeanDailyPrice
The value of the shares at mean daily price.


liquidityQuantity

public double liquidityQuantity
The liquidity of the agent.


agentWealthAtMeanDailyPrice

public double agentWealthAtMeanDailyPrice
The agent's wealth at mean daily price.


meanOperatingPrice

public double meanOperatingPrice
The average price of the satified order.


executedPrices

public java.util.ArrayList executedPrices
The matrix of orders' prices.


theBook

public Book theBook
The book of the model.

Constructor Detail

BasicSumAgent

public BasicSumAgent(Zone aZone,
                     int maxOrderQuantity)
Constructor for a new BasicSumAgent.

Method Detail

extract

public double extract(java.util.ArrayList nameList,
                      int indexOrder,
                      int positionDatum)
To extract data from the orders received from agents.


setNumber

public void setNumber(int n)
This method sets the number of the agent.


setAgentProbToActWithMarketPrice

public void setAgentProbToActWithMarketPrice(double p)
This method sets the probability of placing an order with market price. .


setAsymmetricBuySellProb

public void setAsymmetricBuySellProb(double p)
This method sets the asymmetricBuySellProb.


setBook

public void setBook(Book b)
This method sets the book.


setMaxOrderQuantity

public void setMaxOrderQuantity(int m)
This method sets the maximum number of order per agent.


setPrinting

public void setPrinting(int p)
Option about the agent print capability.


setConfirmationOfExecutedPrice

public void setConfirmationOfExecutedPrice(double[] p)
The number of executed prices is increased


act0

public void act0()
This method exists only for the CurrentAgent. Its implementation is defined into specify agent class.


act1

public void act1()
This method exists only for the CurrentAgent. Its implementation is defined into specify agent class.


act2

public void act2()
This is the method that the agent calls at the end of the day. The agent makes daily accounting.


getWealthAtMeanDailyPrice

public double getWealthAtMeanDailyPrice()
Return agent's wealth at mean daily price.