scfocus.environment.Env
- class scfocus.environment.Env(n, f, max_steps, pct_samples, n_states, err_scale, bins)[source]
Environment class for simulating and managing states, actions, and rewards.
- Parameters:
n (int) – Number of individuals in the environment.
f (numpy.ndarray) – Input feature matrix with shape (num_samples, num_features).
max_steps (int) – Maximum number of steps before the environment terminates.
pct_samples (float) – Percentage of samples to be used for each state.
n_states (int) – Number of state variables.
err_scale (float) – Error scaling factor to adjust the weight of errors in reward calculation.
bins (int) – Number of bins for histogram-based state discretization.
Methods
__init__(n, f, max_steps, pct_samples, ...)get_norm(states)Calculates the average norm distance between all pairs of states.
get_state(f_)Computes the current state and error based on input features.
reset()Resets the environment to its initial state.
step(action)Executes an action and updates the environment's state.