1 | ======================= |
---|
2 | coopr.pyomo CHANGELOG |
---|
3 | ======================= |
---|
4 | |
---|
5 | ------------------------------------------------------------------------------- |
---|
6 | 2.2 |
---|
7 | ------------------------------------------------------------------------------- |
---|
8 | |
---|
9 | - Under development. |
---|
10 | |
---|
11 | ------------------------------------------------------------------------------- |
---|
12 | 2.1 |
---|
13 | ------------------------------------------------------------------------------- |
---|
14 | |
---|
15 | - Removed some TBD notes in the Benders example, and checked in the full |
---|
16 | benders script (a debug version was committed initially, that only |
---|
17 | dealt with iteration 1). This version replicates, to within precision, |
---|
18 | the AMPL execution. Should terminate in 5 master iterations. |
---|
19 | |
---|
20 | - Misc rework of variable presolving. Now, model statistics are |
---|
21 | stored in a more obvious location, and using more verbose names. |
---|
22 | |
---|
23 | - Added functions that can (1) extract a canonical representation |
---|
24 | from an expressions, and (2) generate an expression from a canonical |
---|
25 | representation. |
---|
26 | |
---|
27 | - Adding ability to load a list or tuple of values into a Pyomo |
---|
28 | model. These are loaded into the variables in the order in which the |
---|
29 | variables are identified. |
---|
30 | |
---|
31 | - Updated variable naming. Special symbols are mapped to |
---|
32 | a name that contains _Q#_, where # the ASCII decimal representation |
---|
33 | for that symbol. |
---|
34 | |
---|
35 | - Added support for denoting constraint inequalities as 'strict'. Added |
---|
36 | tests to verify that strict inequalities are recognized. |
---|
37 | |
---|
38 | - Resolved #3970. When a parameter is specified with a default |
---|
39 | value, we should be able to refer to its index set directly, since |
---|
40 | all values are tacitly defined. |
---|
41 | |
---|
42 | - Added a 'random' solver for the p-median example. |
---|
43 | |
---|
44 | - Added ".solver-mipgap" option to the pyomo script, mirroring recent useful |
---|
45 | updates to the PH script. |
---|
46 | |
---|
47 | - Simplified the syntax for adding a constraint to a Constraint object. |
---|
48 | |
---|
49 | - Reworking how components interact with models. Now, components can |
---|
50 | only be initialized using data from the model that they are associated |
---|
51 | with. Thus, models and components are tightly coupled. This allows |
---|
52 | the following syntax: |
---|
53 | |
---|
54 | model.x = Param(model.A) |
---|
55 | model.construct() |
---|
56 | |
---|
57 | The construction process uses the model data that is associated with |
---|
58 | the parameter. Also, this commmit allows models to be components of |
---|
59 | another model: |
---|
60 | |
---|
61 | m1=Model() |
---|
62 | m2=Model() |
---|
63 | m2.m1 = m1 |
---|
64 | |
---|
65 | Note, however, that model construct is required to be done |
---|
66 | separately. When model m2 is constructed, the m1 component is not |
---|
67 | constructed. |
---|
68 | |
---|
69 | - Added check to avoid printing an objective with an empty linear sum. |
---|
70 | |
---|
71 | - Rework of the amplbook2 examples, and other Pyomo examples. |
---|
72 | |
---|
73 | - A change in semantics for setting up dimen and dim. This change requires |
---|
74 | that users specify dimen in situtations where it is not obvious from the |
---|
75 | component declaration. For example, if you initialize from a function, |
---|
76 | then you'll need to specify dimen if the function returns n-tuples. |
---|
77 | |
---|
78 | - Added an extension point for plugins that suport model transformations. |
---|
79 | Two transformations have been defined: a transformation for eliminating |
---|
80 | fixed variables, and a transformation for relaxing integrality. These |
---|
81 | can be generically accessed with the apply_transformation() function. |
---|
82 | |
---|
83 | - Extended API of the PyomoModel class to add a variety of helper |
---|
84 | functions (e.g. accessing constraints, variables and objectives). |
---|
85 | Adding a method for getting the model solution, as a vector. |
---|
86 | |
---|
87 | - Added tests to exercise the Pyomo command-line. |
---|
88 | |
---|
89 | - Updates to Pyomo command-line options: |
---|
90 | |
---|
91 | Added --model-name option, which allows the specification of an object |
---|
92 | other than 'model' for the model that is optimized. |
---|
93 | |
---|
94 | Added support for create_model(), which accepts a dictionary or |
---|
95 | pyutilib.misc.Container object containing the options specified with the |
---|
96 | --model-options option. This function returns a model that is optimized. |
---|
97 | |
---|
98 | Added the 'errors' debugging mode. When specified, exceptions dump |
---|
99 | a traceback. Otherwise, exceptions are caught and only the exception |
---|
100 | string is printed. |
---|
101 | |
---|
102 | - Adding support for component index deactivation. This supports the |
---|
103 | following semantics: |
---|
104 | |
---|
105 | model.C = Constraint(model.A) |
---|
106 | model.C[index].deactivate() |
---|
107 | |
---|
108 | Note that the current implementation requires the user to query whether |
---|
109 | each index is active: |
---|
110 | |
---|
111 | if model.C[index].active: |
---|
112 | # Do something |
---|
113 | |
---|
114 | I could have alternatively changed the iterator for the constraint, |
---|
115 | but then that could mask the existence of a constraint, making it |
---|
116 | difficult to reactivate. |
---|
117 | |
---|
118 | Finally, note that this activation mechanism is independent |
---|
119 | of the component level activation/deactivation: |
---|
120 | |
---|
121 | model.C.deactivate() |
---|
122 | # All C constraints are deactivated |
---|
123 | model.C[index].deactivate |
---|
124 | # You can still manipulate the C constraint |
---|
125 | model.C.activate() |
---|
126 | # Now, the C constraint is active, except for the ' |
---|
127 | # 'index' constraint |
---|
128 | |
---|
129 | - A rework of component management in Pyomo. Component types are now |
---|
130 | managed with the natural class types (e.g. Var for variables, rather |
---|
131 | than _VarBase). Further, the components should now be accessed with |
---|
132 | model methods: components() or active_components(). For example, |
---|
133 | |
---|
134 | model.components(Var) |
---|
135 | |
---|
136 | returns a dictionary of the Var components. |
---|
137 | |
---|
138 | - Created the ComponentBase class, which manages the initialization of |
---|
139 | components. This consolidates the mechanism needed to generalize |
---|
140 | the component indexing operations. |
---|
141 | |
---|
142 | - Reworking SetArray constructor to create temporary set objects for non-set |
---|
143 | index arguments. These arguments are passed into a Set object |
---|
144 | with the 'initialize' argument. |
---|
145 | |
---|
146 | - Extended the constraint generation logic to evaluate whether the |
---|
147 | constraint expression contains constant values. This extension allows |
---|
148 | the following types of constraints to be specified: |
---|
149 | |
---|
150 | def f(model) |
---|
151 | return 0 < model.x |
---|
152 | |
---|
153 | def g(model) |
---|
154 | return model.x == model.y |
---|
155 | |
---|
156 | def h(model) |
---|
157 | return model.y > model.z |
---|
158 | |
---|
159 | However, it's pretty clear now that the following cannot be supported in |
---|
160 | Python: |
---|
161 | |
---|
162 | def j(model) |
---|
163 | return 0 < model.x < 1 |
---|
164 | |
---|
165 | To add upper and lower bounds, a user will need to return a tuple value: |
---|
166 | |
---|
167 | def j(model) |
---|
168 | return (0, model.x, 1) |
---|
169 | |
---|
170 | or return an expression that is generated incrementally: |
---|
171 | |
---|
172 | def j(model) |
---|
173 | e = 0 < model.x |
---|
174 | return e < 1 |
---|
175 | |
---|
176 | - Significantly changed - and improved - the handling of variable lower |
---|
177 | and upper bounds. In the old version of pyomo, if parameters were |
---|
178 | supplied as bounds, the lb/ub were silently ignored when writing |
---|
179 | LP/NL/etc files. |
---|
180 | |
---|
181 | In the new version of pyomo, these parameters are stored and handled |
---|
182 | to avoid this issue. In particular, the "lb" and "ub" attributes |
---|
183 | of a variable are either (1) None, (2) a NumericConstant?, or (3) a |
---|
184 | _ParamBase. The latter two objects share the common () operator. Thus, |
---|
185 | to access the lb and ub attributes of a variable, one should either |
---|
186 | test for None, or use lb() or ub() to extract the value. |
---|
187 | |
---|
188 | - Added constraint symbol maps when writing NL files, so the constraint names |
---|
189 | can be mapped back (e.g., when dealing with dual variables in SOL files) |
---|
190 | into the user-recognized names. |
---|
191 | |
---|
192 | ------------------------------------------------------------------------------- |
---|
193 | 2.0 |
---|
194 | ------------------------------------------------------------------------------- |
---|
195 | |
---|
196 | - Initial release of Coopr to create the coopr.pyomo package. |
---|
197 | |
---|
198 | - See coopr.dist for previous ChangeLog information related to Coopr. |
---|
199 | |
---|