Mercurial Hosting > traffic-intelligence
comparison trafficintelligence/iframework.py @ 1175:35725db5e83f
naming changed for framework
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Mon, 10 Jan 2022 11:14:37 -0500 |
parents | c1766bb5076c |
children | c4c50678c856 |
comparison
equal
deleted
inserted
replaced
1174:2f89dc3d99e5 | 1175:35725db5e83f |
---|---|
165 def addPoint(self, x, y): | 165 def addPoint(self, x, y): |
166 self.points.append(Point(x, y)) | 166 self.points.append(Point(x, y)) |
167 | 167 |
168 class AbstractCrossing: | 168 class AbstractCrossing: |
169 def initPersonGroupCrossing(self, group, person, modeName, vehicle): | 169 def initPersonGroupCrossing(self, group, person, modeName, vehicle): |
170 ''' initiates with the passing the group or person | 170 ''' initiates with the crossing the group or person |
171 | 171 |
172 design question: what should be done about simple line counting, | 172 design question: what should be done about simple line counting, |
173 without information about persons''' | 173 without information about persons''' |
174 if person is None and group is not None: # create group | 174 if person is None and group is not None: # create group |
175 self.group = group | 175 self.group = group |
178 elif person is not None and group is None: # create person | 178 elif person is not None and group is None: # create person |
179 self.group = Group([person]) | 179 self.group = Group([person]) |
180 if modeName is not None: | 180 if modeName is not None: |
181 Mode(modeName, person, vehicle) | 181 Mode(modeName, person, vehicle) |
182 else: | 182 else: |
183 print('Warning: passing person and group or both None') | 183 print('Warning: crossing person and group or both None') |
184 | 184 |
185 class LineCrossing(AbstractCrossing,Base): | 185 class LineCrossing(AbstractCrossing,Base): |
186 __tablename__ = 'linepassings' | 186 __tablename__ = 'linecrossings' # formerly 'linepassings' |
187 idx = Column(Integer, primary_key=True) | 187 idx = Column(Integer, primary_key=True) |
188 lineIdx = Column(Integer, ForeignKey('lines.idx')) | 188 lineIdx = Column(Integer, ForeignKey('lines.idx')) |
189 groupIdx = Column(Integer, ForeignKey('groups.idx')) | 189 groupIdx = Column(Integer, ForeignKey('groups.idx')) |
190 pointIdx = Column(Integer, ForeignKey('points.idx')) | 190 pointIdx = Column(Integer, ForeignKey('points.idx')) |
191 instant = Column(DateTime) | 191 instant = Column(DateTime) |