public static void main(String[] args){
		
		for(int fileCacheSize = 1; fileCacheSize <= 50; fileCacheSize++){
				
			QuickMineSimulator simulator = new QuickMineSimulator(fileCacheSize);
			
			// 获取数据集
			List<String> logs = simulator.getDataSet("D://audit-interleaving.log", "/user/root/input/sogou/query-log-");
			
			// 生成关联规则：QuickMine 不需要预先生成关联规则
			
			// 模拟读取数据，利用关联规则提高Cache命中率
			int hitCount = 0;
			int prefetchCount = 0;
			long totalTime = 0;
			for(int i = 0; i< logs.size(); i++){
				
				String currentFile = logs.get(i);
				
				long start = System.nanoTime();
				String targetFile = simulator.getFileFromCache(currentFile);
				// Miss
				if(targetFile == null){		
					// read miss causes prediction
					for(String file: simulator.getPredictFiles(currentFile)){
						simulator.putFileIntoCache(file, file);
						prefetchCount++;
					}
				}
				// Hit
				else{
					hitCount++;
				}
				
				// generate new rules incrementally
				simulator.generateNewRule(currentFile);
				
				long end = System.nanoTime();
				
				totalTime += (end - start);
			}
			
			// 输出命中率
			// System.out.println("QuickMine Hit Ratio: " + (hitCount * 1.0 / logs.size()));
			System.out.println(hitCount * 1.0 / logs.size());
			// System.out.println(prefetchCount);
			// System.out.println(totalTime * 1.0 / logs.size() / 1000000);
		}
	}