Misc.#
- class kleinberg_grid_simulator.utils.Result(edt: float, process_time: float, n: int, r: float, p: int, q: int, n_runs: int, julia: bool, numba: bool = True, parallel: bool = False)[source]#
Dataclass to represent the results.
- kleinberg_grid_simulator.utils.cache_edt_of_r(compute_edt, n=10000, n_runs=10000, **kwargs)[source]#
- kleinberg_grid_simulator.utils.get_target(f, a, b, t)[source]#
Solve by dichotomy f(x)=t
- Parameters:
- Returns:
The (possibly approximated) solution of f(x)=t
- Return type:
Examples
>>> f = cache(lambda x: (x-2)**2) >>> x = get_target(f, 2., 10., 2.) >>> f"{x:.4f}" '3.4142'