private static void genVisits(int noVisits, int noDocs, String path) {

		Random rand = new Random(Calendar.getInstance().getTimeInMillis());

		try (BufferedWriter fw = new BufferedWriter(new FileWriter(path))) {
			for (int i = 0; i < noVisits; i++) {

				int year = 2000 + rand.nextInt(10); // yearFilter 3
				int month = rand.nextInt(12) + 1; // month between 1 and 12
				int day = rand.nextInt(27) + 1; // day between 1 and 28

				// IP address
				StringBuilder visit = new StringBuilder(rand.nextInt(256) + "."
						+ rand.nextInt(256) + "." + rand.nextInt(256) + "."
						+ rand.nextInt(256) + "|");
				// URL
				visit.append("url_" + rand.nextInt(noDocs) + "|");
				// Date (format: YYYY-MM-DD)
				visit.append(year + "-" + month + "-" + day + "|");
				// Miscellaneous data, e.g. User-Agent
				visit.append("0.12|Mozilla Firefox 3.1|de|de|Nothing special|124|\n");

				fw.write(visit.toString());
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
private static void genVisits ( int noVisits , int noDocs , String path ) { Random rand = new Random ( Calendar . getInstance ( ) . getTimeInMillis ( ) ) ; try ( BufferedWriter fw = new BufferedWriter ( new FileWriter ( path ) ) ) { for ( int i = 0 ; i < noVisits ; i ++ ) { int year = 2000 + rand . nextInt ( 10 ) ; int month = rand . nextInt ( 12 ) + 1 ; int day = rand . nextInt ( 27 ) + 1 ; StringBuilder visit = new StringBuilder ( rand . nextInt ( 256 ) + "." + rand . nextInt ( 256 ) + "." + rand . nextInt ( 256 ) + "." + rand . nextInt ( 256 ) + "|" ) ; visit . append ( "url_" + rand . nextInt ( noDocs ) + "|" ) ; visit . append ( year + "-" + month + "-" + day + "|" ) ; visit . append ( "0.12|Mozilla Firefox 3.1|de|de|Nothing special|124|\n" ) ; fw . write ( visit . toString ( ) ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } }
Generates the files for the visits relation. The visits entries apply the
following format:<br />
<code>IP Address | URL | Date (YYYY-MM-DD) | Misc. Data (e.g. User-Agent) |\n</code>

@param noVisits
Number of entries for the visits relation
@param noDocs
Number of entries in the documents relation
@param path
Output path for the visits relation