Initializing help system before first use

Model

Purpose
Represents a loaded Mosel model. Provides methods for execution, data access, and stream management.
Synopsis
class Model
Example
Using Model as a context manager:
with mp.load_model("model.bim") as model:
    model.run()
    print(model.objective_value)
# Model is automatically cleaned up here
Further information
1. Model objects are created by load_model or execute_model. They cannot be instantiated directly.
2. Model objects support the context manager protocol and can be used with with statements for automatic cleanup.
3. Model objects can be copied using copy.copy() or copy.deepcopy(). Copying creates an independent clone of the model's execution state using Mosel's built-in cloning mechanism. The clone can be run independently without affecting the original. Note that stream redirections are not copied; the clone starts with default stream settings.
Related topics
Module
moselpy

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.