Class ModelSwarm

java.lang.Object
  extended bySwarmImpl
      extended byModelSwarm

public class ModelSwarm
extends SwarmImpl

The Model of JavaSum. The Model contains the Units and all the related tools.

Author:
Marco Agagliate
See Also:
Serialized Form

Field Summary
 ListImpl agentList
          The list of all the agents.
 int agentNumber
          The total number of agents.
 double agentProbToActBelowFloorP
          The probability to act below floor price.
 double agentProbToActInOpeningOrClosingAuctions
          The probability of placing an order in the opening or closing phase.
 double agentProbToActWithMarketPrice
          The probability of placing an order with market price.
 RandomAgent anAgent1
          The agents of the simulation.
 MarketImitatingAgent anAgent2
           
 LocallyImitatingAgent anAgent3
           
 StopLossAgent anAgent4
           
 double asymmetricBuySellProb
          The asimmetry of buy and sell probability.
 double asymmetricRange
          The asimmetry of max/minCorrectingCoeff.
 int checkingIfShortOrLong
          To check the position(sharequantity) of the agent.
 int dayNumber
          The number of current day.
 double floorP
          The minimum price at which the agents acts.
 ListImpl indexAgentList
          The list of the agents in create order.
 ListIndex indexAgentListIndex
          Its iterator.
 int instantNumber
          The total number of instants per day.
 ListImpl locallyImitatingAgentList
          The list of the LocallyImitatingAgents.
 int locallyImitatingAgentNumber
           
 ListImpl marketImitatingAgentList
          The list of the MarketImitatingAgents.
 int marketImitatingAgentNumber
           
 double maxCorrectingCoeff
          The coefficient that RandomAgents multiplays by the last price for the order.
 double maxLossRate
          The max rate of loss that stop loss agents effort.
 int maxNumberOfOperatingAgents
          The maximum number of operating agents.
 int maxOrderQuantity
          The maximum number of order per agent.
 double minCorrectingCoeff
          The coefficient that RandomAgents multiplays by the last price for the order.
 ActionGroupImpl modelActions1
          ActionGroup for holding an ordered sequence of action.
 ActionGroupImpl modelActions2
          ActionGroup for holding an ordered sequence of action.
 ActionGroupImpl modelActions3
          ActionGroup for holding an ordered sequence of action.
 ActionGroupImpl modelActions4
          ActionGroup for holding an ordered sequence of action.
 ActionGroupImpl modelActionsLS
          ActionGroup for holding an ordered sequence of action.
 ScheduleImpl modelSchedule
          The Schedule operating in the Model.
 int percentageOfOperatingAgents
          The percentage quota of agents which act in the market.
 int printing
          If 1 book prints data on the terminal window, 2 for Agent.
 ListImpl randomAgentList
          The list of the RandomAgents.
 int randomAgentNumber
           
 RandomRuleMaster randomRuleMaster
          The randomRuleMaster manages RandomAgents.
 ListImpl stopLossAgentList
          The list of the StopLossAgents.
 int stopLossAgentNumber
           
 int stopLossInterval
          The interval that stop loss agents consider for their strategy.
 StopLossRuleMaster stopLossRuleMaster
          The stopLossRuleMaster manages StopLossAgents.
 Book theBook
          The book of the simulation.
 CurrentAgent theCurrentAgent
          This is a "ghost agent".
 CurrentInstant theCurrentInstant
          The object for the calls of the agents.
 boolean typeOfPercentage
          The type of percetage of agents.
 
Constructor Summary
ModelSwarm(Zone aZone)
          Constructor for a new ModelSwarm.
 
Method Summary
 Activity activateIn(Swarm swarmContext)
          Now set up the model's activation. swarmContext indicates where we're being started in - typically, this model is run as a subswarm of an observer swarm.
 java.lang.Object buildActions()
          Here is where the model schedule is built, the data structures that define the simulation of time in the model.
 java.lang.Object buildObjects()
          Build the model objects.
 ListImpl getAgentList()
          The method returns the list of the agents.
 ListIndex getAgentListIndex()
          The method returns the index of indexAgentList.
 Book getBook()
          The method returns the book.
 int getCurrentDay()
          The method returns the number of the day.
 ListImpl getLocallyImitatingAgentList()
          The method returns the list of the LocallyImitatingAgents.
 ListImpl getMarketImitatingAgentList()
          The method returns the list of the MarketImitatingAgents.
 ListImpl getRandomAgentList()
          The method returns the list of the RandomAgents.
 ListImpl getStopLossAgentList()
          The method returns the list of the StopLossAgents.
 void increaseCurrentDayNumber()
          The method increases the number of the day.
 void openProbeTo(int n)
          The method opens the probe on an agent.
 void setAgentNumber()
          The method set the number of the agents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

randomAgentNumber

public int randomAgentNumber

marketImitatingAgentNumber

public int marketImitatingAgentNumber

locallyImitatingAgentNumber

public int locallyImitatingAgentNumber

stopLossAgentNumber

public int stopLossAgentNumber

agentNumber

public int agentNumber
The total number of agents.


instantNumber

public int instantNumber
The total number of instants per day.


dayNumber

public int dayNumber
The number of current day.


asymmetricBuySellProb

public double asymmetricBuySellProb
The asimmetry of buy and sell probability.


