-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparameterized.html
More file actions
335 lines (312 loc) · 14.6 KB
/
Copy pathparameterized.html
File metadata and controls
335 lines (312 loc) · 14.6 KB
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Parameterized — roco 1.0 documentation</title>
<link rel="stylesheet" href="_staticclassic.css" type="text/css" />
<link rel="stylesheet" href="_staticpygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_staticjquery.js"></script>
<script type="text/javascript" src="_staticunderscore.js"></script>
<script type="text/javascript" src="_staticdoctools.js"></script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="author" title="About these documents" href="about.html" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Component" href="component.html" />
<link rel="prev" title="roco.api" href="code.html" />
</head>
<body role="document">
<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="component.html" title="Component"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="code.html" title="roco.api"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">roco 1.0 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="code.html" accesskey="U">roco.api</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-api.parameterized">
<span id="parameterized"></span><h1>Parameterized<a class="headerlink" href="#module-api.parameterized" title="Permalink to this headline">¶</a></h1>
<p>Parameterized class.</p>
<p>This module contains the Parameterized class which is a base class for
Component.</p>
<dl class="class">
<dt id="api.parameterized.Parameterized">
<em class="property">class </em><code class="descclassname">api.parameterized.</code><code class="descname">Parameterized</code><a class="headerlink" href="#api.parameterized.Parameterized" title="Permalink to this definition">¶</a></dt>
<dd><p>An object represented by parameters, constraints, and relations.</p>
<p>Acts as a base class to represent an object with parameters that can
be constrained and has relations between parameters.</p>
<dl class="docutils">
<dt>Attributes:</dt>
<dd><dl class="first last docutils">
<dt>parameters (dict): contains parameters by name, can be symbolic</dt>
<dd>variables.</dd>
<dt>allParameters (dict): contains parameters by symbolic variable.</dt>
<dd>Includes ones inherited from other parameterized objects.
The variable key points to a tuple, (name, value).</dd>
<dt>constraints (list): list of sympy relations that define constraints</dt>
<dd>on the parameterized object.</dd>
<dt>relations (list): list of sympy relations that define soft relations</dt>
<dd>between parameters.</dd>
<dt>subs (dict): contains tuples from ambiguous symbolic variable to</dt>
<dd>specific symbolic variable which includes parameter
inheritance.</dd>
</dl>
</dd>
</dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.add_constraint">
<code class="descname">add_constraint</code><span class="sig-paren">(</span><em>expression</em>, <em>name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.add_constraint" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds a new sympy constraint to the parameterized object</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><dl class="first last docutils">
<dt>expression(sympy.core.relational): A sympy expression representing a</dt>
<dd>relationship between two or more parameters</dd>
<dt>name: a unique identifying name for the constraint. If none is</dt>
<dd>provided, a unique id will be generated</dd>
</dl>
</dd>
<dt>Returns:</dt>
<dd>The identifying name for the expression</dd>
<dt>Raises:</dt>
<dd>KeyError: A parameter called name has already been created</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.add_parameter">
<code class="descname">add_parameter</code><span class="sig-paren">(</span><em>name</em>, <em>value</em>, <em>is_literal=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.add_parameter" title="Permalink to this definition">¶</a></dt>
<dd><dl class="docutils">
<dt>Adds a k/v pair to the internal store if the key has not been added</dt>
<dd>before</dd>
<dt>Args:</dt>
<dd><p class="first">name (str): the parameter name
value (int): an integer representing the default value for the</p>
<blockquote>
<div>parameter</div></blockquote>
<dl class="docutils">
<dt>is_literal (bool): if True, the parameter’s value will</dt>
<dd>be stored as is. Else, it will be stored in a variable whose value
can be changed.</dd>
</dl>
<p class="last"><a href="#id1"><span class="problematic" id="id2">**</span></a>kwargs (dict): kwargs for the creation of the Dummy</p>
</dd>
<dt>Returns:</dt>
<dd>The newly added parameter</dd>
<dt>Raises:</dt>
<dd>KeyError: A parameter called name has already been created
ValueError: Invalid characters in name</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.all_parameters">
<code class="descname">all_parameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.all_parameters" title="Permalink to this definition">¶</a></dt>
<dd><p><a href="#id3"><span class="problematic" id="id4">**</span></a><a href="#id5"><span class="problematic" id="id6">*</span></a>SHOULD THIS BE INCLUDED TO AVOID ENCAPSULATION VIOLATION?</p>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.check_constraints">
<code class="descname">check_constraints</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.check_constraints" title="Permalink to this definition">¶</a></dt>
<dd><p>Verifies that all constraints are satisfied</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>None</dd>
<dt>Returns:</dt>
<dd>True if the constraints are all satisfied, false otherwise</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.del_constraint">
<code class="descname">del_constraint</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.del_constraint" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes the constraint with the given name</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>name (str): the constraint name</dd>
<dt>Returns:</dt>
<dd>The removed constraint with the given name</dd>
<dt>Raises:</dt>
<dd>KeyError: A constraint called name does not exist</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.del_parameter">
<code class="descname">del_parameter</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.del_parameter" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes the parameter with the given name</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>name (str): the parameter name</dd>
<dt>Returns:</dt>
<dd>The removed parameter with the given name</dd>
<dt>Raises:</dt>
<dd>KeyError: A parameter called name does not exist</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.get_constraints">
<code class="descname">get_constraints</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.get_constraints" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets all the constraints associated with the parameterized object</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>None</dd>
<dt>Returns:</dt>
<dd>A list containing all constraint expressions</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.get_name">
<code class="descname">get_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.get_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the name of the parameterized object.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>None</dd>
<dt>Returns:</dt>
<dd>A str representation of the object’s name</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.get_parameter">
<code class="descname">get_parameter</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.get_parameter" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieves the parameter with the given name</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>name (str): the parameter name</dd>
<dt>Returns:</dt>
<dd>The parameter with the given name</dd>
<dt>Raises:</dt>
<dd>KeyError: A parameter called name does not exist or is uninitialized</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.inherit_parameters">
<code class="descname">inherit_parameters</code><span class="sig-paren">(</span><em>other</em>, <em>prefix</em><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.inherit_parameters" title="Permalink to this definition">¶</a></dt>
<dd><p>Adds parameters from another parameterized object to the current object</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><dl class="first last docutils">
<dt>other (Parameterized): the parameterized object to inherit</dt>
<dd>parameters from</dd>
<dt>prefix (str): a prefix string to be added to the name of inherited</dt>
<dd>parameters</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.set_name">
<code class="descname">set_name</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.set_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the name of the parameterized object.</p>
<dl class="docutils">
<dt>Args:</dt>
<dd>name (str): the new object name</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.set_parameter">
<code class="descname">set_parameter</code><span class="sig-paren">(</span><em>name</em>, <em>value</em>, <em>force_literal=False</em><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.set_parameter" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets either the value of the object associated with the parameter,
or associated object itself</p>
<dl class="docutils">
<dt>Args:</dt>
<dd><p class="first">name (str): the parameter name
value (int): an integer representing the default value for the</p>
<blockquote>
<div>parameter</div></blockquote>
<p class="last">force_literal (bool): if True, object associated with the parameter
will be replaced by value. Otherwise, the value of the object will
be attempted to be changed</p>
</dd>
<dt>Returns:</dt>
<dd>The newly modified parameter</dd>
<dt>Raises:</dt>
<dd>KeyError: A parameter called name does not exist
ValueError: Old parameter value is a constant and cannot be changed</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="api.parameterized.Parameterized.solve">
<code class="descname">solve</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#api.parameterized.Parameterized.solve" title="Permalink to this definition">¶</a></dt>
<dd><p>Performs the solving that is necessary</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="code.html"
title="previous chapter">roco.api</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="component.html"
title="next chapter">Component</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/parameterized.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</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="component.html" title="Component"
>next</a> |</li>
<li class="right" >
<a href="code.html" title="roco.api"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">roco 1.0 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="code.html" >roco.api</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2017, Gopi Suresh, Ahmed Allibhoy, Christian Warloe, Prathyush Katukojwala.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.2.
</div>
</body>
</html>