Package eu.simuline.relana.model
Class CClass.SClassDecl
- java.lang.Object
-
- eu.simuline.relana.model.CClass.SClassDecl
-
-
Field Summary
Fields Modifier and Type Field Description private ProbDistr
distr
An optional probability distribution; otherwisenull
.private FormulaDecl
form
An optional formula declaration; otherwisenull
.private boolean
isRedeclare
Whether this declaration is a redeclaration.private Set<CClass.SClassModifier>
modifiers
The set of modifiers of this effect.private String
name
The name of this effect which must be unique within the keys ofCClass.effects
.private SClass
sClass
The class of this effect.
-
Constructor Summary
Constructors Constructor Description SClassDecl(boolean isRedeclare, Set<CClass.SClassModifier> modifiers, SClass sClass, String name, ProbDistr distr)
Creates a newSClassDecl
instance without formula.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
(package private) FormulaDecl
getFormulaDecl()
Returns the formula if any; otherwisenull
.String
getName()
(package private) ProbDistr
getProbDistr()
Returns the probability distribution if any; otherwisenull
.SClass
getSClass()
(package private) SInstance
getSInstance()
Returns a effect according to this declaration.int
hashCode()
boolean
isInput()
Returns whether this effect is declared as input.boolean
isOutput()
Returns whether this effect is declared as output.boolean
isRedeclare()
Returns whether this is a redeclaration.void
setFormula(FormulaDecl form)
Sets the given formulaform
and checks consistency; may throw various exceptions.String
toString()
-
-
-
Field Detail
-
isRedeclare
private final boolean isRedeclare
Whether this declaration is a redeclaration.
-
modifiers
private final Set<CClass.SClassModifier> modifiers
The set of modifiers of this effect.
-
sClass
private final SClass sClass
The class of this effect.
-
name
private final String name
The name of this effect which must be unique within the keys ofCClass.effects
.
-
distr
private final ProbDistr distr
An optional probability distribution; otherwisenull
.
-
form
private FormulaDecl form
An optional formula declaration; otherwisenull
.
-
-
Constructor Detail
-
SClassDecl
public SClassDecl(boolean isRedeclare, Set<CClass.SClassModifier> modifiers, SClass sClass, String name, ProbDistr distr)
Creates a newSClassDecl
instance without formula.- Parameters:
isRedeclare
- whether this is a redeclaration.modifiers
- The set of mofifiers of this effect.sClass
- The class of this effect.name
- The name of this effect which must be unique within the keys ofCClass.effects
.distr
- An optional probability distribution; otherwisenull
.- Throws:
IllegalArgumentException
- for inputs no probability distribution must be provided.- See Also:
setFormula(eu.simuline.relana.expressions.FormulaDecl)
-
-
Method Detail
-
setFormula
public void setFormula(FormulaDecl form)
Sets the given formulaform
and checks consistency; may throw various exceptions.- Parameters:
form
- aFormulaDecl
which may also benull
.- Throws:
IllegalArgumentException
- ifform != null
and at the same time- this effect is declared as input or
- this effect has a probability distribution already.
- the formula is not assignment compatible which currently means the types do not coincide.
-
getSClass
public SClass getSClass()
-
getName
public String getName()
-
isInput
public boolean isInput()
Returns whether this effect is declared as input.- Returns:
- whether this effect is declared as input.
-
isOutput
public boolean isOutput()
Returns whether this effect is declared as output.- Returns:
- whether this effect is declared as output.
-
isRedeclare
public boolean isRedeclare()
Returns whether this is a redeclaration.- Returns:
- whether this is a redeclaration.
-
getProbDistr
ProbDistr getProbDistr()
Returns the probability distribution if any; otherwisenull
.- Returns:
distr
.
-
getFormulaDecl
FormulaDecl getFormulaDecl()
Returns the formula if any; otherwisenull
.- Returns:
form
.
-
getSInstance
SInstance getSInstance()
Returns a effect according to this declaration.- Returns:
- a effect according to this declaration. This depends on the class, the probability distribution and the name but not on the modifiers and the formula.
-
-