edu.uiuc.ge.illigal.gale.data
Class RandomSamplingDataView

java.lang.Object
  |
  +--edu.uiuc.ge.illigal.gale.data.RandomSamplingDataView
All Implemented Interfaces:
OrderedSet

public class RandomSamplingDataView
extends java.lang.Object
implements OrderedSet

This class is a view over a certain InstanceMemory.

Since:
0.9alpha
Version:
0.9alpha
Author:
Xavier Llorà <xllora@illigal.ge.uiuc.edu>

Field Summary
private  float fProportion
          The proportion of instances randomly pick
private  int iMaxSize
          The maximum number of instances available
private  int iSize
          The number of instances randomly pick
private  edu.uiuc.ge.illigal.gale.data.OrderedSet osData
          The Ordered data set
private  java.util.Random rnd
          The random number generator object
 
Constructor Summary
RandomSamplingDataView(edu.uiuc.ge.illigal.gale.data.OrderedSet os, float fProp, java.util.Random r)
          Builds a view over the OrderSet given.
 
Method Summary
 edu.uiuc.ge.illigal.gale.data.Instance getInstance(int iPos)
          Returns the instance for the given position
 int getSize()
          Returns the number of instances in the OrderedSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

osData

private edu.uiuc.ge.illigal.gale.data.OrderedSet osData
The Ordered data set


iSize

private int iSize
The number of instances randomly pick


iMaxSize

private int iMaxSize
The maximum number of instances available


fProportion

private float fProportion
The proportion of instances randomly pick


rnd

private java.util.Random rnd
The random number generator object

Constructor Detail

RandomSamplingDataView

public RandomSamplingDataView(edu.uiuc.ge.illigal.gale.data.OrderedSet os,
                              float fProp,
                              java.util.Random r)
Builds a view over the OrderSet given.

Parameters:
os - The ordered set that contains the data
fProp - The proportion of os instances to show
r - The random number generator
Method Detail

getInstance

public edu.uiuc.ge.illigal.gale.data.Instance getInstance(int iPos)
Description copied from interface: OrderedSet
Returns the instance for the given position

Specified by:
getInstance in interface OrderedSet
Parameters:
iPos - Index of the requested instance
Returns:
The value of the requested index

getSize

public int getSize()
Description copied from interface: OrderedSet
Returns the number of instances in the OrderedSet

Specified by:
getSize in interface OrderedSet
Returns:
The number of instances