/* * node.hpp * * Defines the interface for the Node class, which is an auxilliary * to be used by the SF_Network class. A node class represents one * vertex on the network, and contains a list of all the neighbors. It * may later also contains state data and other stuff. * * Written by Alex Popkin * For Math 164 Final Project, Spring 2004 * Mar 14, 2004 */ #ifndef NODE_HPP_INCLUDED #define NODE_HPP_INCLUDED 1 #include using namespace std; class Node { public: // Consructor simply sets the node's number Node(int my_id); // Destructor will delete the neighbors list and possibly other stuff ~Node(); // addEdge function, used by the sf_network class to create edges void addEdge(int new_); // getK returns the degree of this vertex int getK(); // getStatus returns the node's current status int getStatus(); // Functions for running immunization models; others may be added void cure(); // Not infected, become susceptible again void infect(); // Get infected void immunize(); // Prevent this node from becoming infected void suscept(); // Remove this node's immunity // Indicate which adjacent nodes have a chance of being infected void spread(bool* infArray); int id; // This node's id in the network int Htype; // Hub or not hub private: int status; // Infected, immune, or susceptible int degree; list edges; // All the edges incident on this vertex, rep as ints }; #endif // NODE_HPP_INCLUDED /* Junk to make emacs use the right C++ style when editing this code: * Local Variables: * c-file-style: "stroustrup" * End: */