src/uan/examples/uan-cw-example.h
author Vedran Miletić <rivanvx@gmail.com>
Tue, 02 Aug 2011 17:42:33 -0400
changeset 7385 10beb0e53130
parent 7353 09fccf6195ea
child 9840 ffe6c110c1ad
permissions -rw-r--r--
standardize emacs c++ mode comments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7353
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
6478
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     2
/*
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     3
 * Copyright (c) 2009 University of Washington
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     4
 *
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as 
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     8
 *
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    13
 *
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    17
 *
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    18
 * Author: Leonard Tracy <lentracy@gmail.com>
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    19
 */
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    20
7353
09fccf6195ea bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents: 6941
diff changeset
    21
#ifndef UAN_CW_EXAMPLE_H
09fccf6195ea bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents: 6941
diff changeset
    22
#define UAN_CW_EXAMPLE_H
6478
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    23
6823
a27f86fb4e55 Merge node and common modules into new network module
Tom Henderson <tomh@tomh.org>
parents: 6478
diff changeset
    24
#include "ns3/network-module.h"
6941
9d2c79c992d7 Split contrib module into config-store and tools
Mitch Watrous <watrous@u.washington.edu>
parents: 6865
diff changeset
    25
#include "ns3/tools-module.h"
6478
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    26
#include "ns3/uan-module.h"
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    27
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    28
using namespace ns3;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    29
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    30
/**
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    31
 * \class Experiment
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    32
 * \brief Helper class for UAN CW MAC example
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    33
 *
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    34
 */
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    35
class Experiment
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    36
{
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    37
public:
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    38
  Gnuplot2dDataset Run (UanHelper &uan);
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    39
  void ReceivePacket (Ptr<Socket> socket);
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    40
  void UpdatePositions (NodeContainer &nodes);
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    41
  void ResetData ();
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    42
  void IncrementCw (uint32_t cw);
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    43
  uint32_t m_numNodes;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    44
  uint32_t m_dataRate;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    45
  double m_depth;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    46
  double m_boundary;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    47
  uint32_t m_packetSize;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    48
  uint32_t m_bytesTotal;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    49
  uint32_t m_cwMin;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    50
  uint32_t m_cwMax;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    51
  uint32_t m_cwStep;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    52
  uint32_t m_avgs;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    53
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    54
  Time m_slotTime;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    55
  Time m_simTime;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    56
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    57
  std::string m_gnudatfile;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    58
  std::string m_asciitracefile;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    59
  std::string m_bhCfgFile;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    60
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    61
  Gnuplot2dDataset m_data;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    62
  std::vector<double> m_throughputs;
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    63
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    64
  Experiment ();
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    65
};
b401db8531f5 Bug 970 - move UAN over to new directory structure
Josh Pelkey <jpelkey@gatech.edu>
parents:
diff changeset
    66
7353
09fccf6195ea bug 1203: Inconsistently named ifndef/define macros in ns-3 headers
Vedran Miletic <rivanvx@gmail.com>
parents: 6941
diff changeset
    67
#endif /* UAN_CW_EXAMPLE_H */