// Run the program
-void run(RunParameters &r, unsigned seed) {
+void run(RunParameters_SS &r, unsigned seed) {
// Initialize RNG and set initial state, if importing from file
EpitopeHamiltonian H(r.couplingsInfile);
double penalty = 0.0;
- if (r.penaltyType == RunParameters::PenaltyEACH)
+ if (r.penaltyType == RunParameters_SS::PenaltyEACH)
penalty = r.penalty;
- else if (r.penaltyType == RunParameters::PenaltyTOTAL)
+ else if (r.penaltyType == RunParameters_SS::PenaltyTOTAL)
penalty = r.penalty / (double)r.numEpitopes;
for (unsigned ep=0; ep<r.numEpitopes; ++ep) {
H.set_epitope(r.eWT[ep], r.eMut[ep], penalty);
// Import initial state from a state file
-void importState(RunParameters &r) {
+void importState(RunParameters_SS &r) {
FILE *input=fopen(r.stateInfile.c_str(),"r"); // <infile>.st
if (input == NULL) { perror((std::string("ERROR in importState: ") + r.stateInfile).c_str()); exit(1); }
// load epitope definitions from file
-void importEpitope(RunParameters &r) {
+void importEpitope(RunParameters_SS &r) {
std::ifstream input(r.epitopeInfile.c_str()); // <infile>.ep
if (!input) { perror((std::string("ERROR in importEpitope: ") + r.epitopeInfile).c_str()); exit(1); }
// insert into initial state of population
-void add_to_two_site_pop(RunParameters &r, bool s1, bool s2, double frac) {
+void add_to_two_site_pop(RunParameters_SS &r, bool s1, bool s2, double frac) {
r.initFrac.push_back(frac);
int main(int argc, char *argv[]) {
- RunParameters r;
+ RunParameters_SS r;
unsigned seed = sim_random_seed();
else if (strcmp(argv[i],"-bh")==0) { if (++i==argc) break; else r.bh=strtodouble(argv[i]); }
else if (strcmp(argv[i],"-bJ")==0) { if (++i==argc) break; else r.bJ=strtodouble(argv[i]); }
- else if (strcmp(argv[i],"-penaltyEach")==0) { if (++i==argc) break; else { r.penalty=strtodouble(argv[i]); r.penaltyType=RunParameters::PenaltyEACH; } }
- else if (strcmp(argv[i],"-penaltyTotal")==0) { if (++i==argc) break; else { r.penalty=strtodouble(argv[i]); r.penaltyType=RunParameters::PenaltyTOTAL; } }
+ else if (strcmp(argv[i],"-penaltyEach")==0) { if (++i==argc) break; else { r.penalty=strtodouble(argv[i]); r.penaltyType=RunParameters_SS::PenaltyEACH; } }
+ else if (strcmp(argv[i],"-penaltyTotal")==0) { if (++i==argc) break; else { r.penalty=strtodouble(argv[i]); r.penaltyType=RunParameters_SS::PenaltyTOTAL; } }
else if (strcmp(argv[i],"-r")==0) { r.useRelative=true; }
else if (strcmp(argv[i],"-esc")==0) { r.runUntilEscape=true; }
// This class holds the parameters needed for running the simulation
-class RunParameters {
+class RunParameters_SS {
public:
PenaltyTYPE penaltyType;
- RunParameters() {
+ RunParameters_SS() {
directory="";
//printf("%s\n%s\n%s\n",couplingsInfile.c_str(),trajectoryOutfile.c_str(),stateInfile.c_str());
}
- ~RunParameters() {}
+ ~RunParameters_SS() {}
};
-void run(RunParameters &r);
-void importState(RunParameters &r);
-void importEpitope(RunParameters &r);
+void run(RunParameters_SS &r);
+void importState(RunParameters_SS &r);
+void importEpitope(RunParameters_SS &r);
#endif