minCorrectingCoeff

public double minCorrectingCoeff
The coefficient that RandomAgents multiplays by the last price for the order.


maxCorrectingCoeff

public double maxCorrectingCoeff
The coefficient that RandomAgents multiplays by the last price for the order.


asymmetricRange

public double asymmetricRange
The asimmetry of max/minCorrectingCoeff.


agentProbToActWithMarketPrice

public double agentProbToActWithMarketPrice
The probability of placing an order with market price.


agentProbToActInOpeningOrClosingAuctions

public double agentProbToActInOpeningOrClosingAuctions
The probability of placing an order in the opening or closing phase. So a day starts and finish with an action, with a realistic effect.


floorP

public double floorP
The minimum price at which the agents acts.


agentProbToActBelowFloorP

public double agentProbToActBelowFloorP
The probability to act below floor price.


maxOrderQuantity

public int maxOrderQuantity
The maximum number of order per agent.


maxLossRate

public double maxLossRate
The max rate of loss that stop loss agents effort.


stopLossInterval

public int stopLossInterval
The interval that stop loss agents consider for their strategy.


checkingIfShortOrLong

public int checkingIfShortOrLong
To check the position(sharequantity) of the agent.


percentageOfOperatingAgents

public int percentageOfOperatingAgents
The percentage quota of agents which act in the market.


maxNumberOfOperatingAgents

public int maxNumberOfOperatingAgents
The maximum number of operating agents.


typeOfPercentage

public boolean typeOfPercentage
The type of percetage of agents. If it is true percentage is a maximum value; if it is false percentage is a fixed value.


printing

public int printing
If 1 book prints data on the terminal window, 2 for Agent.


agentList

public ListImpl agentList
The list of all the agents.


randomAgentList

public ListImpl randomAgentList
The list of the RandomAgents.


marketImitatingAgentList

public ListImpl marketImitatingAgentList
The list of the MarketImitatingAgents.


locallyImitatingAgentList

public ListImpl locallyImitatingAgentList
The list of the LocallyImitatingAgents.


stopLossAgentList

public ListImpl stopLossAgentList
The list of the StopLossAgents.


indexAgentList

public ListImpl indexAgentList
The list of the agents in create order.


indexAgentListIndex

public ListIndex indexAgentListIndex
Its iterator.


modelActions1

public ActionGroupImpl modelActions1
ActionGroup for holding an ordered sequence of action.


modelActionsLS

public ActionGroupImpl modelActionsLS
ActionGroup for holding an ordered sequence of action.


modelActions2

public ActionGroupImpl modelActions2
ActionGroup for holding an ordered sequence of action.


modelActions3

public ActionGroupImpl modelActions3
ActionGroup for holding an ordered sequence of action.


modelActions4

public ActionGroupImpl modelActions4
ActionGroup for holding an ordered sequence of action.


modelSchedule

public ScheduleImpl modelSchedule
The Schedule operating in the Model.


theBook

public Book theBook
The book of the simulation.


anAgent1

public RandomAgent anAgent1
The agents of the simulation.


anAgent2

public MarketImitatingAgent anAgent2

anAgent3

public LocallyImitatingAgent anAgent3

anAgent4

public StopLossAgent anAgent4

randomRuleMaster

public RandomRuleMaster randomRuleMaster
The randomRuleMaster manages RandomAgents.


stopLossRuleMaster

public StopLossRuleMaster stopLossRuleMaster
The stopLossRuleMaster manages StopLossAgents.


theCurrentAgent

public CurrentAgent theCurrentAgent
This is a "ghost agent". See the comments of CurrentAgent class.


theCurrentInstant

public CurrentInstant theCurrentInstant
The object for the calls of the agents.

Constructor Detail

ModelSwarm

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

Method Detail

buildObjects

public java.lang.Object buildObjects()
Build the model objects.


buildActions

public java.lang.Object buildActions()
Here is where the model schedule is built, the data structures that define the simulation of time in the model. The core is an actionGroup that has a list of actions. Then that's put in a Schedule.


activateIn

public Activity activateIn(Swarm swarmContext)
Now set up the model's activation. swarmContext indicates where we're being started in - typically, this model is run as a subswarm of an observer swarm.


increaseCurrentDayNumber

public void increaseCurrentDayNumber()
The method increases the number of the day.


setAgentNumber

public void setAgentNumber()
The method set the number of the agents.


getCurrentDay

public int getCurrentDay()
The method returns the number of the day.


getAgentList

public ListImpl getAgentList()
The method returns the list of the agents.


getRandomAgentList

public ListImpl getRandomAgentList()
The method returns the list of the RandomAgents.


getMarketImitatingAgentList

public ListImpl getMarketImitatingAgentList()
The method returns the list of the MarketImitatingAgents.


getLocallyImitatingAgentList

public ListImpl getLocallyImitatingAgentList()
The method returns the list of the LocallyImitatingAgents.


getStopLossAgentList

public ListImpl getStopLossAgentList()
The method returns the list of the StopLossAgents.


getAgentListIndex

public ListIndex getAgentListIndex()
The method returns the index of indexAgentList.


getBook

public Book getBook()
The method returns the book.


openProbeTo

public void openProbeTo(int n)
The method opens the probe on an agent.