@@ -17,15 +17,6 @@ void All911Vertices::setupVertices()
1717{
1818 AllVertices::setupVertices ();
1919
20- callNum_.resize (size_);
21- dispNum_.resize (size_);
22- respNum_.resize (size_);
23-
24- // Populate arrays with 0
25- callNum_.assign (size_, 0 );
26- dispNum_.assign (size_, 0 );
27- respNum_.assign (size_, 0 );
28-
2920 // Resize and fill vectors with 0
3021 numAgents_.assign (size_, 0 );
3122 numTrunks_.assign (size_, 0 );
@@ -83,69 +74,10 @@ void All911Vertices::createAllVertices(Layout &layout)
8374
8475 // Read Input Events using the InputManager
8576 inputManager_.readInputs ();
86-
87-
88- // TODO: The code below is from previous version. I am keeping because
89- // it is usefull for testing the output against the previous version.
90- vector<int > psapList;
91- vector<int > respList;
92- psapList.clear ();
93- respList.clear ();
94-
95- int callersPerZone[] = {0 , 0 , 0 , 0 };
96- int respPerZone[] = {0 , 0 , 0 , 0 };
97-
98- Layout911 &layout911 = dynamic_cast <Layout911 &>(layout);
99-
100- for (int i = 0 ; i < Simulator::getInstance ().getTotalVertices (); i++) {
101- // Create all callers
102- if (layout.vertexTypeMap_ [i] == CALR) {
103- callNum_[i] = initRNG.inRange (callNumRange_[0 ], callNumRange_[1 ]);
104- callersPerZone[layout911.zone (i)] += callNum_[i];
105- }
106-
107- // Find all PSAPs
108- if (layout.vertexTypeMap_ [i] == PSAP) {
109- psapList.push_back (i);
110- }
111-
112- // Find all resps
113- if (layout.vertexTypeMap_ [i] == RESP) {
114- respList.push_back (i);
115- respPerZone[layout911.zone (i)] += 1 ;
116- }
117- }
118-
119- // Create all psaps
120- // Dispatchers in a psap = [callers in the zone * k] + some randomness
121- for (int i = 0 ; i < psapList.size (); i++) {
122- int psapQ = layout911.zone (i);
123- int dispCount = (callersPerZone[psapQ] * dispNumScale_) + initRNG.inRange (-5 , 5 );
124- if (dispCount < 1 ) {
125- dispCount = 1 ;
126- }
127- dispNum_[psapList[i]] = dispCount;
128- }
129-
130- // Create all responders
131- // Responders in a node = [callers in the zone * k]/[number of responder nodes] + some randomness
132- for (int i = 0 ; i < respList.size (); i++) {
133- int respQ = layout911.zone (respList[i]);
134- int respCount
135- = (callersPerZone[respQ] * respNumScale_) / respPerZone[respQ] + initRNG.inRange (-5 , 5 );
136- if (respCount < 1 ) {
137- respCount = 1 ;
138- }
139- respNum_[respList[i]] = respCount;
140- }
14177}
14278
14379void All911Vertices::loadParameters ()
14480{
145- ParameterManager::getInstance ().getIntByXpath (" //CallNum/min/text()" , callNumRange_[0 ]);
146- ParameterManager::getInstance ().getIntByXpath (" //CallNum/max/text()" , callNumRange_[1 ]);
147- ParameterManager::getInstance ().getBGFloatByXpath (" //DispNumScale/text()" , dispNumScale_);
148- ParameterManager::getInstance ().getBGFloatByXpath (" //RespNumScale/text()" , respNumScale_);
14981 ParameterManager::getInstance ().getBGFloatByXpath (" //RedialP/text()" , redialP_);
15082}
15183
@@ -297,37 +229,4 @@ void All911Vertices::advanceVertices(AllEdges &edges, const EdgeIndexMap &edgeIn
297229 }
298230 }
299231}
300-
301- // / Update internal state of the indexed Neuron (called by every simulation step).
302- // /
303- // / @param index Index of the Neuron to update.
304- void All911Vertices::advanceVertex (const int index)
305- {
306- // BGFLOAT &Vm = this->Vm_[index];
307- // BGFLOAT &Vthresh = this->Vthresh_[index];
308- // BGFLOAT &summationPoint = this->summationPoints_[index];
309- // BGFLOAT &I0 = this->I0_[index];
310- // BGFLOAT &Inoise = this->Inoise_[index];
311- // BGFLOAT &C1 = this->C1_[index];
312- // BGFLOAT &C2 = this->C2_[index];
313- // int &nStepsInRefr = this->numStepsInRefractoryPeriod_[index];
314-
315- // if (nStepsInRefr > 0) {
316- // // is neuron refractory?
317- // --nStepsInRefr;
318- // } else if (Vm >= Vthresh) {
319- // // should it fire?
320- // fire(index);
321- // } else {
322- // summationPoint += I0; // add IO
323- // // add noise
324- // BGFLOAT noise = (*rgNormrnd)();
325- // //LOG4CPLUS_DEBUG(vertexLogger_, "ADVANCE NEURON[" << index << "] :: Noise = " << noise);
326- // summationPoint += noise * Inoise; // add noise
327- // Vm = C1 * Vm + C2 * summationPoint; // decay Vm and add inputs
328- // }
329- // // clear synaptic input for next time step
330- // summationPoint = 0;
331- }
332-
333232#endif
0 commit comments