00001 #ifndef _SIM_H 00002 #define _SIM_H 00003 00004 #include "stdafx.h" 00005 #include "Direction.h" 00006 #include "Road.h" 00007 #include <vector> 00008 #include <iostream> 00009 #include <fstream> 00010 #include <string> 00011 00012 using namespace std; 00013 00014 typedef std::vector< std::vector<Vehicle*> > M2D; 00015 00018 class Sim { 00019 00020 public: 00021 void clear(); 00022 bool doFullSimulation(); 00023 void setFileIn(string file); 00024 void setFileOut(string file); 00025 void setFileType(WORD fileType); 00026 void setNoLanesDirPos(int nlpos); 00027 void setNoLanesDirNeg(int nlneg); 00028 void setSimTimeStep(double ts); 00029 void setNoDirections(int nd); 00030 void setNoLanes(int nl); 00031 void setRoadLength(int L); 00032 00033 double getCurrentSimTime(); 00034 int getPercentComplete(); 00035 00036 Road* getRoad(); 00037 00038 double getRoadLength(); 00039 M2D getPositions(); 00040 M2D doOneTimeStep(bool* pInSimulation); 00041 void init(); 00042 Sim(); 00043 virtual ~Sim(); 00044 00045 private: 00046 double m_CurrentSimTime; 00047 Road m_Road; 00048 M2D m_vVehicles; 00049 string m_FileIn; 00050 string m_FileOut; 00051 WORD m_FileType; 00052 int m_NoLanesDirPos; 00053 int m_NoLanesDirNeg; 00054 double m_SimTimeStep; 00055 int m_NoDirections; 00056 int m_NoLanes; 00057 int m_RoadLength; 00058 int m_PercentComplete; 00059 }; 00060 #endif