- class mhi.pscad.Certificate(row_id, node, features)¶
PSCAD License Certificate
Returns the ID of the Certificate
Returns the ‘Product Name’ for the Certificate
Returns the ‘Account Name’ for the Certificate
Returns the # of available Certificates
Returns the total # of Certificates
Returns the list of all features associated with the Certificate. Note: This even includes Features where no instances of that feature are owned.
Returns a Feature associated with the Certificate. The feature may be specified by name (such as “Freq Dep Network Equivalent”) or by an integer id (such as 17).
Tests if the certificate meets the given list of requirements.
A list of requirements. Each requirement may be given as:
a string or integer, in which case the certificate must own the corresponding feature,
a (feature_name_or_id, lower_limit) tuple, in which case the feature must have a value greater than or equal to the limit.
# Does `cert` allow black boxing and 20 or more EMTDC instances? cert.meets(["Blackboxing", ("EMTDC Instances", 20)])
- Certificate.meet(key, req)¶
Tests if the certificate meets the given requirement.
key – a feature name or the corresponding integer value
a string: exact match of feature value
a boolean: exact match of feature value
an int: exact match of feature value
a tuple: range of values [low,high] that can match the feature
# Does `cert` disallow black boxing? cert.meets("Blackboxing", False)
The certificate cost may be used by the license selection logic to determine which license to acquire from the set of all licenses which meet the list of requested features. The ‘cheapest’ license would be choosen.
This function returns a cost using a default heuristic. The method may be overridden by setting the class member Certificate.COST.
- class mhi.pscad.Feature¶
A feature of a license
Returns the Feature’s ID.
Returns the Feature’s name.
Returns the Feature’s value.
Computes the ‘cost’ of a feature.
Feature.COSTS is a dictionary, indexed by feature name, of tuples containing the fixed and variable cost for a feature:
fixed, variable = COSTS[feature.name()] cost = fixed + variable * feature.value()
The certificate cost is used by the license selection logic to determine which license to acquire from the set of all licenses which meet the list of requested features. The ‘cheapest’ license is choosen.
The fixed and variable costs specified here are arbitrary, and may be changed to alter the license selection.