org.deidentifier.arx

## Class ARXConfiguration

- java.lang.Object
- - org.deidentifier.arx.ARXConfiguration

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable

    public class ARXConfiguration
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable

A generic configuration for the ARX anonymizer.

Author:
  Fabian Prasser
See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `ARXConfiguration.ARXConfigurationInternal` Class for internal use that provides access to more parameters and functionality.
`static class` `ARXConfiguration.Monotonicity` Monotonicity.
`static class` `ARXConfiguration.SearchStepSemantics` The semantics of heuristic search steps.

### Field Summary

Fields
`static int` `REQUIREMENT_COUNTER` Do the criteria require a counter per equivalence class.
`static int` `REQUIREMENT_DISTRIBUTION` Do the criteria require distributions of sensitive values in the equivalence classes.
`static int` `REQUIREMENT_SECONDARY_COUNTER` Do the criteria require a second counter.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`ARXConfiguration` `addPrivacyModel(PrivacyCriterion c)` Adds a privacy model to the configuration.
`ARXConfiguration` `clone()` Clones this config.
`static ARXConfiguration` `create()` Creates a new configuration without tuple suppression.
`static ARXConfiguration` `create(double suppressionLimit)` Creates a new configuration that allows the given percentage of outliers and thus implements tuple suppression.
`static ARXConfiguration` `create(double suppressionLimit, Metric<?> metric)` Creates a new configuration that allows the given percentage of outliers and thus implements tuple suppression.
`static ARXConfiguration` `create(Metric<?> metric)` Creates a new configuration that allows to define the metric for measuring information loss.
`double` `getAttributeWeight(java.lang.String attribute)` Returns the weight for the given attribute.
`java.util.Map<java.lang.String,java.lang.Double>` `getAttributeWeights()` Returns all configured attribute weights.
`ARXCostBenefitConfiguration` `getCostBenefitConfiguration()` Returns the cost/benefit configuration
`double` `getDPSearchBudget()` Returns the privacy budget to use for the data-dependent differential privacy search algorithm.
`int` `getHeuristicSearchStepLimit(ARXConfiguration.SearchStepSemantics requestedSemantics, int numQIs)` The heuristic search algorithm will terminate after the returned number of steps.
`ARXConfiguration.SearchStepSemantics` `getHeuristicSearchStepSemantics()` The semantics of heuristic search steps.
`int` `getHeuristicSearchThreshold()` When the size of the solution space exceeds the returned number of transformations, ARX will use a heuristic search strategy.
`int` `getHeuristicSearchTimeLimit()` The heuristic search algorithm will terminate after the returned number of milliseconds.
`double` `getMaxOutliers()` Deprecated.
`ARXConfiguration.Monotonicity` `getMonotonicityOfPrivacy()` Returns whether the privacy model is monotonic
`ARXConfiguration.Monotonicity` `getMonotonicityOfUtility()` Returns whether the utility measure is monotonic
`<T extends PrivacyCriterion> T` `getPrivacyModel(java.lang.Class<T> clazz)` Returns an instance of the class, if any.
`java.util.Set<PrivacyCriterion>` `getPrivacyModels()` Returns all privacy models.
`<T extends PrivacyCriterion> java.util.Set<T>` `getPrivacyModels(java.lang.Class<T> clazz)` Returns all privacy models which are instances of the given class.
`Metric<?>` `getQualityModel()` Returns the quality model to be used for optimizing output data.
`double` `getRiskThresholdJournalist()` Return journalist risk threshold, 1 if there is none
`double` `getRiskThresholdMarketer()` Return marketer risk threshold, 1 if there is none
`double` `getRiskThresholdProsecutor()` Return prosecutor risk threshold, 1 if there is none
`double` `getSuppressionLimit()` Returns the suppression limit
`boolean` `isAttributeTypeSuppressed(AttributeType type)` Returns whether values of the given attribute type will be replaced by the suppression string in suppressed tuples.
`boolean` `isHeuristicSearchEnabled()` Returns whether ARX will use a heuristic search strategy.
`boolean` `isPracticalMonotonicity()` Is practical monotonicity assumed.
`boolean` `isPrivacyModelSpecified(java.lang.Class<? extends PrivacyCriterion> clazz)` Returns whether the configuration contains a privacy model which is an instance of the given class.
`boolean` `isSuppressionAlwaysEnabled()` Returns whether suppression is applied to the output of anonymous as well as non-anonymous transformations.
`boolean` `isUseHeuristicSearchForSampleBasedCriteria()` Is optimality guaranteed for sample-based criteria?
`<T extends PrivacyCriterion> boolean` `removeCriterion(PrivacyCriterion arg)` Removes the given criterion.
`java.util.List<ElementData>` `render()` Renders this object
`void` `setAttributeTypeSuppressed(AttributeType type, boolean enabled)` Defines values of which attribute type are to be replaced by the suppression string in suppressed tuples.
`void` `setAttributeWeight(java.lang.String attribute, double weight)` Sets the weight for the given attribute.
`void` `setAttributeWeight(java.lang.String attribute, java.lang.Double weight)` Sets the weight for the given attribute.
`ARXConfiguration` `setCostBenefitConfiguration(ARXCostBenefitConfiguration config)` Sets the cost/benefit configuration
`void` `setDPSearchBudget(double budget)` Sets the privacy budget to use for the data-dependent differential privacy search algorithm.
`void` `setHeuristicSearchEnabled(boolean heuristicSearchEnabled)` Sets whether ARX will use a heuristic search strategy.
`void` `setHeuristicSearchStepLimit(int numberOfTransformations)` The heuristic search algorithm will terminate after the given number of transformations have been checked.
`void` `setHeuristicSearchStepSemantics(ARXConfiguration.SearchStepSemantics searchStepSemantics)` Sets the semantics of heuristic search steps.
`void` `setHeuristicSearchThreshold(int numberOfTransformations)` When the size of the solution space exceeds the given number of transformations, ARX will use a heuristic search strategy.
`void` `setHeuristicSearchTimeLimit(int timeInMillis)` The heuristic search algorithm will terminate after the given number of milliseconds.
`void` `setMaxOutliers(double max)` Deprecated.
`void` `setPracticalMonotonicity(boolean assumeMonotonicity)` Set, if practical monotonicity assumed.
`void` `setQualityModel(Metric<?> model)` Sets the quality model to be used for optimizing output data.
`void` `setSuppressionAlwaysEnabled(boolean enabled)` Sets whether suppression is applied to the output of anonymous as well as non-anonymous transformations.
`void` `setSuppressionLimit(double limit)` Sets the suppression limit.
`void` `setUseHeuristicSearchForSampleBasedCriteria(boolean value)` Do we guarantee optimality for sample-based criteria?

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### REQUIREMENT_COUNTER

    public static final int REQUIREMENT_COUNTER

