generator.data
Class RandomizedModel

java.lang.Object
  extended by generator.data.RandomizedModel

public class RandomizedModel
extends java.lang.Object

Randomized Model

Randomized Model is a class that contains the actual parameters from which the model will be generated. All parameters are verified to avoid creation of an impossible system. You can also apply and set templates.

System parameters:
X the starting intervals set
Y the ending intervals set
A the possible actions set
T the transitions from x (member of x) to y (member of y) set
P probability of ineffectiveness of an action

Copyright(c) 2005 Université Laval, LSFM research group.

Version:
1.0
Author:
Frédérick Lemay

Field Summary
static java.lang.String EXPONENTIAL
          Represents an exponential law distribution function
static java.lang.String LOGARITHMIC
          Represents a logarithmic law distribution function
static java.lang.String NORMAL
          Represents a centered reduced normal law distribution function
static java.lang.String POINT
          Represents a uniform law distribution function depending on y only.
static java.lang.String UNIFORM
          Represents an uniform distribution function
 
Constructor Summary
RandomizedModel()
          Basic constructor ... use the default parameters
RandomizedModel(IntervalNoUnion numberOfIntervals, IntervalNoUnion numberOfActions, IntervalNoUnion TvsX, IntervalNoUnion AvsX, IntervalNoUnion P)
          Initialization constructor ...
RandomizedModel(RandomizedModel modelToCopy)
          Copy constructor ... duplicate values from the specified existing randomizedModel.
 
Method Summary
 void addFunctions(java.lang.String function)
          Adds a function type to the list of possible functions type.
 void addTemplate(java.lang.String nameOfTemplate, IntervalNoUnion numberOfIntervals, IntervalNoUnion numberOfActions, IntervalNoUnion TvsX, IntervalNoUnion AvsX, IntervalNoUnion P)
          Add a template to the RandomizeModel.
 void addTemplate(java.lang.String nameOfTemplate, RandomizedModel modelToCopy)
          Add a template from a previously created model
 boolean canHaveCycle()
          Returns true if the system mustn't contain any cycle
 Interval estimateNumberOfTransitions()
          Estimates the number of transitions contained in the model
 int getAA()
          Obtains an integer representing the number of actions chosen among the A set from which the transitions will be generated for an interval x
 java.lang.String getAFunction()
          Fetch a function type among the valid function types list
 int getANumberOfActions()
          Obtains an integer representing the number of actions to be generated
 int getANumberOfIntervals()
          Obtains a valid integer represeneting a number of intervals from the number of intervals parameter
 double getAP()
          Obtains a P probability of action ineffectiveness for an interval x
 int getAT()
          Obtains an integer representing the number of actions per interval to be generated
 IntervalNoUnion getAvsX()
          Returns the number of actions for each interval x from X
 IntervalNoUnion getNumberOfActions()
          Returns the number of actions to generate in the A set
 IntervalNoUnion getNumberOfIntervals()
          Returns a valid number of intervals to generate
 IntervalNoUnion getP()
          Returns P
 IntervalNoUnion getTvsX()
          Returns the number of transitions per interval x from X
 boolean isFunctionSelected(java.lang.String function)
          Test wether a function type is present in the list or not
 void removeFunction(java.lang.String function)
          Remove a function type from the function type list
 void reset()
          Resets the parameters of the RandomizedModel to the default ones.
 void resetFunctions()
          Enable all possible functions in the RandomizedModel.
 void setAvsX(IntervalNoUnion i)
          Sets the number of actions per interval
 void setNoCycle(boolean noCycle)
          Specify if the system should contain cycles
 void setNumberOfActions(IntervalNoUnion i)
          Sets the number of actions in the A set
 void setNumberOfIntervals(IntervalNoUnion i)
          Sets the number of intervals to be generated
 void setP(IntervalNoUnion i)
          Sets P, the probability of ineffectiveness of an action
 void setTemplate(java.lang.String nameOfTemplate)
          Applies a template to the current model replacing all values
 void setTvsX(IntervalNoUnion i)
          Sets the number of transitions per interval x in X
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIFORM

public static final java.lang.String UNIFORM
Represents an uniform distribution function

See Also:
Constant Field Values

NORMAL

public static final java.lang.String NORMAL
Represents a centered reduced normal law distribution function

See Also:
Constant Field Values

EXPONENTIAL

public static final java.lang.String EXPONENTIAL
Represents an exponential law distribution function

See Also:
Constant Field Values

LOGARITHMIC

public static final java.lang.String LOGARITHMIC
Represents a logarithmic law distribution function

See Also:
Constant Field Values

POINT

public static final java.lang.String POINT
Represents a uniform law distribution function depending on y only. This is equivalent to having a discrete starting interval.

See Also:
Constant Field Values
Constructor Detail

RandomizedModel

public RandomizedModel()
Basic constructor ... use the default parameters


RandomizedModel

public RandomizedModel(IntervalNoUnion numberOfIntervals,
                       IntervalNoUnion numberOfActions,
                       IntervalNoUnion TvsX,
                       IntervalNoUnion AvsX,
                       IntervalNoUnion P)
                throws ParameterException
Initialization constructor ... Creates the randomizedModel from the specified parameters :

System parameters:
X the starting intervals set
Y the ending intervals set
A the possible actions set
T the transitions from x (member of x) to y (member of y) set
P probability of ineffectiveness of an action

Parameters:
numberOfIntervals - number of intervals to generate (in X and Y)
numberOfActions - the number of intervals to generate
TvsX - the number of transitions to generate for each x in X
AvsX - the number of actions to choose from A for each x in X
P - the probability of ineffectiveness of an action
Throws:
ParameterException - if invalid parameters have been specified

