@@ -27,7 +27,7 @@ can be accessed using its ``value`` member. For example, suppose the
27
27
model contains a variable named ``quant `` that is a singleton (has no
28
28
indexes) and suppose further that the name of the instance object is
29
29
``instance ``. Then the value of this variable can be accessed using
30
- ``pyo.value(instance.quant) ``. Variables with indexes can be referenced
30
+ ``pyo.pyo. value(instance.quant) ``. Variables with indexes can be referenced
31
31
by supplying the index.
32
32
33
33
Consider the following very simple example, which is similar to the
@@ -54,13 +54,13 @@ the following code snippet displays all variables and their values:
54
54
>>> for v in instance.component_objects(pyo.Var, active = True ):
55
55
... print (" Variable" ,v) # doctest: +SKIP
56
56
... for index in v:
57
- ... print (" " ,index, pyo.value(v[index])) # doctest: +SKIP
57
+ ... print (" " ,index, pyo.pyo. value(v[index])) # doctest: +SKIP
58
58
59
59
60
60
Alternatively,
61
61
62
62
>>> for v in instance.component_data_objects(pyo.Var, active = True ):
63
- ... print (v, pyo.value(v)) # doctest: +SKIP
63
+ ... print (v, pyo.pyo. value(v)) # doctest: +SKIP
64
64
65
65
This code could be improved by checking to see if the variable is not
66
66
indexed (i.e., the only index value is ``None ``), then the code could
@@ -96,7 +96,7 @@ of every Parameter in a model:
96
96
... nametoprint = str (str (parmobject.name))
97
97
... print (" Parameter " , nametoprint) # doctest: +SKIP
98
98
... for index in parmobject:
99
- ... vtoprint = pyo.value(parmobject[index])
99
+ ... vtoprint = pyo.pyo. value(parmobject[index])
100
100
... print (" " ,index, vtoprint) # doctest: +SKIP
101
101
102
102
@@ -136,7 +136,7 @@ an instance, duals can be accessed in the following fashion.
136
136
:language: python
137
137
138
138
The following snippet will only work, of course, if there is a
139
- constraint with the name ``AxbConstraint `` that has and index, which is
139
+ constraint with the name ``Axbpyo.Constraint `` that has and index, which is
140
140
the string ``Film ``.
141
141
142
142
.. literalinclude :: /src/scripting/driveabs2_Access_one_dual.spy
@@ -145,7 +145,7 @@ the string ``Film``.
145
145
Here is a complete example that relies on the file ``abstract2.py `` to
146
146
provide the model and the file ``abstract2.dat `` to provide the
147
147
data. Note that the model in ``abstract2.py `` does contain a constraint
148
- named ``AxbConstraint `` and ``abstract2.dat `` does specify an index for
148
+ named ``Axbpyo.Constraint `` and ``abstract2.dat `` does specify an index for
149
149
it named ``Film ``.
150
150
151
151
.. literalinclude :: /src/scripting/driveabs2.spy
0 commit comments