Esempio n. 1
0
	def receive(self, src, msg):
		m = SerialMsg(msg.dataGet())
		
		self.num_nodes = m.get_num_nodes()
		self.num_rounds = m.get_num_rounds()
		self.num_transmissions = m.get_num_transmissions()
		print '%s Message Received:' % time.strftime(self.timeformat)
		print '\tK\tRounds\tTransmissions'
		logstring = '%d\t%d\t%d' % (self.num_nodes, self.num_rounds, self.num_transmissions)
		print '\t%s' % logstring
		lf = open(self.logfile, 'a')
		lf.write(logstring)
		lf.write('\n')
		lf.close()