public double getTopicFrequence(Topic topic, Consts.ActionType type, AtomicInteger number, Consts.TopicType topicType) {
		HashMap<Long, Long> bugCounter = new HashMap<Long, Long>();
		for (int j = 0; j < topic.getBehaviors().size(); j++) {
			
			Long myId;
			if (topicType == Consts.TopicType.BRAND) {
				myId = topic.getBehaviors().get(j).getUid();
			} else {
				myId = topic.getBehaviors().get(j).getBrandID();
			}
			
			if (topic.getBehaviors().get(j).getType() == type) {
				long num = 0;
				if (bugCounter.containsKey(myId)) {
					num = bugCounter.get(myId);
				}
				num++;
				bugCounter.put(myId, num);
			}
		}
		
		double frequence = 0.0;	
		number.set(0);
		Set<Long> set = bugCounter.keySet();
		Iterator<Long> it = set.iterator();
		while (it.hasNext()){
			number.set(number.get() + 1);;
			Long myId = (Long)it.next();
			frequence += bugCounter.get(myId);
	    }
		if (number.get() != 0) { 
			frequence = frequence / number.get() / monthNum;	
		}
		
		return frequence;
	}