Class ConfigurableParameter<F>
- java.lang.Object
-
- org.processmining.models.graphbased.directed.petrinet.configurable.ConfigurableParameter<F>
-
- Type Parameters:
F-
- Direct Known Subclasses:
ConfigurableParameterGraphElement,ConfigurableParameterInteger
public abstract class ConfigurableParameter<F> extends java.lang.ObjectA configurable parameter has a name (getId()), a domain that is either given as discrete enumeration or as a range of values in an interval, and a default value.- Author:
- dfahland
-
-
Constructor Summary
Constructors Constructor Description ConfigurableParameter(java.lang.String id, F[] values, F defaultValue)Create new configurable parameter ranging over a discrete domain of values, wit given default value.ConfigurableParameter(java.lang.String id, F min, F max, F defaultValue)Create a new configurable parameter ranging over values from the given interval with a given default value.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description F[]getDiscreteDomain()java.lang.StringgetId()FgetIntervalMax()FgetIntervalMin()FgetValue()booleanisIntervalDomain()protected abstract booleanisValidIntervalValue(F value)booleanisValidValue(F value)voidsetDiscreteDomain(F[] values)Set a list of values the feature can take.voidsetId(java.lang.String id)voidsetIntervalDomain(F min, F max)Set a range of values the feature can take.voidsetValue(java.lang.Object value)Set chosen value of the feature.voidupdateParameter(ConfigurableParameter<F> update)Update domain and value of this parameter by copying values from the given parameter.
-
-
-
Constructor Detail
-
ConfigurableParameter
public ConfigurableParameter(java.lang.String id, F[] values, F defaultValue) throws InvalidConfigurationExceptionCreate new configurable parameter ranging over a discrete domain of values, wit given default value.- Parameters:
element-values-defaultValue-- Throws:
InvalidConfigurationException
-
ConfigurableParameter
public ConfigurableParameter(java.lang.String id, F min, F max, F defaultValue) throws InvalidConfigurationExceptionCreate a new configurable parameter ranging over values from the given interval with a given default value.- Parameters:
element-min-max-defaultValue-- Throws:
InvalidConfigurationException
-
-
Method Detail
-
setIntervalDomain
public void setIntervalDomain(F min, F max)
Set a range of values the feature can take.- Parameters:
min-max-
-
getIntervalMin
public F getIntervalMin()
- Returns:
- minimum value if domain is an interval (
isIntervalDomain())
-
getIntervalMax
public F getIntervalMax()
- Returns:
- maximum value if domain is an interval (
isIntervalDomain())
-
setDiscreteDomain
public void setDiscreteDomain(F[] values)
Set a list of values the feature can take.- Parameters:
values-
-
getDiscreteDomain
public F[] getDiscreteDomain()
- Returns:
- list of values, if domain is discrete (
isIntervalDomain())
-
isIntervalDomain
public boolean isIntervalDomain()
- Returns:
- true iff domain of the feature is an interval domain (this is the
case when
setIntervalDomain(Object, Object)is used to set the domain), and false iff domain of the feature is a discrete domain (this is the case whensetDiscreteDomain(Object[])is used to set the domain)
-
setValue
public void setValue(java.lang.Object value) throws InvalidConfigurationExceptionSet chosen value of the feature.- Parameters:
value-- Throws:
InvalidConfigurationException- if value is invalid for this feature
-
getValue
public F getValue()
- Returns:
- currently chosen value of the feature
-
isValidValue
public boolean isValidValue(F value)
- Parameters:
value-- Returns:
- true iff the given value is in the domain of the feature
-
isValidIntervalValue
protected abstract boolean isValidIntervalValue(F value)
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
updateParameter
public void updateParameter(ConfigurableParameter<F> update) throws InvalidConfigurationException
Update domain and value of this parameter by copying values from the given parameter.- Parameters:
update-- Throws:
InvalidConfigurationException
-
-