|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectyass.modularforwarding.scoring.ScoreGenerator
yass.modularforwarding.scoring.RandomScoreGenerator
public class RandomScoreGenerator
Generates a random score within a specified range each time a packet is supplied. The generated score is not stable between invocations for any given packet.
| Field Summary | |
|---|---|
private double |
maximumScore
The maximum score which may be produced |
private double |
minimumScore
The minimum score which may be produced |
private java.util.Random |
random
The random number generator |
private double |
scoreRange
The size of the minimum-to-maxium range that may be produced |
| Constructor Summary | |
|---|---|
RandomScoreGenerator(double minimumScore,
double maximumScore)
Creates a new instance of RandomScoreGenerator |
|
| Method Summary | |
|---|---|
double |
getMaximumScore()
Obtains the maximum score that may be generated |
double |
getMinimumScore()
Obtains the minimum score that may be generated |
double |
score(Packet packet)
Randomly generate a score between the permitted minimum and maximum levels. |
void |
setRandomSeed(long seed)
Resets the random number generator with the supplied seed |
| Methods inherited from class yass.modularforwarding.scoring.ScoreGenerator |
|---|
getManager, setManager |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private double minimumScore
private double maximumScore
private double scoreRange
private java.util.Random random
| Constructor Detail |
|---|
public RandomScoreGenerator(double minimumScore,
double maximumScore)
RandomScoreGenerator
minimumScore - the minimum score which may be producedmaximumScore - the maximum score which may be produced| Method Detail |
|---|
public double score(Packet packet)
score in class ScoreGeneratorpacket - the packet to ignore
public void setRandomSeed(long seed)
seed - the random number generator seedpublic double getMinimumScore()
public double getMaximumScore()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||