Do the criteria require a counter per equivalence class.

See Also:
  Constant Field Values

#### REQUIREMENT_DISTRIBUTION

    public static final int REQUIREMENT_DISTRIBUTION

Do the criteria require distributions of sensitive values in the equivalence classes.

See Also:
  Constant Field Values

#### REQUIREMENT_SECONDARY_COUNTER

    public static final int REQUIREMENT_SECONDARY_COUNTER

Do the criteria require a second counter.

See Also:
  Constant Field Values

### Method Detail

#### create

    public static ARXConfiguration create()

Creates a new configuration without tuple suppression.

Returns:

#### create

    public static ARXConfiguration create(double suppressionLimit)

Creates a new configuration that allows the given percentage of outliers and thus implements tuple suppression.

Parameters:
  `suppressionLimit` -
Returns:

#### create

    public static ARXConfiguration create(double suppressionLimit,
                                          Metric<?> metric)

Creates a new configuration that allows the given percentage of outliers and thus implements tuple suppression. Defines the metric for measuring information loss.

Parameters:
  `suppressionLimit` -
  `metric` -
Returns:

#### create

    public static ARXConfiguration create(Metric<?> metric)

Creates a new configuration that allows to define the metric for measuring information loss.

Parameters:
  `metric` -
Returns:

#### addPrivacyModel

    public ARXConfiguration addPrivacyModel(PrivacyCriterion c)

Adds a privacy model to the configuration.

Parameters:
  `c` -
Returns:

#### clone

    public ARXConfiguration clone()

Clones this config.

Overrides:
  `clone` in class `java.lang.Object`
Returns:

#### getAttributeWeight

    public double getAttributeWeight(java.lang.String attribute)

Returns the weight for the given attribute.

Parameters:
  `attribute` -
Returns:

#### getAttributeWeights

    public java.util.Map<java.lang.String,java.lang.Double> getAttributeWeights()

Returns all configured attribute weights. For attributes which are not a key in this set the default attribute weight will be assumed by ARX. This default value is currently set to 0.5.

Returns:

