com.speckled.specksim.imp.stats
Class LeaderStatisticModule

java.lang.Object
  extended by com.speckled.specksim.statistics.StatisticsModule
      extended by com.speckled.specksim.imp.stats.LeaderStatisticModule

public class LeaderStatisticModule
extends StatisticsModule

Gathers statistics about the specks that have a notion of a leader speck

Author:
ryanm

Field Summary
 
Fields inherited from class com.speckled.specksim.statistics.StatisticsModule
DEFAULT_HISTORY
 
Constructor Summary
LeaderStatisticModule()
           
 
Method Summary
 float[] generateStatistics(StateSink state)
          Generate a statistics set for the supplied state.
 java.lang.String getName()
          Gets a name for this module
protected  java.lang.String[] statisticDescriptions()
          Override this method to return an array of descriptive Strings for the statistics calculated by this StatisticsModule.
protected  java.lang.String[] statisticNames()
          Get the names of the statistics that will be generated by this module
 
Methods inherited from class com.speckled.specksim.statistics.StatisticsModule
getHistory, getHistoryLength, getHistoryTimes, getStatisticDescriptions, getStatisticNames, getStatistics, isIncluded, setHistoryLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeaderStatisticModule

public LeaderStatisticModule()
Method Detail

getName

public java.lang.String getName()
Description copied from class: StatisticsModule
Gets a name for this module

Specified by:
getName in class StatisticsModule
Returns:
A name for this module

generateStatistics

public float[] generateStatistics(StateSink state)
Description copied from class: StatisticsModule
Generate a statistics set for the supplied state. This may return null if the state is not suitable for this module. For example, it would be difficult to generate location-based statistics for a field of non-LocationAware Specks.

Specified by:
generateStatistics in class StatisticsModule
Parameters:
state - The Simulator state on which to operate
Returns:
A float array of the results, or null if the statistic cannot be generated for the supplied state

statisticNames

protected java.lang.String[] statisticNames()
Description copied from class: StatisticsModule
Get the names of the statistics that will be generated by this module

Specified by:
statisticNames in class StatisticsModule
Returns:
A String of descriptive names for the returned statistics

statisticDescriptions

protected java.lang.String[] statisticDescriptions()
Description copied from class: StatisticsModule
Override this method to return an array of descriptive Strings for the statistics calculated by this StatisticsModule.

Overrides:
statisticDescriptions in class StatisticsModule
Returns:
An array of descriptions for the statistics