|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--gridsim.GridSimRandom
GridSim Random provides static methods for incorporating randomness in data used for any simulation.
Any predicted or estimated data, e.g. number of Gridlets used by an experiment, execution time and output size of a Gridlet, etc. need to present in the prediction or estimation process and the randomness that exists in the nature itself.
Example: to produce a random number between 18.00 and 22.00, need to invoke GridSimRandom.real(20.0, 0.1, 0.1, randDouble) where randDouble comes from java.util.Random.
Gridlet
,
Random
Constructor Summary | |
GridSimRandom()
Allocates a new GridSimRandom object |
|
GridSimRandom(long seed)
Allocates a new GridSimRandom object using a single long seed |
|
GridSimRandom(long seed,
double lessFactorIO,
double moreFactorIO,
double lessFactorExec,
double moreFactorExec)
Allocates a new GridSimRandom object with specified parameters |
Method Summary | |
static double |
double_sample()
Deprecated. As of GridSim 2.1, replaced by doubleSample() |
static double |
doubleSample()
Gets the random double value from java.util.Random |
static double |
expected_e(double value)
Deprecated. As of GridSim 2.1, replaced by expectedExec(double) |
static double |
expected_io(double value)
Deprecated. As of GridSim 2.1, replaced by expectedIO(double) |
static double |
expectedExec(double value)
Gets the expected factor of Execution |
static double |
expectedIO(double value)
Gets the expected factor of Network I/O |
static double |
get_factor_e()
Deprecated. As of GridSim 2.1, replaced by getFactorExec() |
static double |
get_factor_io()
Deprecated. As of GridSim 2.1, replaced by getFactorIO() |
static double |
getFactorExec()
Gets the average factor of Execution |
static double |
getFactorIO()
Gets the average factor of Network I/O |
static int |
int_sample(int range)
Deprecated. As of GridSim 2.1, replaced by intSample(int) |
static int |
intSample(int range)
Gets the random int value from java.util.Random |
static double |
real_e(double value)
Deprecated. As of GridSim 2.1, replaced by realExec(double) |
static double |
real_io(double value)
Deprecated. As of GridSim 2.1, replaced by realIO(double) |
static double |
real(double value,
double lessFactor,
double moreFactor,
double randDouble)
Maps the predicted or estimated value to a random real-world number between (1 - lessFactor) * value and (1 + moreFactor) * value. |
static double |
realExec(double value)
Gets the real number from the factors of Execution |
static double |
realIO(double value)
Gets the real number from the factors of Network I/O |
static void |
set_factors(double lessFactorIOValue,
double moreFactorIOValue,
double lessFactorExecValue,
double moreFactorExecValue)
Deprecated. As of GridSim 2.1, replaced by setAllFactors(double,
double, double, double) |
static void |
set_less_factor_e(double factor)
Deprecated. As of GridSim 2.1, replaced by setLessFactorExec(double) |
static void |
set_less_factor_io(double factor)
Deprecated. As of GridSim 2.1, replaced by setLessFactorIO(double) |
static void |
set_more_factor_e(double factor)
Deprecated. As of GridSim 2.1, replaced by setMoreFactorExec(double) |
static void |
set_more_factor_io(double factor)
Deprecated. As of GridSim 2.1, replaced by setMoreFactorIO(double) |
static void |
setAllFactors(double lessFactorIOValue,
double moreFactorIOValue,
double lessFactorExecValue,
double moreFactorExecValue)
Sets the Network I/O and execution values |
static void |
setLessFactorExec(double factor)
Sets the less factor of Execution |
static void |
setLessFactorIO(double factor)
Sets the less factor of Network I/O |
static void |
setMoreFactorExec(double factor)
Sets the more factor of Execution |
static void |
setMoreFactorIO(double factor)
Sets the more factor of Network I/O |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GridSimRandom()
public GridSimRandom(long seed)
seed
- the initial seedpublic GridSimRandom(long seed, double lessFactorIO, double moreFactorIO, double lessFactorExec, double moreFactorExec)
seed
- the initial seedlessFactorIO
- less factor for Network I/OmoreFactorIO
- more factor for Network I/OlessFactorExec
- less factor for executionmoreFactorExec
- more factor for executionMethod Detail |
public static void set_factors(double lessFactorIOValue, double moreFactorIOValue, double lessFactorExecValue, double moreFactorExecValue)
setAllFactors(double,
double, double, double)
lessFactorIOValue
- less factor for Network I/OmoreFactorIOValue
- more factor for Network I/OlessFactorExecValue
- less factor for executionmoreFactorExecValue
- more factor for executionpublic static void setAllFactors(double lessFactorIOValue, double moreFactorIOValue, double lessFactorExecValue, double moreFactorExecValue)
lessFactorIOValue
- less factor for Network I/OmoreFactorIOValue
- more factor for Network I/OlessFactorExecValue
- less factor for executionmoreFactorExecValue
- more factor for executionpublic static int int_sample(int range) throws IllegalArgumentException
intSample(int)
range
- the bound on the random number to be returned.
The range must be positive (excluding 0).
IllegalArgumentException
- range is not positivepublic static int intSample(int range) throws IllegalArgumentException
range
- the bound on the random number to be returned.
The range must be positive (excluding 0).
IllegalArgumentException
- range is not positivepublic static double double_sample()
doubleSample()
public static double doubleSample()
public static void set_less_factor_io(double factor) throws IllegalArgumentException
setLessFactorIO(double)
factor
- the initial factor
IllegalArgumentException
- factor is not zero or positivepublic static void setLessFactorIO(double factor) throws IllegalArgumentException
factor
- the initial factor
IllegalArgumentException
- factor is not zero or positivepublic static void set_more_factor_io(double factor) throws IllegalArgumentException
setMoreFactorIO(double)
factor
- the initial factor
IllegalArgumentException
- factor is not zero or positivepublic static void setMoreFactorIO(double factor) throws IllegalArgumentException
factor
- the initial factor
IllegalArgumentException
- factor is not zero or positivepublic static void set_less_factor_e(double factor)
setLessFactorExec(double)
factor
- the initial factor
IllegalArgumentException
- factor is not zero or positivepublic static void setLessFactorExec(double factor)
factor
- the initial factor
IllegalArgumentException
- factor is not zero or positivepublic static void set_more_factor_e(double factor)
setMoreFactorExec(double)
factor
- the initial factor
IllegalArgumentException
- factor is not zero or positivepublic static void setMoreFactorExec(double factor)
factor
- the initial factor
IllegalArgumentException
- factor is not zero or positivepublic static double get_factor_io()
getFactorIO()
public static double getFactorIO()
public static double get_factor_e()
getFactorExec()
public static double getFactorExec()
public static double real(double value, double lessFactor, double moreFactor, double randDouble)
The formula used is:
value * (1 - lessFactor + (lessFactor + moreFactor) *
randDouble)
where 0.0 <= lessFactor and moreFactor <= 1.0
value
- the estimated valuelessFactor
- less factor for a valuemoreFactor
- more factor for a value (the range is between 0.0
and 1.0)randDouble
- an uniformly distributed double value
between 0.0 and 1.0
IllegalArgumentException
- value, lessFactor,
moreFactor and randDouble are not zero
or positive. In addition, the max. number for
moreFactor and randDouble is 1.0public static double real_io(double value) throws IllegalArgumentException
realIO(double)
value
- the estimated value
IllegalArgumentException
- value is not zero or positivepublic static double realIO(double value) throws IllegalArgumentException
value
- the estimated value
IllegalArgumentException
- value is not zero or positivepublic static double real_e(double value) throws IllegalArgumentException
realExec(double)
value
- the estimated value
IllegalArgumentException
- factor is not zero or positivepublic static double realExec(double value) throws IllegalArgumentException
value
- the estimated value
IllegalArgumentException
- factor is not zero or positivepublic static double expected_io(double value) throws IllegalArgumentException
expectedIO(double)
value
- the estimated value
IllegalArgumentException
- factor is not zero or positivepublic static double expectedIO(double value) throws IllegalArgumentException
value
- the estimated value
IllegalArgumentException
- factor is not zero or positivepublic static double expected_e(double value) throws IllegalArgumentException
expectedExec(double)
value
- the estimated value
IllegalArgumentException
- factor is not zero or positivepublic static double expectedExec(double value) throws IllegalArgumentException
value
- the estimated value
IllegalArgumentException
- factor is not zero or positive
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |