|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcrowdmodel.utils.MiscSingleton
public class MiscSingleton
This is a singleton class to make sure that there are unique ID's for the objects in the crowd model A singleton class is a construction in which one is sure that there is only one unique instantiation of that class. Furthermore, it can be called by any class only via a getInstance. - ID number generator - Random number generators (normal, beta and uniform distributions)
Field Summary | |
---|---|
private static MiscSingleton |
d_instance
|
private cern.jet.random.Beta |
d_myBetaLeft
|
private cern.jet.random.Beta |
d_myBetaNormal
|
private cern.jet.random.Beta |
d_myBetaRight
|
private cern.jet.random.Normal |
d_myNormal
|
private cern.jet.random.Uniform |
d_myUniform
|
private int |
d_nextID
|
Constructor Summary | |
---|---|
private |
MiscSingleton()
A private constructor as this is a singleton class can only be called by getInstance, which makes sure that this class is only instantiated once |
Method Summary | |
---|---|
static MiscSingleton |
getInstance()
This function returns the instantiation of this class As this is a singleton, there is only one object created which is referred to by instance. |
cern.jet.random.Beta |
getMyBetaLeft()
Returns the (unique) Beta distribution stream used in this simulation for the initial settings of the safety goal. |
cern.jet.random.Beta |
getMyBetaNormal()
Returns the (unique) Beta distribution stream used in this simulation for the initial settings of the identity, social and safety goal. |
cern.jet.random.Beta |
getMyBetaRight()
Returns the (unique) Beta distribution stream used in this simulation for the initial settings of the safety goal. |
cern.jet.random.Normal |
getMyNormal()
Returns the (unique) normal distribution stream used in this simulation mean = 0.5 st. dev = 0.1 |
cern.jet.random.Uniform |
getMyUniform()
Returns the (unique) uniform distribution stream used in this simulation |
int |
nextID()
Returns an unique ID value used to give each created object a fixed number for identification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static MiscSingleton d_instance
private int d_nextID
private cern.jet.random.Normal d_myNormal
private cern.jet.random.Uniform d_myUniform
private cern.jet.random.Beta d_myBetaNormal
private cern.jet.random.Beta d_myBetaLeft
private cern.jet.random.Beta d_myBetaRight
Constructor Detail |
---|
private MiscSingleton()
Method Detail |
---|
public static MiscSingleton getInstance()
public int nextID()
public cern.jet.random.Normal getMyNormal()
public cern.jet.random.Uniform getMyUniform()
public cern.jet.random.Beta getMyBetaLeft()
public cern.jet.random.Beta getMyBetaRight()
public cern.jet.random.Beta getMyBetaNormal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |