def start_n1_situation(self, predicate, subject_name): description = predicate+"("+subject_name+")" sit = Situation(desc=description) sit.starttime = time.time() self.current_situations_map[description] = sit self.ros_pub["situation_log"].publish("START " + description) self.target.timeline.update(sit) return sit.id
def start_predicate(self, timeline, predicate, subject_name, object_name=None, isevent=False): if object_name is None: description = predicate + "(" + subject_name + ")" else: description = predicate + "(" + subject_name + "," + object_name + ")" sit = Situation(desc=description) sit.starttime = time.time() if isevent: sit.endtime = sit.starttime self.current_situations_map[description] = sit self.log_pub[predicate].publish("START " + description) timeline.update(sit) return sit.id
def start(self): """ Starts (and return) a new situation This method sends the new situation to the remote. IT DOES NOT DIRECTLY modify the local copy of situations: the roundtrip is slower, but data consistency is easier to ensure. Note that the situation starting time is set by the client, at the time at which this method is called. """ situation = Situation() situation.starttime = time.time() self.update(situation) return situation