#### getCostBenefitConfiguration

    public ARXCostBenefitConfiguration getCostBenefitConfiguration()

Returns the cost/benefit configuration

#### getDPSearchBudget

    public double getDPSearchBudget()

Returns the privacy budget to use for the data-dependent differential privacy search algorithm. The default is 0.1.

Returns:

#### getHeuristicSearchStepLimit

    public int getHeuristicSearchStepLimit(ARXConfiguration.SearchStepSemantics requestedSemantics,
                                           int numQIs)

The heuristic search algorithm will terminate after the returned number of steps. The default is `Integer.MAX_VALUE`, i.e. no limit.

Parameters:
  `requestedSemantics` - the semantics of the number of search steps to be returned
  `numQIs` - the number of QIs
Returns:

#### getHeuristicSearchStepSemantics

    public ARXConfiguration.SearchStepSemantics getHeuristicSearchStepSemantics()

The semantics of heuristic search steps. The default is `SearchStepSemantics.CHECKS`.

Returns:

#### getHeuristicSearchThreshold

    public int getHeuristicSearchThreshold()

When the size of the solution space exceeds the returned number of transformations, ARX will use a heuristic search strategy. The default is 100.000.

Returns:

#### getHeuristicSearchTimeLimit

    public int getHeuristicSearchTimeLimit()

The heuristic search algorithm will terminate after the returned number of milliseconds. The default is 30 seconds.

Returns:

#### getMaxOutliers

    @Deprecated
    public double getMaxOutliers()

Deprecated.
Returns the maximum number of allowed outliers. Deprecated. Use `getSuppressionLimit()` instead.

Returns:

#### getMonotonicityOfPrivacy

    public ARXConfiguration.Monotonicity getMonotonicityOfPrivacy()

Returns whether the privacy model is monotonic

Returns:

#### getMonotonicityOfUtility

    public ARXConfiguration.Monotonicity getMonotonicityOfUtility()

Returns whether the utility measure is monotonic

Returns:

#### getPrivacyModel

    public <T extends PrivacyCriterion> T getPrivacyModel(java.lang.Class<T> clazz)

Returns an instance of the class, if any. Throws an exception if more than one such model exists.

Type Parameters:
  `T` -
Parameters:
  `clazz` -
Returns:

#### getPrivacyModels

    public java.util.Set<PrivacyCriterion> getPrivacyModels()

Returns all privacy models.

Returns:

#### getPrivacyModels

    public <T extends PrivacyCriterion> java.util.Set<T> getPrivacyModels(java.lang.Class<T> clazz)

Returns all privacy models which are instances of the given class.

Type Parameters:
  `T` -
Parameters:
  `clazz` -
Returns:

#### getQualityModel

    public Metric<?> getQualityModel()

Returns the quality model to be used for optimizing output data.

Returns:

#### getRiskThresholdJournalist

    public double getRiskThresholdJournalist()

Return journalist risk threshold, 1 if there is none

Returns:

#### getRiskThresholdMarketer

    public double getRiskThresholdMarketer()

Return marketer risk threshold, 1 if there is none

Returns:

#### getRiskThresholdProsecutor

    public double getRiskThresholdProsecutor()

Return prosecutor risk threshold, 1 if there is none

Returns:

#### getSuppressionLimit

    public double getSuppressionLimit()

Returns the suppression limit

Returns:

#### isAttributeTypeSuppressed

    public boolean isAttributeTypeSuppressed(AttributeType type)

Returns whether values of the given attribute type will be replaced by the suppression string in suppressed tuples.

Parameters:
  `type` -
Returns:

#### isHeuristicSearchEnabled

    public boolean isHeuristicSearchEnabled()

Returns whether ARX will use a heuristic search strategy. The default is false.

Returns:

#### isPracticalMonotonicity

    public boolean isPracticalMonotonicity()

Is practical monotonicity assumed.

Returns:

#### isPrivacyModelSpecified

    public boolean isPrivacyModelSpecified(java.lang.Class<? extends PrivacyCriterion> clazz)

Returns whether the configuration contains a privacy model which is an instance of the given class.

Parameters:
  `clazz` -
Returns:

#### isSuppressionAlwaysEnabled

    public boolean isSuppressionAlwaysEnabled()

Returns whether suppression is applied to the output of anonymous as well as non-anonymous transformations. If this flag is set to `true`, suppression will be applied to the output of non-anonymous transformations to make them anonymous (if possible). Default is `true`.

Returns:

