nl.tudelft.simulation.jstats.distributions.empirical
Interface ObservationsInterface

All Known Implementing Classes:
Observations

public interface ObservationsInterface

The observations interface is an interface for empirical observations to be used in JStats.

(c) copyright 2002-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.2
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:44 $
Author:
Alexander Verbraeck
Peter Jacobs

Nested Class Summary
static interface ObservationsInterface.Entry
          A structure entry (observation-cummulative probability pair).
 
Field Summary
static byte CUMPROBABILITY
          the CUMPROBABILITY attribute used to define whether operations should be applied on the OBSERVATION or on the CUMPROBABILITY
static byte OBSERVATION
          the OBSERVATION attribute used to define whether operations should be applied on the OBSERVATION or on the CUMPROBABILITY
 
Method Summary
 boolean contains(Number object, byte type)
          returns whether the structure contains this specific object (either an observation or a probability).
 ObservationsInterface.Entry get(int index)
          Returns the element at the specified position in this structure.
 ObservationsInterface.Entry getCeilingEntry(Number object, byte type, boolean inclusive)
          Gets the entry corresponding to the specified object if inclusive; if not inclusive or such entry does not exists, returns the entry for the least object greater than the specified object; if no such entry exists (i.e., the greatest object in the Tree is less than the specified object), returns null.
 List getCumProbabilities()
          Returns the observations
 ObservationsInterface.Entry getEntry(Number object, byte type)
          Returns the entry to which the structure maps the specific object.
 int getIndex(ObservationsInterface.Entry entry)
          Returns the index of the entry of this structure.
 List getObservations()
          Returns the observations
 ObservationsInterface.Entry getPrecedingEntry(Number object, byte type, boolean inclusive)
          Gets the entry corresponding to the specified object if inclusive; if not inclusive or such entry does not exists, returns the entry for the greatest object less than the specified object; if no such entry exists (i.e., the least object in the Tree is greater than the specified object), returns null.
 boolean isEmpty()
          Returns true if this structure contains no object-value mappings.
 boolean isGrouped()
          Returns true if this structure contains grouped empirical data.
 int size()
          Returns the number of observation-probability mappings in this structure.
 

Field Detail

OBSERVATION

static final byte OBSERVATION
the OBSERVATION attribute used to define whether operations should be applied on the OBSERVATION or on the CUMPROBABILITY

See Also:
Constant Field Values

CUMPROBABILITY

static final byte CUMPROBABILITY
the CUMPROBABILITY attribute used to define whether operations should be applied on the OBSERVATION or on the CUMPROBABILITY

See Also:
Constant Field Values
Method Detail

size

int size()
Returns the number of observation-probability mappings in this structure. If the structure contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:
the number of object-value mappings in this structure.

isEmpty

boolean isEmpty()
Returns true if this structure contains no object-value mappings.

Returns:
true if this structure contains no object-value mappings.

isGrouped

boolean isGrouped()
Returns true if this structure contains grouped empirical data.

Returns:
true if this structure contains grouped empirical data.

getIndex

int getIndex(ObservationsInterface.Entry entry)
Returns the index of the entry of this structure. Returns -1 if entry not in structure.

Parameters:
entry - the entry
Returns:
the index of this entry.

contains

boolean contains(Number object,
                 byte type)
returns whether the structure contains this specific object (either an observation or a probability).

Parameters:
object - the object to look for
type - the type (either the ObservationsInterface.OBSERVATION or the ObservationsInterface.CUMPROBABILITY)
Returns:
true if object in observation.

getObservations

List getObservations()
Returns the observations

Returns:
the list of observations

getCumProbabilities

List getCumProbabilities()
Returns the observations

Returns:
the list of observations

getEntry

ObservationsInterface.Entry getEntry(Number object,
                                     byte type)
Returns the entry to which the structure maps the specific object. Returns null if the structure contains no entry for the object. The object might either refer to an observation or to a probability. If multiple entries match the search, there is no garantuee which entry is returned.

Parameters:
object - entry whose associated entry is to be returned.
type - the type (either the ObservationsInterface.OBSERVATION or the ObservationsInterface.CUMPROBABILITY)
Returns:
the entries which comply.

getPrecedingEntry

ObservationsInterface.Entry getPrecedingEntry(Number object,
                                              byte type,
                                              boolean inclusive)
Gets the entry corresponding to the specified object if inclusive; if not inclusive or such entry does not exists, returns the entry for the greatest object less than the specified object; if no such entry exists (i.e., the least object in the Tree is greater than the specified object), returns null. If multiple entries match the search, there is no garantuee which entry is returned.

Parameters:
object - object whose next object associated value is to be returned.
type - the type (either the ObservationsInterface.OBSERVATION or the ObservationsInterface.CUMPROBABILITY)
inclusive - if inclusive and structure contains object object is returned
Returns:
the value to which this structure maps the specified object, or null if the structure contains no mapping for this object.

getCeilingEntry

ObservationsInterface.Entry getCeilingEntry(Number object,
                                            byte type,
                                            boolean inclusive)
Gets the entry corresponding to the specified object if inclusive; if not inclusive or such entry does not exists, returns the entry for the least object greater than the specified object; if no such entry exists (i.e., the greatest object in the Tree is less than the specified object), returns null. If multiple entries match the search, there is no garantuee which entry is returned.

Parameters:
object - object whose associated value is to be returned.
type - the type (either the ObservationsInterface.OBSERVATION or the ObservationsInterface.CUMPROBABILITY)
inclusive - if inclusive and structure contains object object is returned
Returns:
the value to which this structure maps the specified object, or null if the structure contains no mapping for this object.

get

ObservationsInterface.Entry get(int index)
Returns the element at the specified position in this structure.

Parameters:
index - index of element to return.
Returns:
the entry at the specified position in this list.


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.