Simulation Specs
Used to specify the simulation, its inputs and outputs, and user data.
1...
2from libensemble import SimSpecs
3from simulator import sim_find_sine
4
5...
6
7sim_specs = SimSpecs(
8 sim_f=sim_find_sine,
9 inputs=["x"],
10 outputs=[("y", float)],
11 user={"batch": 1234},
12)
13...
- pydantic model libensemble.specs.SimSpecs
Specifications for configuring a Simulation Function.
- Fields:
- field globus_compute_endpoint: str | None = ''
A Globus Compute (https://www.globus.org/compute) ID corresponding to an active endpoint on a remote system. libEnsemble’s workers will submit simulator function instances to this endpoint instead of calling them locally.
- field inputs: list[str] | None = [] (alias 'in')
list of field names out of the complete history to pass into the simulation function upon calling.
- field outputs: list[tuple] = [] (alias 'out')
list of 2- or 3-tuples corresponding to NumPy dtypes. e.g.
("dim", int, (3,)), or("path", str). Typically used to initialize an output array within the simulation function:out = np.zeros(100, dtype=sim_specs["out"]). Also necessary to construct libEnsemble’s history array.
- field persis_in: list[str] | None = []
list of field names to send to a persistent simulation function throughout the run, following initialization.
- field sim_f: object = None
Python function matching the
sim_finterface. Evaluates parameters produced by a generator function.
- field simulator: object | None = None
A pre-initialized simulator object or callable in gest-api format. When provided, sim_f defaults to gest_api_sim wrapper.
- field threaded: bool | None = False
Instruct Worker process to launch user function to a thread.
- field user: dict | None = {}
A user-data dictionary to place bounds, constants, settings, or other parameters for customizing the simulator function.
- field vocs: object | None = None
A VOCS object. If provided and inputs/outputs are not explicitly set, they will be automatically derived from VOCS.