def runExperimentPathSet(self, pathNum, myTimeline=None): global speedMultiplier # speedMultipler = 1 # for ps in self.pathSets: print pathNum print len(self.pathSets) ps = self.pathSets[pathNum] if myTimeline != None: timeline = myTimeline else: timeline = self.timelines[pathNum] self.peopleset = [] newPs = PathSet() for personPath in ps.peoplePaths: p = people.a_person(speedMultiplier) p.custom_walk(personPath.getFullPath()) self.peopleset.append(p) tophat = people.a_person(speedMultiplier, 1) self.abe = tophat tophat.custom_walk(ps.abePath.getFullPath()) self.peopleset.append(tophat) self.starttime = viz.tick() self.errlist = [] self.timelist = [] # error_timer = vizact.ontimer(0.1/speedMultiplier,self.checkError,tophat,self.errlist) error_timer = vizact.onupdate(-10, self.checkError, tophat) yield self.runPathSet(self.peopleset, newPs, tophat, 1, timeline) vizact.removeEvent(error_timer)
def validatePathSet(self): global speedMultiplier # speedMultipler = 1 for ps in self.pathSets: peopleset = [] newPs = PathSet() print "num people", len(ps.peoplePaths) print "here1" for personPath in ps.peoplePaths: p = people.a_person(speedMultiplier) print "lencustompath:", len(personPath.getFullPath()) print personPath.getFullPath() p.custom_walk(personPath.getFullPath()) peopleset.append(p) print "here2" tophat = people.a_person(speedMultiplier, 1) self.abe = tophat tophat.custom_walk(ps.abePath.getFullPath()) print "here3" yield self.runPathSet(peopleset, newPs, tophat, 1) print "Checking Differences" print "num collisions: ", ps.collisions, ",", newPs.collisions print "quadrants reached: ", ps.quadrantsReached, ",", newPs.quadrantsReached print "points to which Abe walked: ", ps.pointsWalkedTo, ",", newPs.pointsWalkedTo print "avg. speed: ", ps.speed, ",", newPs.speed print "time not visible: ", ps.timeNotVisible, ",", newPs.timeNotVisible print "avg. num people nearby: ", ps.numberPeopleNearby, ",", newPs.numberPeopleNearby
def generateAndTestPathSet(self): global speedMultiplier print "I am in here" peopleset = [] # ps = PathSet() self.nextPath = PathSet() self.nextTimeline = TimelineGen.Timeline() for j in range(0, self.num_av): peopleset.append(people.a_person(speedMultiplier)) tophat = people.a_person(speedMultiplier, 1) self.abe = tophat # peopleset.append(tophat) tophat.custom_walk( [[[0.1, 0, 10], 2]] ) # , [[-10, 0, 10], 3], [[-10, 0, -10], 4], [[10, 0, -10], 5], [[10, 0, 10], 6]]) yield self.runPathSet(peopleset, self.nextPath, tophat, 0)