Skip to content

← Back to middlelevel

InConsistencySizeBasis

Source: Distributed_Design_Optimizer/middlelevel/InConsistencySizeBasis.py

Inconsistency size basis module.

This module provides the base class for computing inconsistency sizes between coupled variables in distributed optimization.

Classes

InConsistencySizeBasis

Inherits from: InConsistencySizeInterface

Base class for storing inconsistency size measurements between subsystems.

Tracks coupling inconsistencies between subsystems at various coupling points (mapped-response, coupling-variable, shared, target design variables).

Methods

init(self, id: str) → None

Initialize the inconsistency size storage.

Args:

id: Identifier of the neighboring subsystem.

get_ID(self) → str

Get the identifier of the neighboring subsystem.

Returns:

The neighbor subsystem identifier.

evaluate_MappedResponse_Minus_CopyCouplingVariable(self, mappedresponse: List[float], copycouplingvariable: List[float]) → None

📐 Pseudocode: Compute consistency residual c (Line 19) → Augmented Lagrangian Coordination

Set the inconsistency on the mapped-response side of the coupling circle.

Args:

mappedresponse: Mapped response values.
copycouplingvariable: Copy of the coupling variable values.

get_MappedResponse_Minus_CopyCouplingVariable(self) → List[float] | None

Get the inconsistency on the mapped-response side of the coupling circle.

Returns:

List of inconsistency values or None if not set.

get_MappedResponse_Minus_CopyCouplingVariable_InfyNorm(self) → float | None

Return the maximum inconsistency on the mapped-response side.

Returns:

Maximum inconsistency value or None if not set.

get_MappedResponse_Minus_CopyCouplingVariable_InfyNormID(self) → int | None

Return the index of the maximum inconsistency on the mapped-response side.

Returns:

Index of maximum inconsistency or None if not set.

evaluate_CopyMappedResponse_Minus_CouplingVariable(self, copymappedresponse: List[float], couplingvariable: List[float]) → None

📐 Pseudocode: Compute consistency residual c (Line 19) → Augmented Lagrangian Coordination

Set the inconsistency on the coupling-variable side of the coupling circle.

Args:

copymappedresponse: Copy of the mapped response values.
couplingvariable: Coupling variable values.

get_CopyMappedResponse_Minus_CouplingVariable(self) → List[float] | None

Get the inconsistency on the coupling-variable side of the coupling circle.

Returns:

List of inconsistency values or None if not set.

get_CopyMappedResponse_Minus_CouplingVariable_InfyNorm(self) → float | None

Return the maximum inconsistency on the coupling-variable side.

Returns:

Maximum inconsistency value or None if not set.

get_CopyMappedResponse_Minus_CouplingVariable_InfyNormID(self) → int | None

Return the index of the maximum inconsistency on the coupling-variable side.

Returns:

Index of maximum inconsistency or None if not set.

evaluate_SharedDesignVariable_Minus_CopyTargetSharedDesignVariable(self, shareddesignvariable: List[float], copytargetshareddesignvariable: List[float]) → None

📐 Pseudocode: Compute consistency residual c (Line 19) → Augmented Lagrangian Coordination

Set the inconsistency for shared design variables.

Args:

shareddesignvariable: Shared design variable values.
copytargetshareddesignvariable: Copy of the target shared design variable values.

get_SharedDesignVariable_Minus_CopyTargetSharedDesignVariable(self) → List[float] | None

Get the inconsistency for shared design variables.

Returns:

List of inconsistency values or None if not set.

get_SharedDesignVariable_Minus_CopyTargetSharedDesignVariable_InfyNorm(self) → float | None

Get the maximum shared design variables inconsistency (infinity norm).

Returns:

Maximum inconsistency value or None if not set.

get_SharedDesignVariable_Minus_CopyTargetSharedDesignVariable_InfyNormID(self) → int | None

Get the index of the maximum shared design variables inconsistency.

Returns:

Index of maximum inconsistency or None if not set.

evaluate_CopySharedDesignVariable_Minus_TargetSharedDesignVariable(self, copyshareddesignvariable: List[float], targetshareddesignvariable: List[float]) → None

