//-------------------------------------------------------------------- // gen.h // ----- // Defined: TGenerator // // Moving point workload generator v 1.1 // Copyright(c) 1999-2001, Aalborg University // #ifndef __GEN_H #define __GEN_H #include #include "params.h" #include "pool.h" #define GEN_MAXSPEEDS 5 #define GEN_MINSP 10 // minimum speed of the object is maxspeed * 1 / GEN_MINSP #define GEN_ACCPART 6 // 1 / GEN_ACCPART part of the segment between to hubs // is for acceleration (deceleration) extern bool gen_binary; //------------------------------------------------------------------- class TGenerator { public: TGenerator (TParams& params); ~TGenerator (); void Generate (); private: void GenerateLoad (); void UpdatePoint (float CT, bool newobj = false, bool init = false); void GenerateQueries (float CT); void GenerateRandomV (TMovingPoint* point); void OutLoadPoint (TMovingPoint& key); char table_name[30]; int load; // If there is a separate load file generated // 0 - no load, a series of insertions at time 0 // 1 - load, 2 - no load, gradual population of index int threeD; // 0, 2 - 2D data, 3 - 3D data, 1 - 1D data long points; // Total number of moving points long hubs; // Number of "airports" double newObjects; // 0 - no new objs introduced, 1 - objs are replaced once, etc. double total; // Length of the simulation in time units long totalOp; // Length of the simulation in operations (insertions) double updateInterval; // Average interval between two successive updates of object // If 0 - no updates are generated at all double spaceX; // Dimensions of the "airspace" double spaceY; double spaceZ; double speeds[GEN_MAXSPEEDS]; // Possible speeds of moving objects long numObjTypes; double altitudes[GEN_MAXSPEEDS]; // Possible altitudes of moving objects double qInterval; // Interval between query generation events long qIntervalOp; // Interval between query generation events in insertions long qQuantity; // Number of queries generated at each query generation event double qWindow; // W - Querying time window double qSize; // Avg. size of spatial part of a query (fraction of "airspace") double qTSize; // Size of a temporal query window (For type 2 and 3 queries) double qType1; // Parts of different types of queries in a query mix double qType2; double qType3; double tref; // Reference time double noIntOp; // new object introduction interval (in operations) long maxID; // maximum obj. id used so far ofstream sqlf; // generated "sql" file ofstream datf; // generated "dat" file for loading TPool* pool; // a pool of moving points THub* cities; // a pool of hubs }; #endif