OverSim
ConnectivityProbe.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 Institut fuer Telematik, Universitaet Karlsruhe (TH)
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 //
18 
24 #ifndef __CONNECTIVITYPROBE_H__
25 #define __CONNECTIVITYPROBE_H__
26 
27 #include <omnetpp.h>
28 #include <NodeHandle.h>
29 #include <VastDefs.h>
30 //#include <NeighborsList.h>
31 #include <Vast.h>
32 #include <fstream>
33 #include <sstream>
34 #include "GlobalStatisticsAccess.h"
35 
36 //typedef std::set<NodeHandle> NodeSet;
37 
39 {
40  public:
42  Vast* getModule() const;
43 
44  bool visited;
45  int moduleID;
46 };
47 
48 typedef std::map<OverlayKey, VTopologyNode> VTopology;
49 
50 class ConnectivityProbe : public cSimpleModule
51 {
52  public:
53  void initialize();
54  void handleMessage(cMessage* msg);
56 
57  private:
58  std::fstream pltNetwork, pltData, pltVector;
59  void extractTopology();
60  void resetTopologyNodes();
61  unsigned int getComponentSize(OverlayKey key);
62 
63  simtime_t probeIntervall;
64  simtime_t plotIntervall;
67  cMessage* probeTimer;
68  cMessage* plotTimer;
71 
72  // statistics
73  cOutVector cOV_NodeCount;
75  cOutVector cOV_MaxConnectivity;
79  cOutVector cOV_AverageDrift;
80 };
81 
82 #endif