Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 26, 2010, 5:02:49 PM (15 years ago)
Author:
solex
Message:

death of master results in forming a new formation. Correct response to master death still to solve.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai/src/orxonox/controllers/AIController.cc

    r6696 r6795  
    4949    AIController::~AIController()
    5050    {
    51         if (this->state_ == MASTER) freeAllSlaves();
     51COUT(0) << "~AIController 1" << std::endl;
     52        if (this->state_ == MASTER) setNewMasterWithinFormation();
     53COUT(0) << "~AIController 2" << std::endl;
    5254        if (this->state_ == SLAVE) unregisterSlave();
    53         this->slaves.clear();
     55COUT(0) << "~AIController 3" << std::endl;
     56        this->slaves_.clear();
     57COUT(0) << "~AIController 4" << std::endl;
    5458    }
    5559
     
    8488            // lose master status (only if less than 4 slaves in formation)
    8589            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 )
    8791                this->loseMasterState();
    8892
    8993            // look out for outher masters if formation is small
    90             if(this->slaves.size() < 3)
     94            if(this->slaves_.size() < 3)
    9195                this->searchNewMaster();
    9296
Note: See TracChangeset for help on using the changeset viewer.