Points and cache#
- class OMADS._points._point.Point(n=0, dtype=<OMADS._utils._globals.DType object>)[source]#
Bases:
objectA class for the poll point
- Parameters:
_n – # Dimension of the point
_coords – Coordinates of the point
_defined – Coordinates definition boolean
_signature – hash signature; facilitate looking for duplicates and storing coordinates, hash signature, in the cache memory
_dtype – numpy double data type precision
n (int)
dtype (DType | None)
- class OMADS._points._candidate_point.CandidatePoint(_fc_index=None, _n=0, _coords=None, _defined=None, _evaluated=False, _f=None, _freal=None, _c_ineq=None, _c_eq=None, _h=inf, _signature=0, _dtype=None, _var_type=None, _sets=None, _var_link=None, _status=DESIGN_STATUS.UNEVALUATED, _constraints_type=None, _is_eb_passed=False, _lambda=None, _rho=5e-05, _hmax=1.0, _hmin=inf, _eval_time=0.0, _source='Current run', _model='Simulation', _hzero=None, _direction=None, _fs=None, _eval_no=0, _incumbent_signature=None, _improving=False, _cpb=None, _mapped_coords=None, _is_nondominated=False, _was_center=False)[source]#
Bases:
objectA class for the poll point
- Parameters:
_n (int) – # Dimension of the point
_coords (List[float] | None) – Coordinates of the point
_defined (List[bool] | None) – Coordinates definition boolean
_evaluated (bool) – Evaluation boolean
_f (List[float] | None) – Objective function
_freal (List[float] | None) – Realistic target value of the objective function
_c_ineq (List[float] | None) – Inequality constraints
_c_eq (List[float] | None) – Equality constraints
_h (float) – Aggregated constraints; active set
_signature (int) – hash signature; facilitate looking for duplicates and storing coordinates, hash signature, in the cache memory
_dtype (DType | None) – numpy double data type precision
_fc_index (int | None)
_var_type (List[int] | None)
_sets (Dict | None)
_var_link (List[str] | None)
_status (DESIGN_STATUS)
_constraints_type (List[BARRIER_TYPES] | None)
_is_eb_passed (bool)
_lambda (List[float] | None)
_rho (float)
_hmax (float)
_hmin (float)
_eval_time (float)
_source (str)
_model (str)
_hzero (float | None)
_direction (List[Any] | None)
_fs (List[Any] | None)
_eval_no (int)
_incumbent_signature (int | None)
_improving (bool)
_cpb (List[float] | None)
_mapped_coords (List[Any] | None)
_is_nondominated (bool)
_was_center (bool)
- property incumbent_signature: int#
The hash ID of the incumbent candidate solution used to generate the current point
- Returns:
Incumbent hash ID
- Return type:
int
- property fs: List[Any]#
Point coordinates on the functions space
- Returns:
Functions Point
- Return type:
- property direction: List[Any]#
Point instant of the direction from the incumbent to the current point
- Returns:
Direction Point
- Return type:
- property hzero: float#
Violation margin
- Returns:
_description_
- Return type:
_type_
- property h_max: float#
Maximum constraints violation
- Returns:
The maximum value of the evaluated constraints violation function
- Return type:
float
- property rho: float#
Mesh density
- Returns:
mesh parameter
- Return type:
float
- property lambda_multipliers: List[float]#
Multipliers values
- Returns:
LMs values
- Return type:
List[float]
- property var_link: List[str]#
Linked sets or components to the variables configuration
- Returns:
List of component names
- Return type:
List[str]
- property status: DESIGN_STATUS#
Returns the design status of the current candidate solution
- Returns:
Design status (feasible, infeasible, error, or pending)
- Return type:
- property is_extreme_barrier_passed: bool#
Check whether constraints violation function passes the extreme violation margin threshold
- Returns:
Whether passed an extreme barrier
- Return type:
bool
- property var_type: List[int]#
List of variables type
- Returns:
List of variables type
- Return type:
List[int]
- property constraints_type: List[BARRIER_TYPES]#
List of constraints barrier type
- Returns:
List of constraints barrier type
- Return type:
List[BARRIER_TYPES]
- property sets: Dict#
Dictionary of the discrete sets used in design configurations associated with the current candidate solution
- Returns:
Dictionary of the discrete sets
- Return type:
Dict
- property evaluated: bool#
Check whther the current point has been evaluated
- Returns:
Check whther the current point has been evaluated
- Return type:
boolean
- property signature: int#
Hash ID of the current candidate solution
- Returns:
Hash ID of the current candidate solution
- Return type:
int
- property n_dimensions: int#
Number of dimensions
- Returns:
Number of design variables
- Return type:
int
- property coordinates#
Get the coordinates of the point.
- property defined: List[bool]#
Set of booleans that verify that the point is well defined
- Returns:
Set of booleans that verify that the point is well defined
- Return type:
List[bool]
- property f: List[float]#
List of objective functions values
- Returns:
List of objective functions values
- Return type:
List[float]
- property fobj: List[float]#
List of objective functions values
- Returns:
List of evaluated objective functions
- Return type:
List[float]
- property hmin: float#
Minimum constraints violation
- Returns:
min constraints violation
- Return type:
float
- property c_ineq: List[float]#
List of inequality constraints
- Returns:
List of values of inequality constraints
- Return type:
List[float]
- property c_eq: List[float]#
List of equality constraints
- Returns:
List of values for evaluated list of constraints
- Return type:
List[float]
- property h#
Constrains violation function
- Returns:
The value of the constraints violation function
- Return type:
float
- class OMADS._points._cache.Cache(capacity=1)[source]#
Bases:
objectIn computing, a hash table (hash map) is a data structure that implements an associative array abstract data type, a structure that can map keys to values. A hash table uses a hash function to compute an index, also called a hash code, into an array of buckets or slots, from which the desired value can be found. During lookup, the key is hashed and the resulting hash indicates where the corresponding value is stored.
Internally the cache is a plain, insertion-ordered list of candidates (position i is the historical integer “index” that the rest of the solver already threads around) plus a signature -> position dict for O(1) duplicate checks/updates, and small incrementally maintained index lists for the “was_center”/”improving” flags so the hot sampling path never has to rescan the whole cache to answer “how many centers do I have so far”.
Note: every query/aggregate method below deliberately excludes the most recently inserted candidate (indices are compared with < self._last_index, not <=), mirroring the iloc[0:self._last_index] slicing the previous pandas-backed implementation used throughout – that is existing, load-bearing behavior (the newest candidate only becomes visible to these aggregates once a further candidate is added), not something introduced here, and changing it would shift which sampling branch/parameters the solver picks.
- Parameters:
capacity (int)
- get_feasible_points_and_f()[source]#
Coordinates and (summed) objective of every evaluated feasible point, e.g. as interpolation data for a surrogate model. Unlike most getters here this includes the most recent candidate, which is often the incumbent itself.
- Return type:
tuple[ndarray, ndarray]
- get_points_f_and_c()[source]#
Coordinates, raw (unpenalized, summed) objective and inequality constraint values of every evaluated feasible or infeasible point with finite outputs, e.g. as regression data for constraint-aware surrogate models.
- Return type:
tuple[ndarray, ndarray, ndarray]
- property data_cache: DataFrame#
A pandas view of the cache, materialized on demand for backward compatibility with external consumers; not used on any internal hot path.
- Return type:
pd.DataFrame
- property size: int#
A getter of the size of the hash ID list
- Return type:
int
- is_duplicate(x, add=True)[source]#
Check if the point is in the cache memory
- Parameters:
x (Point) – Design point
add (bool)
- Returns:
A boolean flag indicate whether the point exist in the cache memory
- Return type:
bool
- is_duplicate_in_set(xp, x_pool)[source]#
Check if the point is in the cache memory
- Parameters:
x (Point) – Design point
xp (CandidatePoint)
x_pool (List[CandidatePoint])
- Returns:
A boolean flag indicate whether the point exist in the cache memory
- Return type:
bool
- update(x)[source]#
Update the cache points with evaluated design criteria
- Parameters:
x (List[CandidatePoint]) – _description_