Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cstdlib>
- #include <math.h>
- #include "lib/randlibRMI.h"
- #define MAX_ITERATIONS 1000
- using namespace std;
- int main(int argc, char *argv[])
- {
- int i;
- float min, max, ml, confidence;
- bool debug = true;
- string dir, filename;
- FILE *fp;
- dir = "/home/sneaky/source/RMI/IRMA/public/report/";
- min = atof(argv[1]);
- max = atof(argv[2]);
- ml = atof(argv[3]);
- confidence = atof(argv[4]);
- filename = dir + argv[5];
- if(debug == true) {
- cout << endl << "[*] -- Running Simulation..." << endl;
- cout << "[*] -- Using Values [" << min << " " << max << " " << ml << " " << confidence << "]";
- }
- if ((fp = fopen(filename.c_str(), "w")) != NULL)
- {
- for (i = 0; i < MAX_ITERATIONS; i++)
- {
- fprintf(fp, "%f,%f,%f,", genLocScaleBeta(min, max, ml, confidence),
- min + (max - min) * (float(i) / MAX_ITERATIONS),
- densLocScaleBeta(min + (max - min) * (float(i) / MAX_ITERATIONS), min, max, ml, confidence));
- fprintf(fp, "%d,%d,%f\n", genLocScaleBetaDisc(min, max, ml, confidence),
- (int)round(min + (max - min) * (float(i) / MAX_ITERATIONS)),
- densLocScaleBetaDisc((int)round(min + (max - min) * (float(i) / MAX_ITERATIONS)), min, max, ml, confidence));
- }
- fclose(fp);
- }
- if(debug == true) {
- cout << endl << "[*] -- Writing Results To " << filename.c_str();
- cout << endl << "[*] -- Test Completed Successfully" << endl << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment