/////class event
#include <queue>
class event
{
public:
	event(unsigned long t);
	const unsigned long time;
	virtual void processEvent()=0;
	virtual ~event(){};
};

bool operator>(const event& left,const event& right);

class comp_event
{
public:
	bool operator()(const event* x,const event* y) const
	{
		return (*x > *y);
	}
};

///////class simulation

class simulation
{
public:
	simulation();
	void run();
	unsigned long currentTime() const;
	void set_max_time(unsigned long);
	unsigned long get_max_time(){return max_run_time;};
	void scheduleEvent(event*);
	bool done;
protected:
	std::priority_queue<event*,std::vector<event*>,comp_event> eventQueue;
	unsigned long time;
	unsigned long max_run_time;
};