RandomizedModel

public RandomizedModel(RandomizedModel modelToCopy)
Copy constructor ... duplicate values from the specified existing randomizedModel.

Parameters:
modelToCopy - the model from which the parameters will be copied
Method Detail

getNumberOfIntervals

public IntervalNoUnion getNumberOfIntervals()
Returns a valid number of intervals to generate

Returns:
the number of intervals in X and Y

getNumberOfActions

public IntervalNoUnion getNumberOfActions()
Returns the number of actions to generate in the A set

Returns:
the number of actions to generate in the A set

getTvsX

public IntervalNoUnion getTvsX()
Returns the number of transitions per interval x from X

Returns:
the number of transitions per interval x from X

getAvsX

public IntervalNoUnion getAvsX()
Returns the number of actions for each interval x from X

Returns:
the number of actions for each interval x from X

getP

public IntervalNoUnion getP()
Returns P

Returns:
P, the probability of ineffectiveness of an action

reset

public void reset()
Resets the parameters of the RandomizedModel to the default ones.


resetFunctions

public void resetFunctions()
Enable all possible functions in the RandomizedModel.


addFunctions

public void addFunctions(java.lang.String function)
Adds a function type to the list of possible functions type.

Parameters:
function - String

removeFunction

public void removeFunction(java.lang.String function)
Remove a function type from the function type list

Parameters:
function - the function type to remove

getAFunction

public java.lang.String getAFunction()
Fetch a function type among the valid function types list

Returns:
a valid function type

isFunctionSelected

public boolean isFunctionSelected(java.lang.String function)
Test wether a function type is present in the list or not

Parameters:
function - a function type to test
Returns:
'True' if the function is indeed part of the list

setNumberOfIntervals

public void setNumberOfIntervals(IntervalNoUnion i)
                          throws ParameterException
Sets the number of intervals to be generated

Parameters:
i - an interval of values possible for the number of intervals to be generated
Throws:
ParameterException - should the constraints be violated
See Also:
verifyConstraints()

setTvsX

public void setTvsX(IntervalNoUnion i)
             throws ParameterException
Sets the number of transitions per interval x in X

Parameters:
i - the number of transitions per interval
Throws:
ParameterException - if the new value violates the constraints
See Also:
verifyConstraints()

setAvsX

public void setAvsX(IntervalNoUnion i)
             throws ParameterException
Sets the number of actions per interval

Parameters:
i - : the number of actions chosen among the A set per interval
Throws:
ParameterException - should the constraints be violated
See Also:
verifyConstraints()

setNumberOfActions

public void setNumberOfActions(IntervalNoUnion i)
                        throws ParameterException
Sets the number of actions in the A set

Parameters:
i - the number of actions in the a set
Throws:
ParameterException - should any constraint be violated
See Also:
verifyConstraints()

setP

public void setP(IntervalNoUnion i)
          throws ParameterException
Sets P, the probability of ineffectiveness of an action

Parameters:
i - the probability of ineffectiveness of an action
Throws:
ParameterException - should any constraint be violated

setNoCycle

public void setNoCycle(boolean noCycle)
Specify if the system should contain cycles

Parameters:
noCycle - determines if the system can have cycles

canHaveCycle

public boolean canHaveCycle()
Returns true if the system mustn't contain any cycle

Returns:
true if the system mustn't contain any cycle

addTemplate

public void addTemplate(java.lang.String nameOfTemplate,
                        IntervalNoUnion numberOfIntervals,
                        IntervalNoUnion numberOfActions,
                        IntervalNoUnion TvsX,
                        IntervalNoUnion AvsX,
                        IntervalNoUnion P)
                 throws ParameterException
Add a template to the RandomizeModel. These template can then be applied to the model.

Parameters:
nameOfTemplate - name of the template
numberOfIntervals - the number of intervals in the X and Y sets
numberOfActions - the number of actions in the A set
TvsX - the number of transitions per interval
AvsX - the number of actions chosen from the A set per interval
P - the probability of ineffectiveness of an action
Throws:
ParameterException - should any of the constraints be violated
See Also:
verifyConstraints()

addTemplate

public void addTemplate(java.lang.String nameOfTemplate,
                        RandomizedModel modelToCopy)
Add a template from a previously created model

Parameters:
nameOfTemplate - a name identifying the template
modelToCopy - a previously created model

setTemplate

public void setTemplate(java.lang.String nameOfTemplate)
                 throws ParameterException
Applies a template to the current model replacing all values

Parameters:
nameOfTemplate - the name of the template to load
Throws:
ParameterException - if the template with the specified name does not exist
ParameterException - if the specified model violates constraints
See Also:
verifyConstraints()

getANumberOfIntervals

public int getANumberOfIntervals()
Obtains a valid integer represeneting a number of intervals from the number of intervals parameter

Returns:
an integer number of intervals representing a number of intervals

getANumberOfActions

public int getANumberOfActions()
Obtains an integer representing the number of actions to be generated

Returns:
an integer representing the number of actions to be generated

getAT

public int getAT()
Obtains an integer representing the number of actions per interval to be generated

Returns:
an integer representing the number of actions per interval to be generated

getAA

public int getAA()
Obtains an integer representing the number of actions chosen among the A set from which the transitions will be generated for an interval x

Returns:
an integer representing the number of actions chosen among the A set

getAP

public double getAP()
Obtains a P probability of action ineffectiveness for an interval x

Returns:
a double representing the probability of action ineffectiveness for an interval x

estimateNumberOfTransitions

public Interval estimateNumberOfTransitions()
Estimates the number of transitions contained in the model

Returns:
an interval representing the estimated number of transitions in the system