WirelessA.ned 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // This program is free software: you can redistribute it and/or modify
  3. // it under the terms of the GNU Lesser General Public License as published by
  4. // the Free Software Foundation, either version 3 of the License, or
  5. // (at your option) any later version.
  6. //
  7. // This program is distributed in the hope that it will be useful,
  8. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. // GNU Lesser General Public License for more details.
  11. //
  12. // You should have received a copy of the GNU Lesser General Public License
  13. // along with this program. If not, see http://www.gnu.org/licenses/.
  14. //
  15. package inet.tutorials.wireless;
  16. import inet.common.figures.DelegateSignalConfigurator;
  17. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  18. import inet.node.inet.INetworkNode;
  19. import inet.physicallayer.contract.packetlevel.IRadioMedium;
  20. import inet.visualizer.contract.IIntegratedVisualizer;
  21. network WirelessA
  22. {
  23. parameters:
  24. string hostType = default("WirelessHost");
  25. string mediumType = default("IdealRadioMedium");
  26. @display("bgb=650,500;bgg=100,1,grey95");
  27. @figure[title](type=label; pos=0,-1; anchor=sw; color=darkblue);
  28. @figure[rcvdPkText](type=indicatorText; pos=380,20; anchor=w; font=,18; textFormat="packets received: %g"; initialValue=0);
  29. @statistic[rcvdPk](source=hostB.udpApp[0].rcvdPk; record=figure(count); targetFigure=rcvdPkText);
  30. submodules:
  31. visualizer: <default("IntegratedCanvasVisualizer")> like IIntegratedVisualizer if hasVisualizer() {
  32. @display("p=580,125");
  33. }
  34. configurator: IPv4NetworkConfigurator {
  35. @display("p=580,200");
  36. }
  37. radioMedium: <mediumType> like IRadioMedium {
  38. @display("p=580,275");
  39. }
  40. hostA: <hostType> like INetworkNode {
  41. @display("p=50,325");
  42. }
  43. hostB: <hostType> like INetworkNode {
  44. @display("p=450,325");
  45. }
  46. }