Power_5.test 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. # status
  32. **.hasStatus = true
  33. # power
  34. **.energyStorageType = "SimpleCcBattery"
  35. **.energyConsumerType = "StateBasedCcEnergyConsumer"
  36. **.energyStorage.nominalCapacity = 1C
  37. **.energyStorage.nominalVoltage = 1.5V
  38. **.energyStorage.cutoffVoltage = 1.0V
  39. **.energyStorage.internalResistance = 0.2Ohm
  40. *.hostSource.energyStorage.initialCapacity = 1C
  41. *.hostDestination.energyStorage.initialCapacity = 0.1C
  42. # mobility
  43. **.mobility.constraintAreaMinZ = 0m
  44. **.mobility.constraintAreaMinX = 0m
  45. **.mobility.constraintAreaMinY = 0m
  46. **.mobility.constraintAreaMaxX = 100m
  47. **.mobility.constraintAreaMaxY = 100m
  48. **.mobility.constraintAreaMaxZ = 0m
  49. **.mobility.initFromDisplayString = false
  50. **.mobility.initialY = 50m
  51. **.mobility.initialZ = 0m
  52. *.host*.mobilityType = "StationaryMobility"
  53. *.hostSource.mobility.initialX = 20m
  54. *.hostDestination.mobility.initialX = 80m
  55. # ping app
  56. *.host*.numPingApps = 1
  57. *.hostSource.pingApp[0].destAddr = "hostDestination"
  58. *.hostSource.pingApp[0].printPing = true
  59. %contains: stdout
  60. --------------------------------------------------------
  61. Test.hostSource.pingApp[0]
  62. --------------------------------------------------------
  63. sent: 100 received: 50 loss rate (%): 50
  64. round-trip min/avg/max (ms): 0.2344/0.500888/1.0788
  65. stddev (ms): 0.198598 variance:3.94412e-08
  66. --------------------------------------------------------
  67. %#--------------------------------------------------------------------------------------------------------------
  68. %not-contains: stdout
  69. undisposed object:
  70. %not-contains: stdout
  71. -- check module destructor
  72. %#--------------------------------------------------------------------------------------------------------------