📐 Pseudocode: Compute consistency residual c (Line 19) → Augmented Lagrangian Coordination

Set the inconsistency for target shared design variables.

Args:

copyshareddesignvariable: Copy of the shared design variable values.
targetshareddesignvariable: Target shared design variable values.

get_CopySharedDesignVariable_Minus_TargetSharedDesignVariable(self) → List[float] | None

Get the inconsistency for target shared design variables.

Returns:

List of inconsistency values or None if not set.

get_CopySharedDesignVariable_Minus_TargetSharedDesignVariable_InfyNorm(self) → float | None

Return the maximum inconsistency for target shared design variables.

Returns:

Maximum inconsistency value or None if not set.

get_CopySharedDesignVariable_Minus_TargetSharedDesignVariable_InfyNormID(self) → int | None

Return the index of the maximum inconsistency for target shared design variables.

Returns:

Index of maximum inconsistency or None if not set.

evaluate_MaxInconsistency(self) → None

Evaluate the maximum inconsistency value across all inconsistency types.

get_maxInconsistencyValue(self) → float | None

Return the max inconsistency value.

Returns:

Maximum inconsistency value or None if not set.

get_maxInconsistencyType(self) → str | None

Return the type of the max inconsistency value.

Returns:

Type identifier of the maximum inconsistency or None if not set.

set_OscillationIndex_MappedResponse_Minus_CopyCouplingVariable(self, oscillationindex: List[float | None]) → None

Set oscillation index for mapped-response side.

Args:

oscillationindex: List of oscillation index values.

get_OscillationIndex_MappedResponse_Minus_CopyCouplingVariable(self) → List[float | None] | None

Get oscillation index for mapped-response side.

Returns:

List of oscillation index values or None if not set.

set_OscillationIndex_CopyMappedResponse_Minus_CouplingVariable(self, oscillationindex: List[float | None]) → None

Set oscillation index for coupling-variable side.

Args:

oscillationindex: List of oscillation index values.

get_OscillationIndex_CopyMappedResponse_Minus_CouplingVariable(self) → List[float | None] | None

Get oscillation index for coupling-variable side.

Returns:

List of oscillation index values or None if not set.

set_OscillationIndex_SharedDesignVariable_Minus_CopyTargetSharedDesignVariable(self, oscillationindex: List[float | None]) → None

Set oscillation index for shared design variables.

Args:

oscillationindex: List of oscillation index values.

get_OscillationIndex_SharedDesignVariable_Minus_CopyTargetSharedDesignVariable(self) → List[float | None] | None

Get oscillation index for shared design variables.

Returns:

List of oscillation index values or None if not set.

set_OscillationIndex_CopySharedDesignVariable_Minus_TargetSharedDesignVariable(self, oscillationindex: List[float | None]) → None

Set oscillation index for target shared design variables.

Args:

oscillationindex: List of oscillation index values.

get_OscillationIndex_CopySharedDesignVariable_Minus_TargetSharedDesignVariable(self) → List[float | None] | None

Get oscillation index for target shared design variables.

Returns:

List of oscillation index values or None if not set.

print_end_of_innerloop_iteration(self) → None

Print inconsistency details for this inconsistency at the end of an inner loop iteration.

print_termination_summary(self) → None

Print inconsistency details for this inconsistency at the end of the optimization run.

update_state(self, other_inconsistency: InConsistencySizeBasis) → None

Update the state of this InConsistencySizeBasis from another instance.

This method is necessary for multiprocessing. When subsystems are executed in parallel processes via Parallel.py, the original objects need to be updated with results from the executed copies. This method preserves the memory address of the object's attributes while updating their values.

Args:

other_inconsistency: The source instance containing updated values to copy from.

Note on copy operations: - Primitives (str, float, int, None): No copy.copy() needed because they are immutable in Python. Assigning creates a new binding; the original cannot be modified through the new reference. - List[float]: Uses update_state_listprimitive() which updates the list in-place to preserve the memory address. The getter methods already return copy.copy() of the lists, providing the necessary isolation from the source.