Class ObserverSwarm

java.lang.Object
  extended byGUISwarmImpl
      extended byObserverSwarm

public class ObserverSwarm
extends GUISwarmImpl

ObserverSwarm.java The observer swarm is collection of objects that are used to run and observe the ModelSwarm that actually comprises the simulation.

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

Field Summary
 EZGraphImpl agentWealth
          our graphics or EZGraph output to files
 EZGraphImpl agentWealthGraph
          our graphics or EZGraph output to files
 EZGraphImpl bidAskSpreadGraph
          our graphics or EZGraph output to files
 EZGraphImpl bookLogGraph
          our graphics or EZGraph output to files
 EZGraphImpl currentBidAskSpreadFile
          our graphics or EZGraph output to files
 EZGraphImpl currentBuyFirstLastSpreadFile
          our graphics or EZGraph output to files
 EZGraphImpl currentQuantitySpreadFile
          our graphics or EZGraph output to files
 EZGraphImpl currentSellFirstLastSpreadFile
          our graphics or EZGraph output to files
 ActionGroupImpl displayActions
          two ActionGroup for sequence of GUI events
 int displayFrequency
          Update frequency.
 int displayPreviousDayMean
          To create file and represent previous day mean price.
 ScheduleImpl displaySchedule
          the single Schedule instance
 EZGraphImpl firstLastSpreadGraph
          our graphics or EZGraph output to files
 EZGraphImpl maxWealthAllFile
          our graphics or EZGraph output to files
 EZGraphImpl maxWealthLocallyImitatingFile
          our graphics or EZGraph output to files
 EZGraphImpl maxWealthMarketImitatingFile
          our graphics or EZGraph output to files
 EZGraphImpl maxWealthRandomFile
          our graphics or EZGraph output to files
 EZGraphImpl maxWealthStopLossFile
          our graphics or EZGraph output to files
 EZGraphImpl meanPriceFile
          our graphics or EZGraph output to files
 EZGraphImpl meanWealthAllFile
          our graphics or EZGraph output to files
 EZGraphImpl meanWealthLocallyImitatingFile
          our graphics or EZGraph output to files
 EZGraphImpl meanWealthMarketImitatingFile
          our graphics or EZGraph output to files
 EZGraphImpl meanWealthRandomFile
          our graphics or EZGraph output to files
 EZGraphImpl meanWealthStopLossFile
          our graphics or EZGraph output to files
 EZGraphImpl minWealthAllFile
          our graphics or EZGraph output to files
 EZGraphImpl minWealthLocallyImitatingFile
          our graphics or EZGraph output to files
 EZGraphImpl minWealthMarketImitatingFile
          our graphics or EZGraph output to files
 EZGraphImpl minWealthRandomFile
          our graphics or EZGraph output to files
 EZGraphImpl minWealthStopLossFile
          our graphics or EZGraph output to files
 ModelSwarm modelSwarm
          the ModelSwarm we are observing
 EZGraphImpl priceFile
          our graphics or EZGraph output to files
 EZGraphImpl priceGraph
          our graphics or EZGraph output to files
 EZGraphImpl quantitySpreadGraph
          our graphics or EZGraph output to files
 int saveAgentWealthData
          To save agent's wealth data.
 int saveBidAskSpreadData
          To save spread data between first bid and first ask price.
 int saveBookLogData
          To save book data.
 int saveBuySellFirstLastSpreadData
          To save spread data between the first and the last price in the two side.
 int saveBuySellQuantitySpreadData
          To save spread data between quantities in sell and buy side.
 int savePriceData
          To save on a file the price data.
 EZGraphImpl sharesInBuySideBeforeOpeningFile
          our graphics or EZGraph output to files
 EZGraphImpl sharesInBuySideFile
          our graphics or EZGraph output to files
 EZGraphImpl sharesInSellSideBeforeOpeningFile
          our graphics or EZGraph output to files
 EZGraphImpl sharesInSellSideFile
          our graphics or EZGraph output to files
 int showAgentWealthGraph
          To show agent's wealth graph.
 int showBidAskSpreadGraph
          To show spread graph between first bid and first ask price.
 int showBookLogGraph
          To show book graph.
 int showBuySellFirstLastSpreadGraph
          To show spread graph between the first and the last price in the two side.
 int showBuySellQuantitySpreadGraph
          To show spread graph between quantities in sell and buy side.
 int showBuySellSharesNumberBeforeOpening
          To show the number of shares in the two side before opening.
 int stopAtDayNumber
          To stop simulation at the end of a day.
 Book theBook
          The book of the simulation.
 
Constructor Summary
ObserverSwarm(Zone aZone)
          Constructor for a new ObserverSwarm.
 
Method Summary
 Activity activateIn(Swarm swarmContext)
          Activate the schedules so that they are ready to run.
 java.lang.Object buildActions()
          Create the actions necessary for the simulation.
 java.lang.Object buildObjects()
          Create the objects used to display the model.
 void checkToStop()
          To check for the stopping conditions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

displayFrequency

public int displayFrequency
Update frequency.


stopAtDayNumber

public int stopAtDayNumber
To stop simulation at the end of a day.


savePriceData

public int savePriceData
To save on a file the price data.


displayPreviousDayMean

public int displayPreviousDayMean
To create file and represent previous day mean price.


showBookLogGraph

public int showBookLogGraph
To show book graph.


saveBookLogData

public int saveBookLogData
To save book data.


showAgentWealthGraph

public int showAgentWealthGraph
To show agent's wealth graph.


saveAgentWealthData

public int saveAgentWealthData
To save agent's wealth data.


showBidAskSpreadGraph

public int showBidAskSpreadGraph
To show spread graph between first bid and first ask price.


