public final class CompoundLowLevelAbstractionDefinition extends AbstractAbstractionDefinition implements ParameterDefinition
LowLevelAbstractionDefinition
abstracted from multiple primitive parameters. In that case, the low-level
abstraction takes on a value based on the computation of all of the primitive
parameter values by a single algorithm. In compound low-level abstractions,
the values of the underlying low-level abstractions are considered
individually, and a higher-level value is assigned to an interval based on
rules.
A compound low-level abstraction will generate a superset of the intervals in
the abstracted-from low-level abstractions.
Just as for low-level abstractions, value definitions must be created for
compound low-level abstractions. These tell the abstraction how to process
the values of the underlying low-level abstraction. There are two ways to
consider the values of the low-level abstractions in a particular interval,
provided by the enum CompoundLowLevelAbstractionDefinition.ValueDefinitionMatchOperator: ANY or ALL.
Specifying ANY will make the compound abstraction apply the value under
consideration if any of the low-level abstraction values in that interval
match the rule for that value. ALL requires all of the low-level abstraction
rules to match.
The rules look something like:
COMPOUND_LLA_VALUE1 = {LLA1.value=LLA1_VALUE1,LLA2.value=LLA2_VALUE1,...,LLAN.value=LLAN_VALUE1}
COMPOUND_LLA_VALUE2 = {LLA1.value=LLA1_VALUE2,LLA2.value=LLA2_VALUE2,...,LLAN.value=LLAN_VALUE2}
The ANY or ALL operator applies to all of the rules. It is not applied on a
per-rule basis.
Order matters when specifying the compound abstractions possible values.
Values will be considered in the order they were defined. The last value will
be considered as a catch-all if none of the others match. It should typically
be the "normal" interpretation of the underlying low-level abstractions.
See org.protempa.test.ProtempaTest in protempa-test-suite for
examples of compound low-level abstractions.| Modifier and Type | Class and Description |
|---|---|
static class |
CompoundLowLevelAbstractionDefinition.ValueDefinitionMatchOperator
The different ways to consider the low-level abstraction value rules in a
given interval
|
changes, children, CHILDREN_PROPERTY| Constructor and Description |
|---|
CompoundLowLevelAbstractionDefinition(String id)
Constructor for this class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(PropositionDefinitionVisitor propositionVisitor)
Performs some processing on a proposition definition.
|
void |
acceptChecked(PropositionDefinitionCheckedVisitor propositionVisitor)
Performs some processing on this proposition definition.
|
void |
addValueClassification(ValueClassification valueClassification)
Adds a value classification for the abstraction.
|
Set<String> |
getAbstractedFrom()
Returns all proposition ids from which this abstract parameter is
abstracted.
|
String |
getContextId() |
GapFunction |
getGapFunctionBetweenValues() |
ContextDefinition |
getInterpretationContext() |
Set<String> |
getLowLevelAbstractionIds()
Gets the IDs of the low-level abstraction that this abstraction is
abstracted from.
|
int |
getMinimumNumberOfValues()
Gets the minimum number of consecutive intervals that must have the same
value before this abstraction is asserted.
|
int |
getSkip() |
ValueClassification[] |
getValueClassifications() |
CompoundLowLevelAbstractionDefinition.ValueDefinitionMatchOperator |
getValueDefinitionMatchOperator()
Gets the operator that is applied to each interval's low-level
abstraction values to determine the value to set for this abstraction.
|
ValueType |
getValueType() |
boolean |
isConcatenable()
Returns whether instances of this proposition definition are
concatenable.
|
boolean |
isSolid()
Returns whether intervals of this type are solid, i.e., never hold over
properly overlapping intervals.
|
protected void |
recalculateChildren() |
void |
setConcatenable(boolean concatenable)
Sets whether this type of compound low-level abstraction is concatenable.
|
void |
setContextId(String contextId) |
void |
setGapFunctionBetweenValues(GapFunction gf) |
void |
setInterpretationContext(ContextDefinition interpretationContext) |
void |
setMinimumNumberOfValues(int minimumNumberOfValues)
Sets the minimum number of consecutive intervals that must have the same
value before this abstraction is asserted.
|
void |
setSkip(int skip) |
void |
setValueDefinitionMatchOperator(CompoundLowLevelAbstractionDefinition.ValueDefinitionMatchOperator valueDefinitionMatchOperator)
Sets the operator that is applied to each interval's low-level
abstraction values to determine the value to set for this abstraction.
|
String |
toString() |
getGapFunction, reset, setGapFunctionaddPropertyChangeListener, addPropertyChangeListener, attribute, getAbbreviatedDisplayName, getAccessed, getAttributes, getChildren, getCreated, getDescription, getDisplayName, getDownloaded, getId, getInDataSource, getInverseIsA, getPropertyDefinitions, getPropositionId, getReferenceDefinitions, getSourceId, getTermIds, getUpdated, getVersion, propertyDefinition, referenceDefinition, removePropertyChangeListener, removePropertyChangeListener, setAbbreviatedDisplayName, setAccessed, setAttributes, setCreated, setDescription, setDisplayName, setDownloaded, setInDataSource, setInverseIsA, setPropertyDefinitions, setPropositionId, setReferenceDefinitions, setSourceId, setTermIds, setUpdated, setVersionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, attribute, getAbbreviatedDisplayName, getAccessed, getAttributes, getChildren, getCreated, getDescription, getDisplayName, getDownloaded, getId, getInDataSource, getInverseIsA, getPropertyDefinitions, getPropositionId, getReferenceDefinitions, getSourceId, getTermIds, getUpdated, getVersion, propertyDefinition, referenceDefinition, removePropertyChangeListener, removePropertyChangeListenergetDescriptionpublic Set<String> getLowLevelAbstractionIds()
getAbstractedFrom().public String getContextId()
public void setContextId(String contextId)
public int getSkip()
public void setSkip(int skip)
public void setGapFunctionBetweenValues(GapFunction gf)
public GapFunction getGapFunctionBetweenValues()
public int getMinimumNumberOfValues()
intpublic void setMinimumNumberOfValues(int minimumNumberOfValues)
minimumNumberOfValues - the minimum number of values, an
int greater than 0.public CompoundLowLevelAbstractionDefinition.ValueDefinitionMatchOperator getValueDefinitionMatchOperator()
CompoundLowLevelAbstractionDefinition.ValueDefinitionMatchOperator. The default value is ANY.public void setValueDefinitionMatchOperator(CompoundLowLevelAbstractionDefinition.ValueDefinitionMatchOperator valueDefinitionMatchOperator)
null, the setting will revert to the default (ANY).valueDefinitionMatchOperator - the match operator to set, a
CompoundLowLevelAbstractionDefinition.ValueDefinitionMatchOperatorpublic void addValueClassification(ValueClassification valueClassification)
id - the name of the value definitionlowLevelAbstractionId - the name of the low-level abstraction to add
to the classificationlowLevelValueDefName - the name of the low-level abstraction's valuepublic ValueClassification[] getValueClassifications()
public Set<String> getAbstractedFrom()
AbstractionDefinitiongetAbstractedFrom in interface AbstractionDefinitionSet of proposition id
Strings. Guaranteed not null.public void setConcatenable(boolean concatenable)
concatenable - true if concatenable, false
if not.public boolean isConcatenable()
PropositionDefinitionisConcatenable in interface PropositionDefinitiontrue if concatenable, false if not.public boolean isSolid()
PropositionDefinitionisSolid in interface PropositionDefinitiontrue if solid, false if not.public ContextDefinition getInterpretationContext()
public void setInterpretationContext(ContextDefinition interpretationContext)
public ValueType getValueType()
getValueType in interface ParameterDefinitionpublic void acceptChecked(PropositionDefinitionCheckedVisitor propositionVisitor) throws ProtempaException
PropositionDefinitionCheckedVisitableacceptChecked in interface PropositionDefinitionCheckedVisitableProtempaExceptionpublic void accept(PropositionDefinitionVisitor propositionVisitor)
PropositionDefinitionVisitableaccept in interface PropositionDefinitionVisitableprotected void recalculateChildren()
recalculateChildren in class AbstractPropositionDefinitionpublic String toString()
toString in class AbstractAbstractionDefinitionCopyright © 2012–2017 Emory University. All rights reserved.