AggregPacking
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
aggregpacking::FullerCurveRandomizer Class Reference

Random size generator for Fuller curve. More...

#include <randomizer.hpp>

Inheritance diagram for aggregpacking::FullerCurveRandomizer:
aggregpacking::AggregSizeRandomizer aggregpacking::Randomizer

Public Types

typedef vector< double > sizes_t
 typedef for sizes type
 

Public Member Functions

 FullerCurveRandomizer ()
 Default constructor. More...
 
 FullerCurveRandomizer (int n, double e, double minSize, double maxSize)
 Constructor. More...
 
 FullerCurveRandomizer (int n, double e, double minSize, double maxSize, const string &m)
 Constructor. More...
 
virtual double cdf (double size) const
 
double getExponent ()
 Getter for exponent.
 
void setExponent (double v)
 Setter for exponent.
 
virtual double getMinSize () const
 Returns minimum defined size.
 
virtual double getMaxSize () const
 Returns maximum defined size.
 
virtual const string & getClassName ()
 Returns string representation of FullerCurveRandomizer class name.
 
double take () const
 Returns random size. A lot of random sizes should converge to the prescribed sieve curve. Mass/volume of aggregate is assumed pow(size,3)
 
const sizes_tgetSizes ()
 Getter for sizes.
 
string getFileName ()
 Getter for file name.
 
virtual void save (const string &fName) const
 Saves receiver into specified file. More...
 
virtual void save () const
 Saves receiver into this->fileName.
 
virtual bool load (const string &fName)
 Loads receiver from specified file. More...
 
virtual bool load ()
 Loads receiver from this->fileName. More...
 

Static Public Member Functions

static double random ()
 Returns random number in the interval [0,1) (with uniform distribution)
 
static double randint (int m)
 Returns random integer in the interval [0,m-1] (with uniform istribution) More...
 
static int getSeed ()
 Getter for seed.
 
static void setSeed (int s)
 Setter for seed. More...
 

Static Public Attributes

static const string className = "FullerCurveRandomizer"
 String representation of FullerCurveRandomizer class name.
 

Protected Member Functions

void initSizes (unsigned int nMinValues)
 According to given parameters, constructs sizes. It is numerically converted sieve curve from terms of cumulative volume to the terms of sizes.
 
void saveSizes (ostream &os) const
 Save sizes to ostream. More...
 
void loadSizes (istream &is)
 Load sizes from istream. More...
 

Static Protected Member Functions

static AggregSizeRandomizerLoad (istream &is)
 Create and return a new AggregSizeRandomizer from given istream. More...
 

Protected Attributes

double exponent
 Exponent of analytical expression.
 
double minSize
 User defined minimum aggregate size.
 
double maxSize
 Maximum size from the analytical expression.
 
sizes_t sizes
 Array of increasing sizes. Discrete representation of given sieve curve in terms of aggregate size.
 
string fileName
 File name for saving itself.
 

Friends

ostream & operator<< (ostream &f, const FullerCurveRandomizer &o)
 FullerCurveRandomizer to ostream shift operator.
 
istream & operator>> (istream &f, FullerCurveRandomizer &o)
 FullerCurveRandomizer from istream shift operator.
 

Detailed Description

Random size generator for Fuller curve.

Fuller curve is defined as P(d) = (d/dmax)^n. Exponent n is usually between 0.4-0.7, most often 0.5. Apart from dmax (maximum aggrgate size), also minimum aggregate size has to be defined

Constructor & Destructor Documentation

aggregpacking::FullerCurveRandomizer::FullerCurveRandomizer ( )
inline

Default constructor.

sets exponent=0.5, minSize=0.5e-3, maxSize=16e-3

aggregpacking::FullerCurveRandomizer::FullerCurveRandomizer ( int  n,
double  e,
double  minSize,
double  maxSize 
)
inline

Constructor.

Parameters
nminimum length of sizes attribute
eexponent
minSizeminimum aggregate size
maxSizemaximum aggregate size
aggregpacking::FullerCurveRandomizer::FullerCurveRandomizer ( int  n,
double  e,
double  minSize,
double  maxSize,
const string &  m 
)
inline

Constructor.

Parameters
nminimum length of sizes attribute
eexponent
minSizeminimum aggregate size
maxSizemaximum aggregate size
mfile name

Member Function Documentation

double aggregpacking::FullerCurveRandomizer::cdf ( double  size) const
virtual

Cumulative relative mass function. Returns what is the total mass of all aggregates spmaller than given size (normalized with total mass of all aggregates)

Parameters
sizegiven size
Returns
relative cumulative mass of all particles smaller than given size

Implements aggregpacking::AggregSizeRandomizer.

AggregSizeRandomizer * aggregpacking::AggregSizeRandomizer::Load ( istream &  is)
staticprotectedinherited

Create and return a new AggregSizeRandomizer from given istream.

Parameters
isinput stream
virtual bool aggregpacking::AggregSizeRandomizer::load ( const string &  fName)
inlinevirtualinherited

Loads receiver from specified file.

Parameters
fNamegiven file name
Returns
true if successful, false otherwise
virtual bool aggregpacking::AggregSizeRandomizer::load ( )
inlinevirtualinherited

Loads receiver from this->fileName.

Returns
true if successful, false otherwise
void aggregpacking::AggregSizeRandomizer::loadSizes ( istream &  is)
protectedinherited

Load sizes from istream.

Parameters
isinput stream
static double aggregpacking::Randomizer::randint ( int  m)
inlinestaticinherited

Returns random integer in the interval [0,m-1] (with uniform istribution)

Parameters
mupper limit if the interval
virtual void aggregpacking::AggregSizeRandomizer::save ( const string &  fName) const
inlinevirtualinherited

Saves receiver into specified file.

Parameters
fNamegiven file name
void aggregpacking::AggregSizeRandomizer::saveSizes ( ostream &  os) const
protectedinherited

Save sizes to ostream.

Parameters
osoutput stream
static void aggregpacking::Randomizer::setSeed ( int  s)
inlinestaticinherited

Setter for seed.

Parameters
snew seed

The documentation for this class was generated from the following files: