108 void AEBStream::doIni() {
109 startVar = par(
"startVar");
111 cXMLElement* slXml = NULL;
112 if (par(
"streamList").xmlValue() != NULL && par(
"streamList").xmlValue()->hasChildren()){
113 slXml = par(
"streamList").xmlValue();
115 error(
"streamList parameter not initialized!");
118 cXMLElementList streamsXML = slXml->getChildrenByTagName(
"Stream");
119 for (cXMLElementList::iterator it = streamsXML.begin(); it != streamsXML.end(); ++it) {
120 cXMLElement* m = *it;
124 cXMLElementList attrs = m->getChildren();
125 for (cXMLElementList::iterator jt = attrs.begin(); jt != attrs.end(); ++jt) {
126 cXMLElement* n = *jt;
127 if ( !strcmp(n->getTagName(),
"brt") ) {
128 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
129 if (v > 0) { st.
setBrt(v); }
130 }
else if ( !strcmp(n->getTagName(),
"pduS") ) {
131 double v = n->getNodeValue() ? atoi(n->getNodeValue()) : 0;
133 }
else if ( !strcmp(n->getTagName(),
"varPduS") ) {
134 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
136 }
else if ( !strcmp(n->getTagName(),
"BurstS") ) {
137 double v = n->getNodeValue() ? atoi(n->getNodeValue()) : 0;
139 }
else if ( !strcmp(n->getTagName(),
"varBurstS") ) {
140 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
142 }
else if ( !strcmp(n->getTagName(),
"burstProb") ) {
143 double v = n->getNodeValue() ? atof(n->getNodeValue()) : 0;
145 }
else if ( !strcmp(n->getTagName(),
"rng") ) {
146 string nodeVal = n->getNodeValue();
147 if(nodeVal ==
"uniform"){
149 }
else if(nodeVal ==
"normal"){
152 }
else if ( !strcmp(n->getTagName(),
"rngb") ) {
153 string nodeVal = n->getNodeValue();
154 if(nodeVal ==
"uniform"){
156 }
else if(nodeVal ==
"normal"){
163 streams.push_back(st);
167 void AEBStream::doFin(){}
169 void AEBStream::iniCom(){
170 for(
sVecIt it = streams.begin(); it != streams.end(); it++){
172 scheduleAt(uniform(simTime(), simTime()+startVar),
new Stream_Timer(it->getid()) );
188 int remaining = data;
190 while(remaining > 0){
191 sendMsg(
new _PingMsg(), min(remaining, maxSize));
192 remaining -= maxSize;
double minMaxNormal(double a, double b, int rng)
void setBRNG(RNG_function)
void setVarBurstS(double)
void setBurstProb(double)
double(* RNG_function)(double, double, int rng)
void setRNG(RNG_function)