Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
*** empty log message ***
[simgrid.git] / src / surf / gtnets / gtnets_simulator.h
1 //Kayo Fujiwara 1/8/2007
2
3 #ifndef _GTNETS_SIM_H
4 #define _GTNETS_SIM_H
5
6 #ifdef __cplusplus
7 #include "gtnets_topology.h"
8
9 #include <iostream>
10 #include <sys/wait.h>
11 #include <map>
12
13 //GTNetS include files
14 #include "simulator.h"      // Definitions for the Simulator Object
15 #include "node.h"           // Definitions for the Node Object
16 #include "linkp2p.h"        // Definitions for point-to-point link objects
17 #include "ratetimeparse.h"  // Definitions for Rate and Time objects
18 #include "application-tcpserver.h" // Definitions for TCPServer application
19 #include "application-tcpsend.h"   // Definitions for TCP Sending application
20 #include "tcp-tahoe.h"      // Definitions for TCP Tahoe
21 #include "tcp-reno.h"
22 #include "tcp-newreno.h"
23 #include "validation.h"
24 #include "event.h"
25
26 using namespace std;
27
28 //Simulator s;
29 class GTSim {
30
31 public:
32   GTSim();
33   ~GTSim();
34 public:   
35   int add_link(int id, double bandwidth, double latency);
36   int add_route(int src, int dst, int* links, int nlink);
37   int create_flow(int src, int dst, long datasize, void* metadata);
38   double get_time_to_next_flow_completion();
39   int run_until_next_flow_completion(void*** metadata, int* number_of_flows);
40   int run(double deltat);
41   int finalize();
42
43   void create_gtnets_topology();
44 private:
45   Simulator* sim_;
46   SGTopology* topo_;
47   int nnode_;
48   int is_topology_;
49   int nflow_;
50
51   map<int, Linkp2p*>   gtnets_links_;
52   map<int, Node*>      gtnets_nodes_;
53   map<int, TCPServer*> gtnets_servers_;
54   map<int, TCPSend*>   gtnets_clients_;
55   map<int, SGLink*>    tmp_links_;
56   map<int, int>        gtnets_hosts_; //<hostid, nodeid>
57   map<int, void*>      gtnets_metadata_;
58 };
59
60 #endif /* __cplusplus */
61
62 #endif
63
64