~comnets/openwns-scenarios/main

« back to all changes in this revision

Viewing changes to PyConfig/scenarios/builders/creatorplacer.py

  • Committer: Maciej Muehleisen
  • Date: 2011-10-19 06:20:08 UTC
  • Revision ID: mue@comnets.rwth-aachen.de-20111019062008-4qm7vg8zj78c10o0
Repaired isCenter property in builder

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 
86
86
            self.bsPositions = self.bsPlacer.getPositions()
87
87
 
88
 
            ### Set isCenter to True for first BS sectors
89
 
            isCenter = True
90
88
            for currentPosition in self.bsPositions:
91
89
                bsNode = self.bsCreator.create()
92
90
                assert isinstance(bsNode, scenarios.interfaces.INode)
93
 
                bsNode.setProperty("isCenter", isCenter)
94
91
                bsNode.setPosition(currentPosition)
95
92
                bsNode.setAntenna(antenna)
96
93
                bsNode.setChannelModel(channelmodelConfigurations)
97
94
                openwns.simulator.getSimulator().simulationModel.nodes.append(bsNode)
98
95
                self.bsNodes.append(bsNode)
99
96
 
100
 
                ### Set isCenter to False for the following BS sectors
101
 
                if isCenter == True:
102
 
                    isCenter = False
103
 
 
104
97
    def _createUserTerminals(self):
105
98
        channelmodelConfigurations = self.channelmodelCreator.create()
106
99
        self.utPositions = []
115
108
                    utNode.setPosition(currentPosition)
116
109
                    utNode.setProperty("BS", bs)
117
110
                    self.utNodes.append(utNode)
 
111
 
 
112
            # Reset utPlacer to first (center) BS to configure "isCenter" property later
 
113
            self.utPlacer.setCenter(self.bsPositions[0])
 
114
 
118
115
        else:
119
116
            self.utPlacer.setCenter(self.bsPlacer.center)
120
117
            for currentPosition in self.utPlacer.getPositions():
123
120
                utNode.setPosition(currentPosition)
124
121
                self.utNodes.append(utNode)
125
122
 
126
 
        self.utPlacer.setCenter(self.bsPositions[0])
127
 
        print "Position of first (center) BS is x: ", self.bsPositions[0].x," y: ", self.bsPositions[0].y
128
123
        for utNode in self.utNodes:
129
 
            utNode.setProperty("isCenter", self.utPlacer.isInside(currentPosition))
 
124
            utNode.setProperty("isCenter", self.utPlacer.isInside(utNode.getPosition()))
130
125
            utNode.setChannelModel(channelmodelConfigurations)
 
126
            self.utPositions.append(utNode.getPosition())
131
127
            openwns.simulator.getSimulator().simulationModel.nodes.append(utNode)
132
128
 
 
129
        for bsNode in self.bsNodes:
 
130
            bsNode.setProperty("isCenter", self.utPlacer.isInside(bsNode.getPosition()))