PyANGKernel.GKNetworkAttributesOverride¶
- class GKNetworkAttributesOverride¶
Encapsulates a set of object / attribute pair redefinitions that will be used inside an experiment.
Details
The class will allow the user to “override” the value of one or more column for any object inside the model.
The information stored by this class will be then assigned to one or more experiments, so the override data specified here will be applied to the affected objects before running the experiment.
The override values are be stored as QVariant, and they are interpreted in different ways according to its type and column type:
For numerical columns (Int, UInt, & Double), the override data can be specified either as a new numerical value that will replace the existing one, or either as an string specifying a “variation” over the object value, like i.e. “10%”, “-5”, “+15%”, etc…
For _GKEnum columns, the override data can be specified either as the ‘name’ of one of the enum values, or either its associated value.
For string (String / CString) columns, the override data must be specified as a string which will simply overwrite the existing one.
For Bool columns, the override data will also be converted to a boolean value and assigned to the column.
For _GKObject columns, teh override data will specify the ID of the new object to use
Right now, these are the only column types supported by the class. In a future we might also support overriding time-related columns (Date / Time / DateTime), etc…
The class registers a ‘connection’ into the model for any referenced object, so it gets properly warned whenever such object is removed.
Synopsis¶
Methods¶
def
__init__()def
add()def
addSection()def
clear()def
getColumnData()def
getColumns()def
getObjectData()def
getObjects()def
getSectionData()def
getSections()def
hasObject()def
hasSection()def
remove()def
removeSection()def
setSectionData()
Static functions¶
def
apply()def
isColumnValid()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__()¶
- add(obj, data)¶
- Parameters:
obj –
GKObjectdata – Dictionary with keys of type .GKColumn and values of type QVariant.
Stores the given override values for object. UnknownCommand obj: object for which the column will be overriden UnknownCommand data: override data
Stores the given override value for the given object and column. The new value must be specified according to the rules mentioned in class documentation. UnknownCommand obj: object for which the column will be overriden UnknownCommand col: column to override UnknownCommand newValue: the new value (or variation) to be used
Adds the given section to the override set. The class then stores the current lane parameters internally, which can be changed later through
setSectionLaneData(), etc…- static apply(lane, data)¶
- Parameters:
lane –
GKSectionLane
- Return type:
Applies the override data to the given section lane and returns it
- static apply(colType, oldValue, newValue)
Core function which modifies a column’s value by applying the given override to it, and returns the modified value. UnknownCommand colType : column to modify UnknownCommand oldValue : current value for the column UnknownCommand newValue : value to use for overriding UnknownCommand : modified value for the column
- clear()¶
Removes all overrides from the class
- getColumnData(col)¶
- Parameters:
col –
GKColumn- Return type:
Dictionary with keys of type .GKObject and values of type QVariant.
Returns the current overrides for a given column. UnknownCommand col: column to query about UnknownCommand a QHash specifying the existing overrides for this column
Returns the set of columns for which we currently have any overriden defined
- getObjectData(obj)¶
- Parameters:
obj –
GKObject- Return type:
Dictionary with keys of type .GKColumn and values of type QVariant.
Returns the current overrides for a given object. UnknownCommand obj: object to query about UnknownCommand a QHash specifying the overrides for this object
Returns the list of objects for which we currently have any column overriden
- getSectionData(section)¶
- Parameters:
section –
GKSection- Return type:
.list of GKNetworkAttributesOverrideLaneData
Returns the lane attribute overrides for this section
- getSectionLaneData(section, lanepos, data)¶
- Parameters:
section –
GKSectionlanepos – int
- Return type:
Returns the lane type assigned to the given section & lane
Returns the list of sections whose lane attributes are currently overriden
Returns true if the class contains attribute overrides for the given object
Returns true if the lane attributes of this section are overriden
Returns true if the given column type is overridable by this class (not all types are supported)
Returns true if the given column is overridable by this class (not all column types are supported)
Removes the given section from the override set
- setSectionData(section, data)¶
- Parameters:
section –
GKSectiondata – .list of GKNetworkAttributesOverrideLaneData
Adds the given section & lane attribute overrides to the class.
Changes the lane type for the given section & lane