private void generateTraffic() {
		if((Config.debugMode() && m_msgIdCount == Config.maxMsgs() && Config.maxMsgs() > 0) ||
				(Config.runMode() && Simulator.draining()))
			return;
		
		if(Config.traffic().equals(TrafficType.TRACE)) {
			// Take all of the pending trace events for this clock cycle
			for(Iterator<TraceEvent> it = m_pendingEvents.iterator(); it.hasNext();) {
				TraceEvent e = (TraceEvent) it.next();
				if(e.clock == Simulator.clock()) {
					generatePacket(e.dest, e.burst);
					it.remove();
				} else {
					break;
				}
			}
		} else {
			// Use a traffic pattern generation function
			int node = Traffic.getDest(m_nodeId, Simulator.numNodes());
			int pktLen = Injection.getPacketLen(m_nodeId);
			if(pktLen > 0) {
				generatePacket(node, pktLen);
			}
		}
	}