Package org.oristool.math.function
Class StateDensityFunction
java.lang.Object
org.oristool.math.function.StateDensityFunction
Joint probability density function over DBM zones.
-
Constructor Summary
ConstructorDescriptionCreates an empty PDF.Creates the copy of a PDF. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a continuous variable with give PDF.void
addDeterministicVariable
(Variable v, BigDecimal value) Adds a deterministic variable to this PDF.void
addSynchronizedVariable
(Variable v, Variable distributed, BigDecimal delay) Adds a variable with deterministic delay with respect to an existing continuous variable.Computes the mean value of a variable.conditionAllToBound
(Variable leftVar, Set<Variable> rightVars, OmegaBigDecimal bound) Imposes the boundleftVar - rightVar <= bound
on the support for all pairs of left/right variables, keeping only subzones with nonzero measure.conditionToInterval
(Variable v, OmegaBigDecimal min, OmegaBigDecimal max) Imposes the boundx <= v <= y
on the support, keeping only subzones with nonzero measure.conditionToZone
(DBMZone zone) Intersects the support with the input zone, keeping only subzones with nonzero measure.void
constantShift
(BigDecimal constant) Removes a constant from all variables of this PDF.void
constantShift
(BigDecimal constant, Set<Variable> progressing) Removes a constant from a set of input variables.boolean
Returns the PDF of continuous variables (i.e., not deterministic or synchronized).Returns the set of continuous variables.Returns the deterministic value of a given variable.Returns the set of deterministic variables and their values.Returns the set of deterministic variables.Returns the minimum value of deterministic variables.getLowestDeterministicValue
(Set<Variable> detVariables) Returns the minimum value of deterministic variables among a given set.getLowestSynchronizedDelayWrt
(Variable distributedVariable) Returns the minimum delay of variables synchronized with the input one.getLowestSynchronizedWrt
(Variable distributedVariable) Returns the synchronized variable with minimum delay with respect to a given distributed one.Returns the marginal density of a variable.getMaxBound
(Set<Variable> leftVars, Set<Variable> rightVars) Returns the maximum upper bound on the differenceleft - right
between variables in two sets.getMaxBound
(Variable left, Variable right) Returns the maximum upper bound on the differenceleft - right
between two variables.getMinBound
(Set<Variable> leftVars, Set<Variable> rightVars) Returns the minimum upper bound on the differenceleft - right
between variables in two sets.getMinBound
(Variable left, Variable right) Returns the minimum upper bound on the differenceleft - right
between two variables.Returns the deterministic, synchronized or distributed variables with zero delay with respect to an input one.Returns the PDF of continuous variables.Returns all the variables synchronized with a given one (and their delays).Returns synchronization information of a variable.Returns the set of synchronized variables.Returns the set of variables (deterministic, synchronized, continuous).int
hashCode()
void
imposeBound
(Variable leftVar, Set<Variable> rightVars, OmegaBigDecimal bound) Imposes the boundleftVar - rightVar <= bound
on the support for all pairs of left/right variables, keeping only subzones with nonzero measure.void
imposeBound
(Variable leftVar, Variable rightVar, OmegaBigDecimal bound) Imposes the boundleftVar - rightVar <= bound
on the support, keeping only subzones with nonzero measure.void
imposeInterval
(Variable v, OmegaBigDecimal min, OmegaBigDecimal max) Intersects the support with the input boundmin <= v <= max
on the support, keeping only subzones with nonzero measure.void
imposeZone
(DBMZone zone) Intersects the support with the input zone, keeping only subzones with nonzero measure.void
Removes a variable from this PDF.measure()
Returns the integral of this PDF on the support.void
shiftAndProject
(Variable firedVar) Subtracts a variable from all others and removes it from this PDF.void
Moves a synchronized variable into the distributed set, and the current distributed one into the synchronized set.toString()
-
Constructor Details
-
StateDensityFunction
public StateDensityFunction()Creates an empty PDF. -
StateDensityFunction
Creates the copy of a PDF.- Parameters:
other
- PDF to copy
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
getContinuosVariablesDensity
Returns the PDF of continuous variables (i.e., not deterministic or synchronized).- Returns:
- PDF of continuous variables
-
addDeterministicVariable
Adds a deterministic variable to this PDF.- Parameters:
v
- new variablevalue
- deterministic value
-
addSynchronizedVariable
Adds a variable with deterministic delay with respect to an existing continuous variable.- Parameters:
v
- new variabledistributed
- continuous variabledelay
- deterministic delay
-
addContinuousVariable
Adds a continuous variable with give PDF.- Parameters:
v
- new variablef
- PDF (with respect toVariable.X
)
-
getVariables
Returns the set of variables (deterministic, synchronized, continuous).- Returns:
- variables of this PDF
-
getContinuousVariables
Returns the set of continuous variables.- Returns:
- continuous variables of this PDF
-
getDeterministicVariables
Returns the set of deterministic variables.- Returns:
- deterministic variables of this PDF
-
getDeterministicValues
Returns the set of deterministic variables and their values.- Returns:
- deterministic variables of this PDF and their values
-
getPartitionedGen
Returns the PDF of continuous variables.- Returns:
- PDF of continuous variables
-
getLowestDeterministicValue
Returns the minimum value of deterministic variables.- Returns:
- minimum deterministic value or
null
if no deterministic variable is present
-
getLowestDeterministicValue
Returns the minimum value of deterministic variables among a given set.- Parameters:
detVariables
- set of deterministic varuables- Returns:
- minimum deterministic value or
null
if the set is empty or disjoint fromthis.getDeterministicVariables()
-
getDeterministicValue
Returns the deterministic value of a given variable.- Parameters:
v
- variable- Returns:
- deterministic value
-
getSynchronizedVariables
Returns the set of synchronized variables.- Returns:
- synchronized variables of this PDF
-
getSynchronization
Returns synchronization information of a variable.- Parameters:
v
- input variable- Returns:
- synchronized information, or
null
if the variable is not synchronized
-
marginalizeVariable
Removes a variable from this PDF.- Parameters:
v
- target variable
-
swap
Moves a synchronized variable into the distributed set, and the current distributed one into the synchronized set.- Parameters:
synch
- a synchronized variable
-
getLowestSynchronizedWrt
Returns the synchronized variable with minimum delay with respect to a given distributed one.- Parameters:
distributedVariable
- a distributed variable- Returns:
- a synchronized variable with minimum delay
-
toString
-
getSynchDelaysWrt
Returns all the variables synchronized with a given one (and their delays).The input variable can be in the distributed or synchronized set.
- Parameters:
v
- input variable- Returns:
- synchronized variables
-
getLowestSynchronizedDelayWrt
Returns the minimum delay of variables synchronized with the input one.- Parameters:
distributedVariable
- a variable in the distributed set- Returns:
- the minimum synchronization delay
-
getNullDelayVariables
Returns the deterministic, synchronized or distributed variables with zero delay with respect to an input one.- Parameters:
v
- a deterministic, synchronized or distributed variable- Returns:
- the set of variables with zero delay
-
shiftAndProject
Subtracts a variable from all others and removes it from this PDF.- Parameters:
firedVar
- target variable
-
constantShift
Removes a constant from all variables of this PDF.- Parameters:
constant
- input constant
-
constantShift
Removes a constant from a set of input variables.- Parameters:
constant
- input constantprogressing
- set of variables
-
imposeBound
Imposes the boundleftVar - rightVar <= bound
on the support, keeping only subzones with nonzero measure.Densities are not normalized.
- Parameters:
leftVar
- first variable of the differencerightVar
- second variable of the differencebound
- upper bound on the difference
-
imposeBound
Imposes the boundleftVar - rightVar <= bound
on the support for all pairs of left/right variables, keeping only subzones with nonzero measure.Densities are not normalized.
- Parameters:
leftVar
- first variable of the differencerightVars
- second variables of the differencebound
- upper bound on the difference
-
conditionAllToBound
public BigDecimal conditionAllToBound(Variable leftVar, Set<Variable> rightVars, OmegaBigDecimal bound) Imposes the boundleftVar - rightVar <= bound
on the support for all pairs of left/right variables, keeping only subzones with nonzero measure.Densities are normalized on the new support.
- Parameters:
leftVar
- first variable of the differencerightVars
- second variables of the differencebound
- upper bound on the difference- Returns:
- the probability measure of the restricted support before normalization
-
measure
Returns the integral of this PDF on the support.The result should be 1, unless the support has been reduced without normalization.
- Returns:
- integral over support
-
getMarginalDensity
Returns the marginal density of a variable.- Parameters:
v
- input variable- Returns:
- PDF of the input variable
-
getMaxBound
Returns the maximum upper bound on the differenceleft - right
between two variables.- Parameters:
left
- first variableright
- second variable- Returns:
- maximum upper bound on
left - right
-
getMaxBound
Returns the maximum upper bound on the differenceleft - right
between variables in two sets.- Parameters:
leftVars
- first set of variablesrightVars
- second set of variables- Returns:
- maximum upper bound on
left - right
-
getMinBound
Returns the minimum upper bound on the differenceleft - right
between two variables.- Parameters:
left
- first variableright
- second variable- Returns:
- minimum upper bound on
left - right
-
getMinBound
Returns the minimum upper bound on the differenceleft - right
between variables in two sets.- Parameters:
leftVars
- first set of variablesrightVars
- second set of variables- Returns:
- minimum upper bound on
left - right
-
conditionToInterval
Imposes the boundx <= v <= y
on the support, keeping only subzones with nonzero measure.Densities are normalized on the new support.
- Parameters:
v
- target variablemin
- lower boundmax
- upper bound- Returns:
- the probability measure of the restricted support before normalization
-
conditionToZone
Intersects the support with the input zone, keeping only subzones with nonzero measure.Densities are normalized on the new support.
- Parameters:
zone
- input zone- Returns:
- the probability measure of the restricted support before normalization
-
imposeInterval
Intersects the support with the input boundmin <= v <= max
on the support, keeping only subzones with nonzero measure.Densities are not normalized on the new support.
- Parameters:
v
- target variablemin
- lower boundmax
- upper bound
-
imposeZone
Intersects the support with the input zone, keeping only subzones with nonzero measure.Densities are not normalized on the new support.
- Parameters:
zone
- input zone
-
computeMeanValue
Computes the mean value of a variable.- Parameters:
v
- target variable- Returns:
- mean value according to this PDF
-