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 ProbDistrdistrAn optional probability distribution; otherwisenull.private FormulaDeclformAn optional formula declaration; otherwisenull.private booleanisRedeclareWhether this declaration is a redeclaration.private Set<CClass.SClassModifier>modifiersThe set of modifiers of this effect.private StringnameThe name of this effect which must be unique within the keys ofCClass.effects.private SClasssClassThe class of this effect.
-
Constructor Summary
Constructors Constructor Description SClassDecl(boolean isRedeclare, Set<CClass.SClassModifier> modifiers, SClass sClass, String name, ProbDistr distr)Creates a newSClassDeclinstance without formula.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)(package private) FormulaDeclgetFormulaDecl()Returns the formula if any; otherwisenull.StringgetName()(package private) ProbDistrgetProbDistr()Returns the probability distribution if any; otherwisenull.SClassgetSClass()(package private) SInstancegetSInstance()Returns a effect according to this declaration.inthashCode()booleanisInput()Returns whether this effect is declared as input.booleanisOutput()Returns whether this effect is declared as output.booleanisRedeclare()Returns whether this is a redeclaration.voidsetFormula(FormulaDecl form)Sets the given formulaformand checks consistency; may throw various exceptions.StringtoString()
-
-
-
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 newSClassDeclinstance 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 formulaformand checks consistency; may throw various exceptions.- Parameters:
form- aFormulaDeclwhich may also benull.- Throws:
IllegalArgumentException- ifform != nulland 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.
-
-