00001 // Detector.h: interface for the Detector class. 00002 // 00004 00005 #if !defined(AFX_DETECTOR_H__338D3ED7_2EE5_4DD1_9434_3E210AB4E60C__INCLUDED_) 00006 #define AFX_DETECTOR_H__338D3ED7_2EE5_4DD1_9434_3E210AB4E60C__INCLUDED_ 00007 00008 #if _MSC_VER > 1000 00009 #pragma once 00010 #endif // _MSC_VER > 1000 00011 00012 #include "stdafx.h" 00013 #include <string> 00014 #include <fstream> 00015 #include <vector> 00016 #include "Truck.h" 00017 #include "Car.h" 00018 00021 class Detector 00022 { 00023 public: 00024 bool getDirPos(); 00025 Detector(); 00026 virtual ~Detector(); 00027 00028 virtual void EndOutput() {}; 00029 virtual void addVehicle(Vehicle* pVeh, double curTime) {}; 00030 00031 void CheckForOutputTime(double step); 00032 int getLocation(); 00033 WORD getDetectorType(); 00034 00035 protected: 00036 virtual void InitOutputFiles() {}; 00037 virtual void doIntervalOutput() {}; 00038 virtual void ReInit() {}; 00039 00040 std::string MapDirToString(bool DirPos); 00041 std::string MapDetVehTypeToString(WORD VehType); 00042 double FindDetectorArrivalTime(Vehicle* pVeh, const double curTime); 00043 00044 WORD m_DetectorType; 00045 int m_RoadLength; 00046 bool m_DirPos; 00047 int m_Location; 00048 int m_NoLanes; 00049 WORD m_VehicleType; 00050 double m_CurrentTime; 00051 double m_TotalTime; 00052 double m_TimeInterval; 00053 int m_IntervalNo; 00054 std::vector<Vehicle*> m_vVehicles; 00055 std::string m_MetricsDir; 00056 00057 }; 00058 00059 #endif // !defined(AFX_DETECTOR_H__338D3ED7_2EE5_4DD1_9434_3E210AB4E60C__INCLUDED_)