choice.ReplacementUtility
Guide & worked example · Source
choice.ReplacementUtility(
theta_maintenance=0.001,
theta_replacement_cost=10.0,
device=None,
)Rust-style bus replacement flow utility.
Two-action specification:
a=0(maintain):u(x,0) = -theta_maintenance * xa=1(replace):u(x,1) = -theta_replacement_cost
Attributes
| Name | Description |
|---|---|
device |
|
theta_maintenance |
|
theta_replacement_cost |
Methods
| Name | Description |
|---|---|
| forward | Evaluate replacement-model flow utility. |
| get_params | Return scalar utility parameters as a Python dictionary. |
| set_params | Set utility parameters from Python scalars or tensors. |
forward
choice.ReplacementUtility.forward(
state,
choice=None,
theta_maintenance=None,
theta_replacement_cost=None,
)Evaluate replacement-model flow utility.
Args: state: Discrete state index tensor. choice: Optional action index (0 maintain, 1 replace). theta_maintenance: Optional maintenance parameter override. theta_replacement_cost: Optional replacement-cost override.
Returns: Utility tensor for requested action or stacked (n_obs, 2) utility.
get_params
choice.ReplacementUtility.get_params()Return scalar utility parameters as a Python dictionary.
set_params
choice.ReplacementUtility.set_params(theta_maintenance, theta_replacement_cost)Set utility parameters from Python scalars or tensors.