approximation.approx_method module

class approximation.approx_method.ApproxMethod(settings=None)

Bases: abc.ABC

Abstract Base Class for Approximation Methods.

Inheriting classes must implement methods:
methodId __init__ approximateVariant applyRules
static methodId()

Returns this ApproxMethod’s unique ID string.

approximateVariant(variant, gen_info)

Generates approximated variant and stores it in a file.

  • variant (Variant) – The Variant instance to be approximated.
  • gen_info (GeneralInformation) – The framework’s GeneralInformation instance.

Checks if the given Variant’s error bounds are consistent with this ApproxMethod’s set of rules and adjusts them accordingly if not. Error bounds must not be decreased in order to avoid infinite loops and redundant steps in Variant generation.

Parameters:variant (Variant) – The Variant to apply the rules to.
Returns:True if the rules have been applied correctly and the Variant has a valid configuration afterwards, False if the rules could not be applied.
Return type:bool