#include <iflist.h>
Inheritance diagram for Out_List:


Definition at line 148 of file iflist.h.
Public Member Functions | |
| void | CalRange () |
| PrvCurPtr | Find (Agent_List **, ns_addr_t) |
| void | FreeAll (Agent_List **) |
| void | InsertFront (Agent_List **, Agent_List *) |
| void | NormalizeGradient () |
| Out_List () | |
| virtual void | print () |
| void | Remove (Agent_List **, Agent_List *) |
| void | Union (Agent_List **, Agent_List *) |
| Out_List * | WhereToGo () |
| virtual | ~Out_List () |
Data Fields | |
| ns_addr_t | agent_addr |
| double | from |
| float | gradient |
| bool | is_sink |
| Agent_List * | next |
| int | num_data_send |
| int | num_neg_recv |
| int | num_pos_recv |
| int | rank |
| double | timeout |
| double | to |
|
|
Definition at line 158 of file iflist.h. References from, gradient, num_data_send, num_neg_recv, num_pos_recv, timeout, and to. 00158 : From_List() { gradient = 0; from=0.0; to=0.0; num_data_send=0; 00159 timeout = 0.0; num_neg_recv = 0; num_pos_recv=0;}
|
|
|
Definition at line 160 of file iflist.h.
|
|
|
Definition at line 172 of file iflist.cc. References FROM_SLOT, GRADIENT, OUT_NEXT, and TO_SLOT. 00173 { 00174 Out_List *cur_out=this; 00175 double cur_slot=0.0; 00176 00177 for (cur_out = this; cur_out != NULL; cur_out = OUT_NEXT(cur_out) ) { 00178 00179 if ( GRADIENT(cur_out) <= 0.0 ) { 00180 FROM_SLOT(cur_out) = -1.0; 00181 TO_SLOT(cur_out) = -1.0; 00182 continue; 00183 } 00184 00185 FROM_SLOT(cur_out) = cur_slot; 00186 cur_slot = cur_slot + GRADIENT(cur_out); 00187 TO_SLOT(cur_out) = cur_slot; 00188 } 00189 00190 return; 00191 }
|
|
||||||||||||
|
Definition at line 91 of file iflist.cc. References ns_addr_t::addr_, PrvCurPtr::cur, Agent_List::next, NODE_ADDR, PORT, ns_addr_t::port_, and PrvCurPtr::prv. Referenced by Agent_List::Union(). 00092 { 00093 PrvCurPtr RetVal; 00094 Agent_List **prv, *cur; 00095 00096 for (prv= start, cur=*start; cur != NULL; prv= &(cur->next), cur=cur->next) { 00097 if ( NODE_ADDR(cur) == addr.addr_ && PORT(cur)==addr.port_) 00098 break; 00099 } 00100 00101 RetVal.prv = prv; 00102 RetVal.cur = cur; 00103 00104 return RetVal; 00105 }
|
|
|
Definition at line 77 of file iflist.cc. References Agent_List::next. 00078 { 00079 Agent_List *temp; 00080 Agent_List *next; 00081 00082 for (temp = *prev; temp != NULL; temp=next) { 00083 next = temp->next; 00084 delete temp; 00085 } 00086 00087 *prev = NULL; 00088 }
|
|
||||||||||||
|
Definition at line 58 of file iflist.cc. References Agent_List::next. Referenced by Agent_List::Union(). 00059 { 00060 if (cur == NULL) 00061 return; 00062 00063 cur->next = *start; 00064 *start = cur; 00065 }
|
|
|
Definition at line 194 of file iflist.cc. References GRADIENT, num, and OUT_NEXT. 00195 { 00196 Out_List *cur; 00197 float sum=0.0; 00198 int num=0; 00199 00200 for (cur=this; cur!=NULL; cur=OUT_NEXT(cur)) { 00201 sum = sum + GRADIENT(cur); 00202 num++; 00203 } 00204 00205 if (num == 0) return; 00206 00207 if (sum == 0.0) { 00208 float share= 1.0/num; 00209 00210 for (cur=this; cur != NULL; cur = OUT_NEXT(cur)) { 00211 GRADIENT(cur) = share; 00212 } 00213 00214 return; 00215 } 00216 00217 for (cur=this; cur != NULL; cur = OUT_NEXT(cur)) { 00218 GRADIENT(cur) = GRADIENT(cur)/sum; 00219 } 00220 }
|
|
|
Definition at line 125 of file iflist.cc. References ns_addr_t::addr_, Agent_List::agent_addr, Agent_List::next, and ns_addr_t::port_. 00126 { 00127 Agent_List *cur; 00128 00129 for (cur=this; cur!=NULL; cur=cur->next) { 00130 printf("(%d,%d)\n", cur->agent_addr.addr_, cur->agent_addr.port_); 00131 } 00132 }
|
|
||||||||||||
|
Definition at line 68 of file iflist.cc. References Agent_List::next. 00069 { 00070 if (cur == NULL) 00071 return; 00072 00073 *prev = cur->next; 00074 }
|
|
||||||||||||
|
Definition at line 110 of file iflist.cc. References AGENT_NEXT, AGT_ADDR, PrvCurPtr::cur, Agent_List::Find(), and Agent_List::InsertFront(). 00111 { 00112 PrvCurPtr RetVal; 00113 Agent_List *dupAgent; 00114 00115 for (Agent_List *cur=list1; cur != NULL; cur=AGENT_NEXT(cur)) { 00116 RetVal = Find(result, AGT_ADDR(cur)); 00117 if (RetVal.cur == NULL) { 00118 dupAgent = new Agent_List; 00119 *dupAgent = *cur; 00120 InsertFront(result, dupAgent); 00121 } 00122 } 00123 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 155 of file iflist.cc. References FROM_SLOT, OUT_NEXT, TO_SLOT, and Random::uniform(). 00156 { 00157 Out_List *cur_out; 00158 double slot = Random::uniform(); 00159 00160 for (cur_out = this; cur_out!=NULL; cur_out = OUT_NEXT(cur_out) ) { 00161 if (slot >= FROM_SLOT(cur_out) && slot < TO_SLOT(cur_out) ) 00162 return cur_out; 00163 } 00164 00165 if (cur_out == NULL && this != NULL) 00166 printf("Something must be wrong! \n"); 00167 00168 return cur_out; 00169 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 116 of file iflist.h. Referenced by Agent_List::Agent_List(), and Agent_List::print(). |
|
|
Definition at line 152 of file iflist.h. Referenced by Out_List(). |
|
|
Definition at line 150 of file iflist.h. Referenced by DiffusionProb::CalGradient(), and Out_List(). |
|
|
Definition at line 140 of file iflist.h. Referenced by DiffusionProb::add_outlist(), DiffusionProb::consider_new(), DiffusionProb::consider_old(), and From_List::From_List(). |
|
|
|
Definition at line 154 of file iflist.h. Referenced by DiffusionProb::ForwardData(), and Out_List(). |
|
|
Definition at line 155 of file iflist.h. Referenced by Out_List(). |
|
|
Definition at line 156 of file iflist.h. Referenced by Out_List(). |
|
|
Definition at line 139 of file iflist.h. Referenced by DiffusionProb::add_outlist(), DiffusionProb::CalGradient(), DiffusionProb::consider_new(), DiffusionProb::consider_old(), and From_List::From_List(). |
|
|
Definition at line 151 of file iflist.h. Referenced by Out_List(). |
|
|
Definition at line 153 of file iflist.h. Referenced by Out_List(). |
1.4.6