#### isUseHeuristicSearchForSampleBasedCriteria

    public boolean isUseHeuristicSearchForSampleBasedCriteria()

Is optimality guaranteed for sample-based criteria?

#### removeCriterion

    public <T extends PrivacyCriterion> boolean removeCriterion(PrivacyCriterion arg)

Removes the given criterion.

Type Parameters:
  `T` -
Parameters:
  `arg` -
Returns:

#### render

    public java.util.List<ElementData> render()

Renders this object

Returns:

#### setAttributeTypeSuppressed

    public void setAttributeTypeSuppressed(AttributeType type,
                                           boolean enabled)

Defines values of which attribute type are to be replaced by the suppression string in suppressed tuples. With default settings, only quasi-identifiers will be suppressed.

Parameters:
  `type` - the attribute type
  `enabled` - whether suppression should be performed or not

#### setAttributeWeight

    public void setAttributeWeight(java.lang.String attribute,
                                   double weight)

Sets the weight for the given attribute.

Parameters:
  `attribute` -
  `weight` -

#### setAttributeWeight

    public void setAttributeWeight(java.lang.String attribute,
                                   java.lang.Double weight)

Sets the weight for the given attribute.

Parameters:
  `attribute` -
  `weight` -

#### setCostBenefitConfiguration

    public ARXConfiguration setCostBenefitConfiguration(ARXCostBenefitConfiguration config)

Sets the cost/benefit configuration

Parameters:
  `config` -

#### setDPSearchBudget

    public void setDPSearchBudget(double budget)

Sets the privacy budget to use for the data-dependent differential privacy search algorithm. The default is 0.1.

Parameters:
  `budget` -

#### setHeuristicSearchEnabled

    public void setHeuristicSearchEnabled(boolean heuristicSearchEnabled)

Sets whether ARX will use a heuristic search strategy. The default is false.

Parameters:
  `heuristicSearchEnabled` -

#### setHeuristicSearchStepLimit

    public void setHeuristicSearchStepLimit(int numberOfTransformations)

The heuristic search algorithm will terminate after the given number of transformations have been checked. The default is `Integer.MAX_VALUE`, i.e. no limit.

Parameters:
  `numberOfTransformations` -

#### setHeuristicSearchStepSemantics

    public void setHeuristicSearchStepSemantics(ARXConfiguration.SearchStepSemantics searchStepSemantics)

Sets the semantics of heuristic search steps. If the semantic `EXPANSIONS` is set, then the limit of the number of heuristic checks will be calculated by multiplying the heuristic search step limit with the number of QIs.

Parameters:
  `searchStepSemantics` -

#### setHeuristicSearchThreshold

    public void setHeuristicSearchThreshold(int numberOfTransformations)

When the size of the solution space exceeds the given number of transformations, ARX will use a heuristic search strategy. The default is 100.000.

Parameters:
  `numberOfTransformations` -

#### setHeuristicSearchTimeLimit

    public void setHeuristicSearchTimeLimit(int timeInMillis)

The heuristic search algorithm will terminate after the given number of milliseconds. The default is 30 seconds.

Parameters:
  `timeInMillis` -

#### setMaxOutliers

    @Deprecated
    public void setMaxOutliers(double max)

Deprecated.
Allows for a certain percentage of outliers and thus triggers tuple suppression. Deprecated. Use `setSuppressionLimit()` instead.

Parameters:
  `max` -

#### setPracticalMonotonicity

    public void setPracticalMonotonicity(boolean assumeMonotonicity)

Set, if practical monotonicity assumed.

Parameters:
  `assumeMonotonicity` -

#### setQualityModel

    public void setQualityModel(Metric<?> model)

Sets the quality model to be used for optimizing output data.

Parameters:
  `model` -

#### setSuppressionAlwaysEnabled

    public void setSuppressionAlwaysEnabled(boolean enabled)

Sets whether suppression is applied to the output of anonymous as well as non-anonymous transformations. If this flag is set to `true`, suppression will be applied to the output of non-anonymous transformations to make them anonymous (if possible). Default is `true`.

Parameters:
  `enabled` -

#### setSuppressionLimit

    public void setSuppressionLimit(double limit)

Sets the suppression limit. This is an alias for setMaxOutliers().

Parameters:
  `limit` -

#### setUseHeuristicSearchForSampleBasedCriteria

    public void setUseHeuristicSearchForSampleBasedCriteria(boolean value)

Do we guarantee optimality for sample-based criteria?