FreezeOptions#
- class gamspy.FreezeOptions(*, no_match_limit: int = 0, debug: bool = False, update_type: Literal['0', 'base_case', 'accumulate', 'inherit'] = 'base_case')[source]#
Options for the freeze method of a Model.
- Attributes:
- no_match_limitint, optional
Maximum number of non-matching elements to allow. Default is 0.
- debugbool, optional
Enables debug mode. Default is False.
- update_typeLiteral[“0”, “base_case”, “accumulate”, “inherit”], optional
Specifies the update type for the model instance.
“base_case”: Update from the base case.
“accumulate”: Accumulate changes.
“inherit”: Inherit from the parent.
Default is “base_case”.
Examples
>>> import gamspy as gp >>> m = gp.Container() >>> i = gp.Set(m, "i", records=["i1", "i2"]) >>> p = gp.Parameter(m, "p", domain=i, records=[("i1", 1), ("i2", 2)]) >>> v = gp.Variable(m, "v", domain=i) >>> e = gp.Equation(m, "e", domain=i) >>> e[i] = v[i] == p[i] >>> model = gp.Model(m, "test", equations=[e], problem="LP", sense="min", objective=gp.Sum(i, v[i])) >>> options = gp.FreezeOptions(update_type="accumulate") >>> instance = model.freeze(modifiables=[p]) >>> p["i1"] = 3 >>> summary = model.solve(freeze_options=options)
- debug: bool#
- no_match_limit: int#
- update_type: Literal['0', 'base_case', 'accumulate', 'inherit']#