117 void AEData::doIni() {
118 startVar = par(
"startVar");
120 cXMLElement* slXml = NULL;
121 if (par(
"streamList").xmlValue() != NULL && par(
"streamList").xmlValue()->hasChildren()){
122 slXml = par(
"streamList").xmlValue();
124 error(
"streamList parameter not initialized!");
127 cXMLElementList streamsXML = slXml->getChildrenByTagName(
"Stream");
128 for (cXMLElementList::iterator it = streamsXML.begin(); it != streamsXML.end(); ++it) {
129 cXMLElement* m = *it;
133 cXMLElementList attrs = m->getChildren();
134 for (cXMLElementList::iterator jt = attrs.begin(); jt != attrs.end(); ++jt) {
135 cXMLElement* n = *jt;
136 if ( !strcmp(n->getTagName(),
"brt") ) {
137 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
138 if (v > 0) { st.
setBrt(v); }
139 }
else if ( !strcmp(n->getTagName(),
"dataS") ) {
140 double v = n->getNodeValue() ? atoi(n->getNodeValue()) : 0;
142 }
else if ( !strcmp(n->getTagName(),
"vardataS") ) {
143 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
145 }
else if ( !strcmp(n->getTagName(),
"waitT") ) {
146 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
148 }
else if ( !strcmp(n->getTagName(),
"varWaitT") ) {
149 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
151 }
else if ( !strcmp(n->getTagName(),
"rng") ) {
152 string nodeVal = n->getNodeValue();
153 if(nodeVal ==
"uniform"){
155 }
else if(nodeVal ==
"normal"){
158 }
else if ( !strcmp(n->getTagName(),
"rngwt") ) {
159 string nodeVal = n->getNodeValue();
160 if(nodeVal ==
"uniform"){
162 }
else if(nodeVal ==
"normal"){
169 streams.push_back(st);
173 void AEData::doFin(){}
175 void AEData::iniCom(){
176 for(
sVecIt it = streams.begin(); it != streams.end(); it++){
178 scheduleAt(uniform(simTime(), simTime()+startVar),
new State_Change(it->getid(),
true) );
184 if(
State_Change * stc = dynamic_cast<State_Change*>(msg)){
186 streams[stc->streamId].setSending();
187 scheduleAt(simTime(),
new Stream_Timer(stc->streamId) );
189 Stream *s = &streams[stc->streamId];
193 }
else if(
Stream_Timer * st = dynamic_cast<Stream_Timer*>(msg)){
194 Stream *s = &streams[st->streamId];
197 scheduleAt(simTime(),
new State_Change(st->streamId,
false) );
double minMaxNormal(double a, double b, int rng)
double(* RNG_function)(double, double, int rng)
void setWTRNG(RNG_function)
void setRNG(RNG_function)