-
Notifications
You must be signed in to change notification settings - Fork 0
/
docplex.mp.kpi.html
270 lines (249 loc) · 17 KB
/
docplex.mp.kpi.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>docplex.mp.kpi module — DOcplex.MP: Mathematical Programming Modeling for Python V2.14 documentation</title>
<link rel="stylesheet" href="_static/bizstyle.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/bizstyle.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="docplex.mp.linear module" href="docplex.mp.linear.html" />
<link rel="prev" title="docplex.mp.error_handler module" href="docplex.mp.error_handler.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!--[if lt IE 9]>
<script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="docplex.mp.linear.html" title="docplex.mp.linear module"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="docplex.mp.error_handler.html" title="docplex.mp.error_handler module"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">DOcplex.MP: Mathematical Programming Modeling for Python V2.14 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="refman.html" accesskey="U"><strong>docplex.mp</strong> reference manual</a> »</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="docplex.mp.error_handler.html"
title="previous chapter">docplex.mp.error_handler module</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="docplex.mp.linear.html"
title="next chapter">docplex.mp.linear module</a></p>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="docplex-mp-kpi-module">
<h1>docplex.mp.kpi module<a class="headerlink" href="#docplex-mp-kpi-module" title="Permalink to this headline">¶</a></h1>
<div class="toctree-wrapper compound">
</div>
<span class="target" id="module-docplex.mp.kpi"></span><dl class="class">
<dt id="docplex.mp.kpi.DecisionKPI">
<em class="property">class </em><code class="descclassname">docplex.mp.kpi.</code><code class="descname">DecisionKPI</code><span class="sig-paren">(</span><em>kpi_op</em>, <em>name=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#DecisionKPI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.DecisionKPI" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#docplex.mp.kpi.KPI" title="docplex.mp.kpi.KPI"><code class="xref py py-class docutils literal notranslate"><span class="pre">docplex.mp.kpi.KPI</span></code></a></p>
<p>Specialized class of Key Performance Indicator, based on expressions.</p>
<p>This subclass is built from a decision variable or a linear expression.
The <a class="reference internal" href="#docplex.mp.kpi.DecisionKPI.compute" title="docplex.mp.kpi.DecisionKPI.compute"><code class="xref py py-func docutils literal notranslate"><span class="pre">compute()</span></code></a> method evaluate the value of the KPI in a solution. This solution can either be passed
to the <cite>compute</cite> method, or using th emodel’s solution. In the latter case, the model must have been solved
with a solution.</p>
<dl class="method">
<dt id="docplex.mp.kpi.DecisionKPI.compute">
<code class="descname">compute</code><span class="sig-paren">(</span><em>s=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#DecisionKPI.compute"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.DecisionKPI.compute" title="Permalink to this definition">¶</a></dt>
<dd><p>Redefinition of the abstract <cite>compute(s=None)</cite> method.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The value of the decision expression in the solution.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">float</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Evaluating a KPI requires a solution object. This solution can either be passed explicitly
in the <cite>s</cite> argument, otherwise the model solution is used. In the latter case, th emodel must
have been solved with a solution, otherwise an exception is raised.</p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
<li>Evaluating a KPI raises an exception if no <cite>s</cite> solution has been passed</li>
<li>and the underlying model has not been solved with a solution.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="docplex.mp.solution.html#docplex.mp.solution.SolveSolution" title="docplex.mp.solution.SolveSolution"><code class="xref py py-class docutils literal notranslate"><span class="pre">docplex.mp.solution.SolveSolution</span></code></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="docplex.mp.kpi.DecisionKPI.get_model">
<code class="descname">get_model</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#DecisionKPI.get_model"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.DecisionKPI.get_model" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The model instance on which the KPI is defined.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="docplex.mp.model.html#docplex.mp.model.Model" title="docplex.mp.model.Model"><code class="xref py py-class docutils literal notranslate"><span class="pre">docplex.mp.model.Model</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="docplex.mp.kpi.DecisionKPI.get_name">
<code class="descname">get_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#DecisionKPI.get_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.DecisionKPI.get_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:
string: The published name of the KPI, a non-empty, unique string.</p>
</dd></dl>
<dl class="method">
<dt id="docplex.mp.kpi.DecisionKPI.is_decision_expression">
<code class="descname">is_decision_expression</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#DecisionKPI.is_decision_expression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.DecisionKPI.is_decision_expression" title="Permalink to this definition">¶</a></dt>
<dd><p>returns True if the KPI is based on a decision expression or variable.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="docplex.mp.kpi.FunctionalKPI">
<em class="property">class </em><code class="descclassname">docplex.mp.kpi.</code><code class="descname">FunctionalKPI</code><span class="sig-paren">(</span><em>fn</em>, <em>model</em>, <em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#FunctionalKPI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.FunctionalKPI" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#docplex.mp.kpi.KPI" title="docplex.mp.kpi.KPI"><code class="xref py py-class docutils literal notranslate"><span class="pre">docplex.mp.kpi.KPI</span></code></a></p>
<dl class="method">
<dt id="docplex.mp.kpi.FunctionalKPI.get_model">
<code class="descname">get_model</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#FunctionalKPI.get_model"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.FunctionalKPI.get_model" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The model instance on which the KPI is defined.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="docplex.mp.model.html#docplex.mp.model.Model" title="docplex.mp.model.Model"><code class="xref py py-class docutils literal notranslate"><span class="pre">docplex.mp.model.Model</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="docplex.mp.kpi.FunctionalKPI.get_name">
<code class="descname">get_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#FunctionalKPI.get_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.FunctionalKPI.get_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns:
string: The published name of the KPI, a non-empty, unique string.</p>
</dd></dl>
<dl class="method">
<dt id="docplex.mp.kpi.FunctionalKPI.is_decision_expression">
<code class="descname">is_decision_expression</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#FunctionalKPI.is_decision_expression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.FunctionalKPI.is_decision_expression" title="Permalink to this definition">¶</a></dt>
<dd><p>returns True if the KPI is based on a decision expression or variable.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="docplex.mp.kpi.KPI">
<em class="property">class </em><code class="descclassname">docplex.mp.kpi.</code><code class="descname">KPI</code><a class="reference internal" href="_modules/docplex/mp/kpi.html#KPI"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.KPI" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Abstract class for key performance indicators (KPIs).</p>
<p>Each KPI has a unique name. A KPI is attached to a model instance and can compute a numerical value,
using the <code class="xref py py-func docutils literal notranslate"><span class="pre">compute()</span></code> method. The <cite>compute</cite> method takes an optional solution argument;
if passed a valid SolveSolution object, this solution is used to evaluate the KPI, else compute()
will attempt to access th emodel’s solution. If the model has no attached solution, then an exception
is raised by <cite>compute</cite>.</p>
<dl class="method">
<dt id="docplex.mp.kpi.KPI.get_model">
<code class="descname">get_model</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#KPI.get_model"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.KPI.get_model" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The model instance on which the KPI is defined.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="docplex.mp.model.html#docplex.mp.model.Model" title="docplex.mp.model.Model"><code class="xref py py-class docutils literal notranslate"><span class="pre">docplex.mp.model.Model</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="docplex.mp.kpi.KPI.get_name">
<code class="descname">get_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#KPI.get_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.KPI.get_name" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The published name of the KPI, a non-empty, unique string.</td>
</tr>
<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="docplex.mp.kpi.KPI.is_decision_expression">
<code class="descname">is_decision_expression</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/mp/kpi.html#KPI.is_decision_expression"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.mp.kpi.KPI.is_decision_expression" title="Permalink to this definition">¶</a></dt>
<dd><p>returns True if the KPI is based on a decision expression or variable.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="docplex.mp.linear.html" title="docplex.mp.linear module"
>next</a> |</li>
<li class="right" >
<a href="docplex.mp.error_handler.html" title="docplex.mp.error_handler module"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">DOcplex.MP: Mathematical Programming Modeling for Python V2.14 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="refman.html" ><strong>docplex.mp</strong> reference manual</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2016-2019, IBM®.
</div>
</body>
</html>