Power_4.test 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. %description:
  2. Test for IEEE 802.11 power model with two adhoc nodes. One node is pinging the
  3. other. The source node is initially down, the destination node is initially up.
  4. The battery of the source node is initially depleted and it's being charged. The
  5. source node starts when the battery reaches the configured capacity. The battery
  6. of the destination node is initially full and gets depleted during the run. The
  7. destination node shuts down when the battery reaches the configured capacity.
  8. The end result is that the number of successful ping messages is less than if
  9. there were no batteries involved at all.
  10. %file: test.ned
  11. import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
  12. import inet.node.inet.AdhocHost;
  13. import inet.physicallayer.ieee80211.packetlevel.Ieee80211ScalarRadioMedium;
  14. import inet.common.lifecycle.LifecycleController;
  15. network Test
  16. {
  17. submodules:
  18. lifecycleController: LifecycleController;
  19. radioMedium: Ieee80211ScalarRadioMedium;
  20. configurator: IPv4NetworkConfigurator;
  21. hostSource: AdhocHost;
  22. hostDestination: AdhocHost;
  23. }
  24. %inifile: omnetpp.ini
  25. [General]
  26. network = Test
  27. tkenv-plugin-path = ../../../etc/plugins
  28. ned-path = .;../../../../src;../../lib
  29. sim-time-limit = 100s
  30. cmdenv-express-mode = false
  31. #omnetpp 5.0 - 5.1 compatibility:
  32. eventlog-file = "${resultdir}/${configname}-${runnumber}.elog"
  33. output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
  34. output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
  35. snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
  36. # status
  37. **.hasStatus = true
  38. *.hostSource.status.initialStatus = "down"
  39. *.hostDestination.status.initialStatus = "up"
  40. # power
  41. **.energyStorageType = "SimpleEpEnergyStorage"
  42. **.energyManagementType = "SimpleEpEnergyManagement"
  43. **.energyConsumerType = "StateBasedEpEnergyConsumer"
  44. **.energyStorage.nominalCapacity = 1J
  45. **.energyManagement.nodeShutdownCapacity = 0J
  46. **.energyManagement.nodeStartCapacity = 0.2J
  47. *.hostSource.energyStorage.initialCapacity = 0J
  48. *.hostDestination.energyStorage.initialCapacity = 0.1J
  49. *.hostSource.energyGeneratorType = "AlternatingEpEnergyGenerator"
  50. *.hostSource.energyGenerator.energySinkModule = "hostSource.energyStorage"
  51. *.hostSource.energyGenerator.powerGeneration = 10mW
  52. *.hostSource.energyGenerator.sleepInterval = 0s
  53. *.hostSource.energyGenerator.generationInterval = 10s
  54. # mobility
  55. **.mobility.constraintAreaMinZ = 0m
  56. **.mobility.constraintAreaMinX = 0m
  57. **.mobility.constraintAreaMinY = 0m
  58. **.mobility.constraintAreaMaxX = 100m
  59. **.mobility.constraintAreaMaxY = 100m
  60. **.mobility.constraintAreaMaxZ = 0m
  61. **.mobility.initFromDisplayString = false
  62. **.mobility.initialY = 50m
  63. **.mobility.initialZ = 0m
  64. *.host*.mobilityType = "StationaryMobility"
  65. *.hostSource.mobility.initialX = 20m
  66. *.hostDestination.mobility.initialX = 80m
  67. # ping app
  68. *.host*.numPingApps = 1
  69. *.hostSource.pingApp[0].destAddr = "hostDestination"
  70. *.hostSource.pingApp[0].printPing = true
  71. %contains: stdout
  72. --------------------------------------------------------
  73. Test.hostSource.pingApp[0]
  74. --------------------------------------------------------
  75. sent: 81 received: 30 loss rate (%): 62.963
  76. round-trip min/avg/max (ms): 0.2344/0.553547/1.5488
  77. stddev (ms): 0.25787 variance:6.64969e-08
  78. --------------------------------------------------------
  79. %#--------------------------------------------------------------------------------------------------------------
  80. %not-contains: stdout
  81. undisposed object:
  82. %not-contains: stdout
  83. -- check module destructor
  84. %#--------------------------------------------------------------------------------------------------------------