Guest User

Untitled

a guest
Feb 20th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. #include <math.h>
  5. #include "lib/randlibRMI.h"
  6.  
  7. #define MAX_ITERATIONS 1000
  8.  
  9. using namespace std;
  10.  
  11. int main(int argc, char *argv[])
  12. {
  13. int i;
  14. float min, max, ml, confidence;
  15. bool debug = true;
  16. string dir, filename;
  17. FILE *fp;
  18.  
  19. dir = "/home/sneaky/source/RMI/IRMA/public/report/";
  20.  
  21. min = atof(argv[1]);
  22. max = atof(argv[2]);
  23. ml = atof(argv[3]);
  24. confidence = atof(argv[4]);
  25. filename = dir + argv[5];
  26.  
  27. if(debug == true) {
  28. cout << endl << "[*] -- Running Simulation..." << endl;
  29. cout << "[*] -- Using Values [" << min << " " << max << " " << ml << " " << confidence << "]";
  30. }
  31.  
  32. if ((fp = fopen(filename.c_str(), "w")) != NULL)
  33. {
  34. for (i = 0; i < MAX_ITERATIONS; i++)
  35. {
  36. fprintf(fp, "%f,%f,%f,", genLocScaleBeta(min, max, ml, confidence),
  37. min + (max - min) * (float(i) / MAX_ITERATIONS),
  38. densLocScaleBeta(min + (max - min) * (float(i) / MAX_ITERATIONS), min, max, ml, confidence));
  39. fprintf(fp, "%d,%d,%f\n", genLocScaleBetaDisc(min, max, ml, confidence),
  40. (int)round(min + (max - min) * (float(i) / MAX_ITERATIONS)),
  41. densLocScaleBetaDisc((int)round(min + (max - min) * (float(i) / MAX_ITERATIONS)), min, max, ml, confidence));
  42. }
  43. fclose(fp);
  44. }
  45.  
  46. if(debug == true) {
  47. cout << endl << "[*] -- Writing Results To " << filename.c_str();
  48. cout << endl << "[*] -- Test Completed Successfully" << endl << endl;
  49. }
  50.  
  51. return 0;
  52. }
Add Comment
Please, Sign In to add comment