mario.Database.ras
- Database.ras(
- target_rows,
- target_cols,
- scenario: str = 'baseline',
- inplace: bool = True,
- calc_all: bool = True,
- notes=None,
- tol: float = 1e-08,
- max_iter: int = 1000,
Balance the
Zblock of one IOT scenario with the RAS method.- Parameters:
target_rows – Desired row sums for the
Zmatrix.target_cols – Desired column sums for the
Zmatrix.scenario – Scenario whose
Zblock should be balanced.inplace – When
True, mutate the current database. WhenFalse, return a balanced copy.calc_all – When
True, recompute the standard dependent matrices after replacingZ.notes – Optional user notes appended to metadata history.
tol – Absolute convergence tolerance passed to
mario.ras().max_iter – Maximum number of RAS iterations.
- Returns:
Balanced database when
inplace=False, otherwiseNone.- Return type:
Database | None