Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class mapGenerator
- {
- // used to change the link for dynamic results
- public static double[] changeLink(double first, double second){
- double temp[] = new double[2];
- first = first + 0.2 ; // increment to 2
- second = second + 0.1; // increment to 1
- first = Math.round(first * 100) / 100.0;
- second = Math.round(second * 100) / 100.0;
- temp[0] = first;
- temp[1] = second;
- return temp;
- }
- public static void main(String args[]) throws IOException
- {
- double k, b;
- k = 0.0;
- b = 0.0;
- for(int j=0; j <10; j++){
- double tempArray[] = changeLink(k, b);
- k = tempArray[0];
- b = tempArray[1];
- PrintWriter writer = new PrintWriter("MAPresults" + j+ ".csv");
- Process proc = Runtime.getRuntime().exec("/users/case4/ruitern2/Documents/ca4009/trec_eval.9.0/trec_eval /users/case4/ruitern2/Documents/ca4009/trec_eval.9.0/qrels.trec678.adhoc TREC_6_k_"+ k +"b_"+ b +"_results.csv");
- InputStream stdin = proc.getInputStream();
- InputStreamReader isr = new InputStreamReader(stdin);
- BufferedReader br = new BufferedReader(isr);
- String line = null;
- System.out.println(line);
- while ( (line = br.readLine()) != null){
- writer.println(line);
- System.out.println(line);
- writer.flush();
- }
- writer.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement