Changeset 6795 for code/branches/ai/src/orxonox/controllers/AIController.cc
- Timestamp:
- Apr 26, 2010, 5:02:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai/src/orxonox/controllers/AIController.cc
r6696 r6795 49 49 AIController::~AIController() 50 50 { 51 if (this->state_ == MASTER) freeAllSlaves(); 51 COUT(0) << "~AIController 1" << std::endl; 52 if (this->state_ == MASTER) setNewMasterWithinFormation(); 53 COUT(0) << "~AIController 2" << std::endl; 52 54 if (this->state_ == SLAVE) unregisterSlave(); 53 this->slaves.clear(); 55 COUT(0) << "~AIController 3" << std::endl; 56 this->slaves_.clear(); 57 COUT(0) << "~AIController 4" << std::endl; 54 58 } 55 59 … … 84 88 // lose master status (only if less than 4 slaves in formation) 85 89 random = rnd(maxrand); 86 if(random < 5/(this->slaves .size()+1) && this->slaves.size() < 5 )90 if(random < 5/(this->slaves_.size()+1) && this->slaves_.size() < 5 ) 87 91 this->loseMasterState(); 88 92 89 93 // look out for outher masters if formation is small 90 if(this->slaves .size() < 3)94 if(this->slaves_.size() < 3) 91 95 this->searchNewMaster(); 92 96
Note: See TracChangeset
for help on using the changeset viewer.