OverSim
SVivaldi.h
Go to the documentation of this file.
1 // Copyright (C) 2009 Institut fuer Telematik, Universitaet Karlsruhe (TH)
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 //
17 
23 #ifndef _SVIVALDI_
24 #define _SVIVALDI_
25 
26 
27 #include <omnetpp.h>
28 
29 #include <Vivaldi.h>
30 
31 class NeighborCache;
32 
33 
34 class SVivaldi : public Vivaldi
35 {
36  private:
37  double lossC;
39  double loss;
41 
42  protected:
43  virtual double calcError(const simtime_t& rtt, double dist, double weight);
44  virtual double calcDelta(const simtime_t& rtt, double dist, double weight);
45 
46  public:
47  virtual void init(NeighborCache* neighborCache);
48  double getLoss() const { return loss; };
49  void stopAdaptation() { loss = 1; };
50 };
51 
52 #endif