Class performing a sample enumeration. More...
Public Member Functions | |
def | __init__ |
def | getExpression |
Public Attributes | |
theDict | |
iteratorName | |
operatorIndex |
Class performing a sample enumeration.
The concept of iterators (see the section "Iterators"), identifies a sequence such that, for each instance, the value of the variables is read from the data file, and an expression can be evaluated. In sample enumeration, expressions are computed for each instance in the sample and reported in a file. Example:
simulate = {'Prob. 1': P1, 'Prob. 2': P2, 'Util. 1': V1, 'Util. 2':V2, 'Diff. util.': V1-V2} rowIterator('obsIter') BIOGEME_OBJECT.SIMULATE = Enumerate(simulate,'obsIter')
Note that this expression is used exclusively for simulation. Contrarily to all other expressions, it does not return any value and, consequently, cannot be included in another expression. Something like
X + Enumerate(V,'obsIter') / 2
does not make any sense.
def bio_expression::Enumerate::__init__ | ( | self, | |
term, | |||
iteratorName | |||
) |
term | a dictionary (see Python documentation)) of the form
{label: expression, label: expression,...} where label is used to describe the results in the output file, and expression is a valid expression. |
iteratorName | name of an iterator already defined. |
def bio_expression::Enumerate::getExpression | ( | self ) |
Reimplemented from bio_expression::Expression.
Reimplemented from bio_expression::Expression.