Resource Estimation API
The evobench.tools.resources submodule provides public utilities for preflight estimation of memory, runtime and dimensional feasibility.
Import path
from evobench.tools import estimate_feasibility
from evobench.tools.resources import FeasibilityBudget
Main functions
estimate_single_array_memory_mb(population_size, dim, dtype_size_bytes=8)
Estimates the memory required by one population-like numerical array.
estimate_algorithm_memory_mb(...)
Estimates algorithm working memory using configurable multipliers.
Important arguments:
| Argument | Purpose |
|---|---|
algorithm_name |
Algorithm key such as pso, eda, abc, or a custom key |
population_size |
Number of individuals/candidates |
dim |
Number of decision variables |
multipliers |
Optional overrides for known or custom algorithms |
quadratic_multipliers |
Optional dim x dim overhead model |
estimate_runtime_seconds(...)
Estimates runtime from empirical baselines.
Important arguments:
| Argument | Purpose |
|---|---|
algorithm_name |
Algorithm key |
dim |
Problem dimensionality |
population_size |
Population size |
generations |
Number of iterations/generations |
baselines |
Optional custom runtime baselines |
benchmark_name |
Optional label for future benchmark-specific models |
estimate_feasibility(...)
Builds a full feasibility report by combining memory and runtime estimates with a resource budget.
Returns a FeasibilityReport object.
Data classes
RuntimeBaseline
Represents an empirical runtime measurement used as the basis for extrapolation.
RuntimeBaseline(
seconds=0.31,
dim=100,
population_size=1000,
generations=10,
complexity="linear_units",
)
FeasibilityBudget
Defines the maximum accepted resource envelope.
FeasibilityBudget(
max_dimension=100,
max_population_size=1000,
max_estimated_memory_mb=1024.0,
max_estimated_seconds=30.0,
)
FeasibilityReport
Contains the final diagnosis:
report.is_feasible
report.reasons
report.estimated_memory_mb
report.estimated_seconds
report.to_dict()
Notes
These utilities are planning tools. They do not guarantee exact runtime or memory consumption because real performance depends on CPU, BLAS backend, NumPy version, objective-function cost and implementation details.