edu.brook.ascape.rule
Class CollectStats

java.lang.Object
  |
  +--edu.brook.ascape.model.AscapeObject
        |
        +--edu.brook.ascape.rule.Rule
              |
              +--edu.brook.ascape.rule.CollectStats

public class CollectStats
extends Rule

A rule for gathering values (typically aggegate statistics) from the entire population of agents.

Since:
1.0
Version:
1.0.1
See Also:
Serialized Form

Field Summary
protected  StatCollector[] autoSeriesStatCollectors
          The stats to be collected automatically.
protected  StatCollector[] autoSeriesStatCollectors2
          The stats to be collected automatically.
protected  int phase
           
protected  StatCollector[] stats
          The stats to be collected.
 
Fields inherited from class edu.brook.ascape.model.AscapeObject
ARBITRARY_SEED, count, name, scape
 
Constructor Summary
CollectStats()
          Constructs a new stat collecting rule.
CollectStats(StatCollector[] statCollectors)
          Constructs a new stat collecting rule.
 
Method Summary
 void addStatCollector(StatCollector addDataPoint)
          Adds value stats to the collection rule.
 void addStatCollectors(StatCollector[] addDataPoints)
          Adds value stats to the collection rule.
 void calculateValues()
          Clears the values so that they can be collected for the next iteration.
 void clear()
          Clears the values so that they can be collected for the next iteration.
 void execute(Agent agent)
          Collects all values for the agent.
 StatCollector[] getStatCollectors()
          Returns the stats used to collect values from the scape.
 boolean isIterateAll()
          Returns true.
 boolean isRandomExecution()
          Returns false; it doesn't matter what order we collect statistics in.
 void setPhase(int phase)
           
 
Methods inherited from class edu.brook.ascape.rule.Rule
getScape, isCauseRemoval, setScape
 
Methods inherited from class edu.brook.ascape.model.AscapeObject
clone, getName, getRandom, getRandomSeed, randomInRange, randomInRange, randomIs, randomToLimit, reseed, setName, setRandom, setRandomSeed, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stats

protected StatCollector[] stats
The stats to be collected.

autoSeriesStatCollectors

protected StatCollector[] autoSeriesStatCollectors
The stats to be collected automatically.

autoSeriesStatCollectors2

protected StatCollector[] autoSeriesStatCollectors2
The stats to be collected automatically.

phase

protected int phase
Constructor Detail

CollectStats

public CollectStats()
Constructs a new stat collecting rule.

CollectStats

public CollectStats(StatCollector[] statCollectors)
Constructs a new stat collecting rule. This constructor is prvided to make it easier to build static stat collectors.
Parameters:
statCollectors - the stats to use
Method Detail

getStatCollectors

public StatCollector[] getStatCollectors()
Returns the stats used to collect values from the scape.

addStatCollectors

public void addStatCollectors(StatCollector[] addDataPoints)
Adds value stats to the collection rule. Typically not called directly, but through Scape. Only adds stats that have autoCollect true.
Parameters:
addStatCollector - the stats to add
See Also:
Scape.addStatCollectors(edu.brook.ascape.util.StatCollector[]), StatCollector.isAutoCollect()

addStatCollector

public void addStatCollector(StatCollector addDataPoint)
Adds value stats to the collection rule. Typically not called directly.

clear

public void clear()
Clears the values so that they can be collected for the next iteration.

calculateValues

public void calculateValues()
Clears the values so that they can be collected for the next iteration.

execute

public void execute(Agent agent)
Collects all values for the agent.
Parameters:
agent - the target agent.
Overrides:
execute in class Rule

setPhase

public void setPhase(int phase)

isRandomExecution

public boolean isRandomExecution()
Returns false; it doesn't matter what order we collect statistics in.
Overrides:
isRandomExecution in class Rule

isIterateAll

public boolean isIterateAll()
Returns true.
Overrides:
isIterateAll in class Rule

(c) 1998-2000 The Brookings Insitution
Webpage