nolhs

Module for generating Nearly Orthogonal Latin Hypercube Samples (NOLHS).

Module Contents

class nolhs.NOLHS(designs: list[tuple[float, float, int]] | pathlib.Path, num_stacks: int = 1)

Bases: simopt.data_farming.data_farming_core.DesignType

Class to generate Nearly Orthogonal Latin Hypercube Samples (NOLHS).

Initialize the NOLHS class.

Parameters:
  • designs (list[tuple[float, float, int]] | Path) – A list of tuples where each tuple contains (min, max, precision) for a design variable, or a Path to a file containing the design config.

  • num_stacks (int, optional) – The number of stacks to generate. Defaults to 1.

property num_stacks: int

Number of stacks in the design.

design_table() dict[int, numpy.ndarray]

The NOLHS design table.

Returns:

A dictionary mapping the number of variables to

the corresponding NOLHS design matrix.

Return type:

dict[int, np.ndarray]

generate_design() list[list[float]]

Generate the scaled NOLHS design as a 2D list.

Returns:

A 2D list containing the scaled design points.

Return type:

list[list[float]]