Biogeme: Python Library  4.6a
bio_iterator.py
Go to the documentation of this file.
1 
5 
6 
7 listOfIterator = []
8 
9 
23 class iterator:
24  # @param iteratorName Name of the iterator.
25  # @param name Name of the set of data that is being iterated. It is either the name of a metaiterator, or the string __dataFile__, when the iterator spans the entire database.
26  # @param child Name of the child
27  # @param variable Variable that contains the ID of the elements being iterated.
28  def __init__(self,iteratorName,name,child,variable):
29  self.iteratorName = iteratorName
30  self.name = name
31  self.child = child
32  self.variable = variable
33  listOfIterator.append(self) ;
34 
35  def __str__(self):
36  return "Iterator " + str(self.name) + " iterates on " + str(self.variable)
37 
38 
46 
50  def __init__(self,iteratorName,name="__dataFile__",child="",variable="__rowId__"):
51  msg = 'Deprecated syntax. No need to define a draw iterator anymore. Just remove the statement, and use the operator MonteCarlo instead of Sum.'
52  raise SyntaxError(msg)
53 
54 
77 
81  def __init__(self,iteratorName,name,child,variable):
82  iterator.__init__(self,iteratorName,name,child,variable)
83  self.type = 'META'
84 
93 
97  def __init__(self,iteratorName,name="__dataFile__",child="",variable="__rowId__"):
98  iterator.__init__(self,iteratorName,name,child,variable)
99  self.type = 'ROW'
def __init__(self, iteratorName, name="__dataFile__", child="", variable="__rowId__")
Definition: bio_iterator.py:50
Iterates on the data file for generate the user defined draws (since biogeme 2.4) ...
Definition: bio_iterator.py:45
def __init__(self, iteratorName, name, child, variable)
Definition: bio_iterator.py:81
row iterators are designed to iterate on rows of the data file.
Definition: bio_iterator.py:92
meta iterators are designed to iterate on group of rows of the data file.
Definition: bio_iterator.py:76
Generic class for an iterator.
Definition: bio_iterator.py:23
def __init__(self, iteratorName, name="__dataFile__", child="", variable="__rowId__")
Definition: bio_iterator.py:97
Copyright 2017 Michel Bierlaire