2
from openwns.pyconfig import Frozen
3
import openwns.evaluation.default
6
import scenarios.builders
7
import scenarios.placer
8
import scenarios.antenna
11
import ip.BackboneHelpers
13
import wimac.support.nodecreators
14
import wimac.support.helper
15
import wimac.evaluation.default
16
import wimac.support.PostProcessor as PostProcessor
18
from wimac.support.WiMACParameters import ParametersOFDM, ParametersMAC
23
# Global station id generator
30
stationIDs = stationID()
34
####################################################
35
### Distinguished Simulation Settings #
36
####################################################
38
# Set basic WiMAX Parameters
39
parametersPhy = ParametersOFDM
40
parametersMAC = ParametersMAC
42
parametersPhy.slotDuration = 3.0 * parametersPhy.symbolDuration
43
numberOfTimeSlots = 100
46
trafficUL = 0.01E6 # bit/s per station
47
trafficDL = 0.0 # bit/s per station
49
noIPHeader = True #Set to true to set IP header to 0
50
probeWindowSize = 0.01 # Probe per frame ####
51
scheduler = "Random" # "PropFair"
63
WNS = openwns.Simulator(simulationModel = openwns.node.NodeSimulationModel())
64
openwns.setSimulator(WNS)
65
WNS.maxSimTime = 0.5 # seconds
66
WNS.masterLogger.backtrace.enabled = False
67
WNS.masterLogger.enabled = True
68
WNS.outputStrategy = openwns.simulator.OutputStrategy.DELETE
69
WNS.statusWriteInterval = 30 # in seconds
70
WNS.probesWriteInterval = 300 # in seconds
72
# Pass WiMAX Phy parameters to wimac::parameter::PHY singleton
73
WNS.modules.wimac.parametersPHY = Config.parametersPhy
75
WNS.modules.rise.debug.antennas = True ####
77
# Create and place the nodes:
78
# One BS (25m omnidirectional antenna height) with two nodes, one near, one far
79
bsPlacer = scenarios.placer.LinearPlacer(numberOfNodes = Config.numberOfBS,
80
positionsList = [Config.radiusOfPlacer, Config.radiusOfPlacer + Config.distance])
81
uePlacer = scenarios.placer.circular.CircularAreaPlacer(Config.numberOfUT, Config.radiusOfPlacer, Config.minDistance)
82
bsAntenna = scenarios.antenna.IsotropicAntennaCreator([0.0, 0.0, 5.0])
83
bsCreator = wimac.support.nodecreators.WiMAXBSCreator(stationIDs, Config)
84
ueCreator = wimac.support.nodecreators.WiMAXUECreator(stationIDs, Config)
86
#channelmodelcreator = wimac.support.helper.TestChannelModelCreator()
87
channelmodelcreator = wimac.support.helper.InHNLoSChannelModelCreator()
88
scenario = scenarios.builders.CreatorPlacerBuilder(bsCreator, bsPlacer, bsAntenna, ueCreator, uePlacer, channelmodelcreator)
90
#wimac.support.helper.setupPhy(WNS, Config, "LoS_Test")
91
wimac.support.helper.setupPhy(WNS, Config, "InH")
93
# begin example "wimac.tutorial.experiment2.staticFactory.substrategy.ProportionalFair.config.py"
94
wimac.support.helper.setupScheduler(WNS, Config.scheduler)
97
# Set IP Header to 0 (else it is 20 byte)
99
wimac.support.helper.disableIPHeader(WNS)
101
# Always create uplink traffic, if traffic UL is 0 we sent exacly
102
# one packet for initialization
103
wimac.support.helper.createULPoissonTraffic(WNS, Config.trafficUL, Config.packetSize)
105
# Only create downlink traffic if we have any
106
if Config.trafficDL > 0.0:
107
wimac.support.helper.createDLPoissonTraffic(WNS, Config.trafficDL, Config.packetSize)
109
# Configure the window probes
110
wimac.support.helper.setL2ProbeWindowSize(WNS, Config.probeWindowSize)
113
# DHCP, ARP, DNS for IP
114
ip.BackboneHelpers.createIPInfrastructure(WNS, "WIMAXRAN")
116
utNodes = WNS.simulationModel.getNodesByProperty("Type", "UE")
117
bsNodes = WNS.simulationModel.getNodesByProperty("Type", "BS")
120
# Probe configuration
121
loggingStationIDs = []
123
for node in utNodes + bsNodes:
124
loggingStationIDs.append(node.dll.stationID)
126
#wimac.evaluation.default.installDebugEvaluation(WNS, loggingStationIDs, Config.settlingTime, "Moments")
128
wimac.evaluation.default.installFemtoEvaluation(WNS, loggingStationIDs, Config.settlingTime)
130
#wimac.evaluation.default.installOverFrameOffsetEvaluation(WNS,
131
# Config.parametersPhy.symbolsFrame,
135
# Enable probe showing when which user starts and stops transmitting.
136
# Produces a lot of output and should only be used for short runs
138
#wimac.evaluation.default.installScheduleEvaluation(WNS, loggingStationIDs)
140
openwns.evaluation.default.installEvaluation(WNS)
142
print "End of Configuration File"