/* * makesf.cpp * * For the moment, simply generates a scale-free network of the desired * size and produces some statistics. * * For Math 164, Final Project * Written by Alex Popkin * Mar. 14, 2004 */ /* usage: * * ./makesf n * * n is the number of nodes in the network */ #include #include #include #include #include #include #include #include #include // For DBL_MAX #include using namespace std; #define SUSCEPTIBLE 1 #define INFECTED 2 #define IMMUNE 3 #include "node.hpp" #include "sf_network.hpp" // The main function for the program int main(int argc, char* argv[]) { if (argc != 7) { cout << "Usage: ./makesf n incr gens init g lambda" << endl; exit(1); } int V = atoi(argv[1]); int incr_ = atoi(argv[2]); int gens_ = atoi(argv[3]); int init1 = atoi(argv[4]); int g1 = atoi(argv[5]); int lambda1 = atoi(argv[6]); double init_ = (double) init1 / 1000; double g_ = (double) g1 / 1000; double lambda_ = (double) lambda1 / 1000; if (V < 5) { cout << "Minimum size 5 nodes. " << endl; exit(1); } SF_Network* theNet = new SF_Network(V, true); // theNet->epi(init_, g_, lambda_, gens_); theNet->printK(incr_); incr_++; delete theNet; return 0; } /* Junk to make emacs use the right C++ style when editing this code: * Local Variables: * c-file-style: "stroustrup" * End: */