Changeset 1219
- Timestamp:
- 10/20/10 13:48:34 (14 years ago)
- Location:
- applications/robust
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/main.cpp
r1216 r1219 15 15 int main ( int argc, char* argv[] ) { 16 16 17 emlig* emlig1 = new emlig(3); 17 emlig* emlig1 = new emlig(3); 18 18 19 emlig1->step_me(); 19 for(int i = 0;i<500;i++) 20 { 21 double condition[4]; 20 22 21 vec condition = "3.0 -5.0 -3.0 -2.0"; 23 condition[0] = rand()/1000.0; 24 condition[1] = rand()/1000.0; 25 condition[2] = rand()/1000.0; 26 condition[3] = rand()/1000.0; 27 28 vec* condition_vec = new vec(condition,4); 29 emlig1->add_condition(*condition_vec); 30 31 // emlig1->step_me(i); 32 33 vector<int> sizevector; 34 for(int s = 0;s<=emlig1->number_of_parameters;s++) 35 { 36 sizevector.push_back(emlig1->statistic_rowsize(s)); 37 } 38 } 39 40 41 42 /* 43 emlig1->step_me(1); 44 45 vec condition = "2.0 0.0 1.0"; 22 46 23 47 emlig1->add_condition(condition); … … 29 53 } 30 54 31 emlig1->step_me( );55 emlig1->step_me(2); 32 56 33 condition = " -5.0 2.3 2.3 -1.0";57 condition = "2.0 1.0 0.0"; 34 58 35 59 emlig1->add_condition(condition); … … 40 64 sizevector.push_back(emlig1->statistic_rowsize(s)); 41 65 } 66 */ 42 67 43 68 return 0; -
applications/robust/robustlib.h
r1216 r1219 497 497 { 498 498 case 1: 499 current_parent->positivechildren.push_back(sender); 499 current_parent->positivechildren.push_back(sender); 500 500 break; 501 501 case 0: 502 current_parent->neutralchildren.push_back(sender); 502 current_parent->neutralchildren.push_back(sender); 503 503 504 504 if(current_parent->totally_neutral == NULL) … … 518 518 break; 519 519 case -1: 520 current_parent->negativechildren.push_back(sender); 520 current_parent->negativechildren.push_back(sender); 521 521 break; 522 522 } … … 560 560 current_parent->totally_neutral = NULL; 561 561 current_parent->kids_rel_addresses.clear(); 562 //current_parent->set_state(0, SPLIT);562 current_parent->message_counter = 0; 563 563 } 564 564 } … … 595 595 } 596 596 597 void step_me( )597 void step_me(int marker) 598 598 { 599 599 for(int i = 0;i<statistic.size();i++) … … 778 778 current_polyhedron->totallyneutralgrandchildren.end()); 779 779 780 for(list<polyhedron*>::iterator grand_ref = current_polyhedron->totallyneutralgrandchildren.begin(); grand_ref != current_polyhedron->totallyneutralgrandchildren.end();grand_ref++) 781 { 782 (*grand_ref)->parents.push_back(new_totally_neutral_child); 783 } 784 780 785 toprow* positive_poly = new toprow(((toprow*)current_polyhedron)->condition+toadd); 781 786 toprow* negative_poly = new toprow(((toprow*)current_polyhedron)->condition-toadd); … … 786 791 787 792 (*parent_ref)->neutralchildren.remove(current_polyhedron); 793 (*parent_ref)->children.remove(current_polyhedron); 794 795 (*parent_ref)->children.push_back(positive_poly); 796 (*parent_ref)->children.push_back(negative_poly); 788 797 (*parent_ref)->positivechildren.push_back(positive_poly); 789 798 (*parent_ref)->negativechildren.push_back(negative_poly);