SpherePackingScenarioGenerator
|
00001 #ifndef Event_H 00002 #define Event_H 00003 00004 #include "Vector.h" 00005 namespace algorithms{ 00006 namespace ls{ 00007 class Event; 00008 } 00009 } 00010 #define INF 100000000 00011 #define dblINF 100000000. 00012 00015 class algorithms::ls::Event { 00016 00017 public: 00022 Event(double time_i, int i_i, int j_i, Vector<DIM,int> v_i); 00026 Event(double time_i, int i_i, int j_i); 00030 Event(const Event& e); 00034 Event(); 00039 ~Event(); 00040 //friend class Box; 00044 bool operator<(const Event&) const; 00048 bool operator>(const Event&) const; 00052 void erase(); 00053 //by Tan 00054 double getTime(); 00055 void setTime(double time); 00056 int getCollisionPartnerI(); 00057 void setCollisionPartnerI(int i); 00058 int getCollisionPartnerJ(); 00059 void setCollisionPartnerJ(int j); 00060 Vector<DIM,int> getVector(); 00061 void setVector(Vector<DIM,int> v); 00062 00063 private: 00064 00068 double time; 00072 int i; 00076 int j; 00080 Vector<DIM,int> v; 00081 00082 /* 0<=j<=N binary collision between i and j 00083 j=N+DIM+1+x transfer where x=-(k+1) for left wall 00084 and x=k+1 for right wall 00085 j=INF both check after Event that did not altered motion of i and check after Event that altered motion of i, i.e rescaling of velocities. I currently don't see need t o separate the two 00086 00087 j=-1 check after collision 00088 00089 Virtual identifiers as scalars...I think bad idea, but here's my work 00090 there will be easily fixed problems if DIM>=10 00091 -x<=v<=x x=k+1, image in k direction 00092 v=xy x,y 00093 =-xy -x,y 00094 =-yx x,-y 00095 =yx -x,-y 00096 v=xyz x,y,z 00097 =-xyz -x,y,z 00098 =-yxz x,-y,z 00099 =-zxy x,y,-z 00100 =zyx -x,-y,z 00101 =xzy x,-y,-z 00102 =yzx -x,y,-z 00103 =-zyx -x,-y,-z 00104 */ 00105 00106 }; 00107 00108 #endif