/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2008,2009 IITP RAS * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Author: Kirill Andreev */ #include "ns3/core-module.h" #include "ns3/simulator-module.h" #include "ns3/node-module.h" #include "ns3/helper-module.h" #include "ns3/global-routing-module.h" #include "ns3/wifi-module.h" #include "ns3/mesh-module.h" #include "ns3/mobility-module.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE ("TestMeshScript"); int main(int argc, char *argv[]) { // Creating square topology with nNodes x nNodes grid: int xSize = 5; int ySize = 5; double step = 100.0; //Grid with one-hop edge double randomStart = 0.1; //One beacon interval NodeContainer nodes; CommandLine cmd; MobilityHelper mobility; MeshWifiHelper wifi; NetDeviceContainer meshDevices; // Defining a size of our network: cmd.AddValue("x-size", "Number of nodes in a row grid", xSize); cmd.AddValue("y-size", "Number of rows in a grid", ySize); cmd.AddValue("step", "Size of edge in our grid", step); cmd.AddValue("start", "Random start parameter", randomStart); cmd.Parse (argc, argv); NS_LOG_DEBUG("Grid:"<