Example #1
0
 def mapTrajectory(self, tspots, **param):
   # Creating an update of all the parameters, if necessary.
   full_params = dict(self.default_params.items()+param.items())
   c_tspots = completeTSpots (tspots, self.network)
   seqs = [detect_stops.detect_mode(c_tspot, self.network, **full_params)
           for c_tspot in c_tspots]
   return [model.toTrajectoryObservation(seq) for seq in seqs if seq is not None]
Example #2
0
 def mapTrajectory(self, tspots, **param):
   groups = seqGroupBy(tspots, keyf=lambda tsp:tsp.spot.linkId)
   ttob_seqs = completeGroups(groups, self.network)
   seqs = [[(ttob.linkId, self.learned_mixtures[ttob.linkId].assignment(ttob.tt),
             float(ttob.tt))
            for ttob in ttob_seq] for ttob_seq in ttob_seqs]
   return [model.toTrajectoryObservation(seq) for seq in seqs]
 def ttObservationToTrajObservation(self, ttob_seq):
   # pylint:disable=E1101
   seq = [(ttob.linkId, self.learned_mixtures[ttob.linkId].assignment(ttob.tt), float(ttob.tt)) for ttob in ttob_seq]
   return simple_model.toTrajectoryObservation(seq)