Go to the documentation of this file.00001
00002 #include <cassert>
00003 #include <string>
00004 #include <map>
00005 #include <iostream>
00006 #include <sstream>
00007
00008 #include <test/trademgen/EventStream.hpp>
00009 #include <test/trademgen/CategoricalAttribute.hpp>
00010
00011
00012 int main (int argc, char* const argv[]) {
00013
00014 unsigned long int seed = 2;
00015
00016 if (argc >= 2) {
00017 std::istringstream iStream (argv[1]);
00018 iStream >> seed;
00019 }
00020
00021
00022 TRADEMGEN::EventStream e (seed);
00023 e.setKey("hello");
00024 e.setRate(2.0);
00025
00026
00027
00028 std::cout << "Seed: " << seed << std::endl << std::endl;
00029
00030
00031 for (int i=0; i<10; i++) {
00032 e.generateNext();
00033 }
00034
00035
00036 e.displayAllEvents(std::cout);
00037
00038
00039
00040
00041 std::map<int, float> M;
00042 M[1] = 0.1;
00043 M[17] = 0.7;
00044 M[77] = 0.2;
00045 TRADEMGEN::CategoricalAttribute C (M);
00046
00047 return 0;
00048 }