saveBidAskSpreadData

public int saveBidAskSpreadData
To save spread data between first bid and first ask price.


showBuySellQuantitySpreadGraph

public int showBuySellQuantitySpreadGraph
To show spread graph between quantities in sell and buy side.


saveBuySellQuantitySpreadData

public int saveBuySellQuantitySpreadData
To save spread data between quantities in sell and buy side.


showBuySellFirstLastSpreadGraph

public int showBuySellFirstLastSpreadGraph
To show spread graph between the first and the last price in the two side.


saveBuySellFirstLastSpreadData

public int saveBuySellFirstLastSpreadData
To save spread data between the first and the last price in the two side.


showBuySellSharesNumberBeforeOpening

public int showBuySellSharesNumberBeforeOpening
To show the number of shares in the two side before opening.


modelSwarm

public ModelSwarm modelSwarm
the ModelSwarm we are observing


displaySchedule

public ScheduleImpl displaySchedule
the single Schedule instance


theBook

public Book theBook
The book of the simulation.


displayActions

public ActionGroupImpl displayActions
two ActionGroup for sequence of GUI events


priceGraph

public EZGraphImpl priceGraph
our graphics or EZGraph output to files


priceFile

public EZGraphImpl priceFile
our graphics or EZGraph output to files


bookLogGraph

public EZGraphImpl bookLogGraph
our graphics or EZGraph output to files


agentWealth

public EZGraphImpl agentWealth
our graphics or EZGraph output to files


agentWealthGraph

public EZGraphImpl agentWealthGraph
our graphics or EZGraph output to files


sharesInSellSideFile

public EZGraphImpl sharesInSellSideFile
our graphics or EZGraph output to files


sharesInBuySideFile

public EZGraphImpl sharesInBuySideFile
our graphics or EZGraph output to files


minWealthAllFile

public EZGraphImpl minWealthAllFile
our graphics or EZGraph output to files


meanWealthAllFile

public EZGraphImpl meanWealthAllFile
our graphics or EZGraph output to files


maxWealthAllFile

public EZGraphImpl maxWealthAllFile
our graphics or EZGraph output to files


minWealthRandomFile

public EZGraphImpl minWealthRandomFile
our graphics or EZGraph output to files


meanWealthRandomFile

public EZGraphImpl meanWealthRandomFile
our graphics or EZGraph output to files


maxWealthRandomFile

public EZGraphImpl maxWealthRandomFile
our graphics or EZGraph output to files


minWealthMarketImitatingFile

public EZGraphImpl minWealthMarketImitatingFile
our graphics or EZGraph output to files


meanWealthMarketImitatingFile

public EZGraphImpl meanWealthMarketImitatingFile
our graphics or EZGraph output to files


maxWealthMarketImitatingFile

public EZGraphImpl maxWealthMarketImitatingFile
our graphics or EZGraph output to files


minWealthLocallyImitatingFile

public EZGraphImpl minWealthLocallyImitatingFile
our graphics or EZGraph output to files


meanWealthLocallyImitatingFile

public EZGraphImpl meanWealthLocallyImitatingFile
our graphics or EZGraph output to files


maxWealthLocallyImitatingFile

public EZGraphImpl maxWealthLocallyImitatingFile
our graphics or EZGraph output to files


minWealthStopLossFile

public EZGraphImpl minWealthStopLossFile
our graphics or EZGraph output to files


meanWealthStopLossFile

public EZGraphImpl meanWealthStopLossFile
our graphics or EZGraph output to files


maxWealthStopLossFile

public EZGraphImpl maxWealthStopLossFile
our graphics or EZGraph output to files


meanPriceFile

public EZGraphImpl meanPriceFile
our graphics or EZGraph output to files


bidAskSpreadGraph

public EZGraphImpl bidAskSpreadGraph
our graphics or EZGraph output to files


currentBidAskSpreadFile

public EZGraphImpl currentBidAskSpreadFile
our graphics or EZGraph output to files


sharesInBuySideBeforeOpeningFile

public EZGraphImpl sharesInBuySideBeforeOpeningFile
our graphics or EZGraph output to files


sharesInSellSideBeforeOpeningFile

public EZGraphImpl sharesInSellSideBeforeOpeningFile
our graphics or EZGraph output to files


quantitySpreadGraph

public EZGraphImpl quantitySpreadGraph
our graphics or EZGraph output to files


currentQuantitySpreadFile

public EZGraphImpl currentQuantitySpreadFile
our graphics or EZGraph output to files


firstLastSpreadGraph

public EZGraphImpl firstLastSpreadGraph
our graphics or EZGraph output to files


currentBuyFirstLastSpreadFile

public EZGraphImpl currentBuyFirstLastSpreadFile
our graphics or EZGraph output to files


currentSellFirstLastSpreadFile

public EZGraphImpl currentSellFirstLastSpreadFile
our graphics or EZGraph output to files

Constructor Detail

ObserverSwarm

public ObserverSwarm(Zone aZone)
Constructor for a new ObserverSwarm.

Method Detail

buildObjects

public java.lang.Object buildObjects()
Create the objects used to display the model.


buildActions

public java.lang.Object buildActions()
Create the actions necessary for the simulation. This is where the schedule is built (but not run!) Here we create a display schedule - this is used to display the state of the world and check for user input.


activateIn

public Activity activateIn(Swarm swarmContext)
Activate the schedules so that they are ready to run. The swarmContext argument is the zone in which the ObserverSwarm is activated. Typically the ObserverSwarm is the top-level swarm, so it is activated in "null". The other (sub)swarms and schedules will be activated inside of the ObserverSwarm context.


checkToStop

public void checkToStop()
To check for the stopping conditions.