Package microsim.statistics.functions
Class MultiTraceFunction.Integer
- java.lang.Object
-
- microsim.statistics.functions.MultiTraceFunction
-
- microsim.statistics.functions.MultiTraceFunction.Integer
-
- All Implemented Interfaces:
EventListener
,IDoubleSource
,IIntSource
,IUpdatableSource
- Enclosing class:
- MultiTraceFunction
public static class MultiTraceFunction.Integer extends MultiTraceFunction implements IIntSource
An implementation of the MemorylessSeries class, which manages integer type data sources.Title: JAS
Description: Java Agent-based Simulation library
Copyright (C) 2002 Michele Sonnessa
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.- Author:
- Michele Sonnessa and Ross Richardson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class microsim.statistics.functions.MultiTraceFunction
MultiTraceFunction.Double, MultiTraceFunction.Float, MultiTraceFunction.Integer, MultiTraceFunction.Long, MultiTraceFunction.Variables
-
Nested classes/interfaces inherited from interface microsim.statistics.IIntSource
IIntSource.Variables
-
-
Constructor Summary
Constructors Constructor Description Integer(java.lang.Object source, java.lang.String valueName, boolean getFromMethod)
Create a basic statistic probe on a generic object.Integer(IIntSource source, java.lang.Enum<?> valueID)
Create a basic statistic probe on a IDblSource object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDoubleValue(java.lang.Enum<?> valueID)
Return the result of a given statistic.int
getIntValue(java.lang.Enum<?> valueID)
Return the result of a given statistic.int
getLastValue()
Return the last int value read from the source object.int
getMax()
The maximum function.double
getMean()
The mean function.int
getMin()
The minimum function.int
getSum()
The sum function.double
getVariance()
The variance function.void
updateSource()
Read the source values and update statistics.-
Methods inherited from class microsim.statistics.functions.MultiTraceFunction
getCount, onEvent
-
-
-
-
Constructor Detail
-
Integer
public Integer(IIntSource source, java.lang.Enum<?> valueID)
Create a basic statistic probe on a IDblSource object.- Parameters:
source
- The IDblSource object.valueID
- The value identifier defined by source object.
-
Integer
public Integer(java.lang.Object source, java.lang.String valueName, boolean getFromMethod)
Create a basic statistic probe on a generic object.- Parameters:
source
- A generic source object.valueName
- The name of the field or the method returning the variable to be probed.getFromMethod
- Specifies if valueName is a method or a property value.
-
-
Method Detail
-
updateSource
public void updateSource()
Read the source values and update statistics.- Specified by:
updateSource
in interfaceIUpdatableSource
- Overrides:
updateSource
in classMultiTraceFunction
-
getDoubleValue
public double getDoubleValue(java.lang.Enum<?> valueID)
Return the result of a given statistic.- Specified by:
getDoubleValue
in interfaceIDoubleSource
- Overrides:
getDoubleValue
in classMultiTraceFunction
- Parameters:
valueID
- One of the F_ constants representing available statistics.- Returns:
- The computed value.
- Throws:
java.lang.UnsupportedOperationException
- If the given valueID is not supported.
-
getIntValue
public int getIntValue(java.lang.Enum<?> valueID)
Return the result of a given statistic.- Specified by:
getIntValue
in interfaceIIntSource
- Parameters:
valueID
- One of the F_ constants representing available statistics.- Returns:
- The computed value.
- Throws:
java.lang.UnsupportedOperationException
- If the given valueID is not supported.
-
getVariance
public double getVariance()
The variance function.- Specified by:
getVariance
in classMultiTraceFunction
- Returns:
- The variance value.
-
getLastValue
public int getLastValue()
Return the last int value read from the source object.- Returns:
- A int value collected at the last reading operation.
-
getMax
public int getMax()
The maximum function.- Returns:
- The maximum value.
-
getSum
public int getSum()
The sum function.- Returns:
- The sum of collected values.
-
getMin
public int getMin()
The minimum function.- Returns:
- The minimum value.
-
getMean
public double getMean()
The mean function.- Specified by:
getMean
in classMultiTraceFunction
- Returns:
- The mean value.
-
-