message_ix_models.model.buildings.build_and_solve
- message_ix_models.model.buildings.build_and_solve(context: Context) Scenario[source]
Build MESSAGEix-Buildings and solve.
The function responds to a
buildings.Configinstance atcontext.buildings.Either clone the base scenario (
Context.clone_to_dest(), ifbuildings.Config.cloneisTrue) or load an existing scenario.Retrieve prices (using
get_prices()) andhistorical_activityfrom the scenario.Call
pre_solve()to run (optionally) ACCESS, (always) STURM, add appropriate structure to the scenario, and update thedemandparameter using STURM/ACCESS outputsFor 1 or more iterations:
Solve the MESSAGE scenario.
Run
post_solve()to check convergence.Possibly run
pre_solve()to start the next iteration.
The number of iterations at (4) is controlled by
buildings.Config.max_iterations; setting to1or less means the process is ‘once-through’, and the MESSAGEix-Buildings models are only run once.