Commit 1d240ae4 authored by pkda001's avatar pkda001

SimEngine now takes path to configuration file

parent 1aa44c0c
......@@ -50,60 +50,42 @@
using namespace libconfig;
int main(){
clock_t t1, t2, sim_run_time;
vector<string> patients_list;
auto cf = std::make_shared<Config>();
float sim_time_secs, sim_time_mins;
patients_list = get_global_patients("./config/simulation_scenario.cfg", cf);
/*
for(auto patient: patients_list) {
// start timer
t1 = clock();
//Simulation input : Name of patient
Simulation(patient);
//stop timer
t2 = clock();
sim_run_time = t2 - t1;
sim_time_secs = ((float)sim_run_time)/CLOCKS_PER_SEC;
sim_time_mins = sim_time_secs/60.0;
cout << "\nThe Simulation for " << patient;
cout << " took "<< sim_time_secs <<" seconds ";
cout <<"or " << sim_time_mins <<" minutes"<<endl;
int main(int argc, const char * argv[]){
if(argc < 2)
{
cout << "Error: must provide a configuration file";
cout << "Usage: ./clasim configfile";
}
else
{
clock_t t1, t2, sim_run_time;
vector<string> patients_list;
auto cf = std::make_shared<Config>();
float sim_time_secs, sim_time_mins;
*/
patients_list = get_global_patients(argv[1], cf);
t1 = clock();
Simulation("Jeff");
t2 = clock();
sim_run_time = t2 - t1;
sim_time_secs = ((float)sim_run_time)/CLOCKS_PER_SEC;
sim_time_mins = sim_time_secs/60.0;
cout << "\nThe Simulation for " << "Hassan";
cout << " took "<< sim_time_secs <<" seconds ";
cout <<"or " << sim_time_mins <<" minutes"<<endl;
for(auto patient: patients_list) {
// start timer
t1 = clock();
//Simulation input : Name of patient
Simulation(patient);
//stop timer
t2 = clock();
sim_run_time = t2 - t1;
sim_time_secs = ((float)sim_run_time)/CLOCKS_PER_SEC;
sim_time_mins = sim_time_secs/60.0;
cout << "\nThe Simulation for " << patient;
cout << " took "<< sim_time_secs <<" seconds ";
cout <<"or " << sim_time_mins <<" minutes"<<endl;
}
}
}
void Simulation(const string patient_name)
{
......
......@@ -50,56 +50,40 @@
using namespace libconfig;
int main(){
clock_t t1, t2, sim_run_time;
vector<string> patients_list;
auto cf = std::make_shared<Config>();
float sim_time_secs, sim_time_mins;
patients_list = get_global_patients("./config/simulation_scenario.cfg", cf);
/*
for(auto patient: patients_list) {
// start timer
t1 = clock();
//Simulation input : Name of patient
Simulation(patient);
//stop timer
t2 = clock();
sim_run_time = t2 - t1;
sim_time_secs = ((float)sim_run_time)/CLOCKS_PER_SEC;
sim_time_mins = sim_time_secs/60.0;
cout << "\nThe Simulation for " << patient;
cout << " took "<< sim_time_secs <<" seconds ";
cout <<"or " << sim_time_mins <<" minutes"<<endl;
int main(int argc, const char * argv[]){
if(argc < 2)
{
cout << "Error: must provide a configuration file";
cout << "Usage: ./clasim configfile";
}
else
{
clock_t t1, t2, sim_run_time;
vector<string> patients_list;
auto cf = std::make_shared<Config>();
float sim_time_secs, sim_time_mins;
*/
t1 = clock();
Simulation("ExtremeFemale");
t2 = clock();
patients_list = get_global_patients(argv[1], cf);
sim_run_time = t2 - t1;
sim_time_secs = ((float)sim_run_time)/CLOCKS_PER_SEC;
sim_time_mins = sim_time_secs/60.0;
cout << "\nThe Simulation for " << "Hassan";
cout << " took "<< sim_time_secs <<" seconds ";
cout <<"or " << sim_time_mins <<" minutes"<<endl;
for(auto patient: patients_list) {
// start timer
t1 = clock();
//Simulation input : Name of patient
Simulation(patient);
//stop timer
t2 = clock();
sim_run_time = t2 - t1;
sim_time_secs = ((float)sim_run_time)/CLOCKS_PER_SEC;
sim_time_mins = sim_time_secs/60.0;
cout << "\nThe Simulation for " << patient;
cout << " took "<< sim_time_secs <<" seconds ";
cout <<"or " << sim_time_mins <<" minutes"<<endl;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment