Generate reference directions via Latin Hypercube sampling. Args: random_state: Random seed for reproducibility. Returns: Array of reference directions.
(self, random_state: int | None = None)
| 31 | self.n_points = n_points |
| 32 | |
| 33 | def _do(self, random_state: int | None = None) -> NDArray: |
| 34 | """Generate reference directions via Latin Hypercube sampling. |
| 35 | |
| 36 | Args: |
| 37 | random_state: Random seed for reproducibility. |
| 38 | |
| 39 | Returns: |
| 40 | Array of reference directions. |
| 41 | """ |
| 42 | problem = Problem(n_var=self.n_dim, xl=0.0, xu=1.0) # type: ignore[abstract] |
| 43 | sampling = LatinHypercubeSampling() |
| 44 | |
| 45 | x = sampling( |
| 46 | problem, |
| 47 | self.n_points - self.n_dim, |
| 48 | to_numpy=True, |
| 49 | random_state=random_state, |
| 50 | ) |
| 51 | x = map_onto_unit_simplex(x, "kraemer") |
| 52 | x = np.vstack([x, np.eye(self.n_dim)]) |
| 53 | return x |
nothing calls this directly
no test coverage detected