Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 8: {
- std::random_device rd; // only used once to initialise (seed) engine
- std::mt19937 rng(rd()); // random-number engine used (Mersenne-Twister in this case)
- std::uniform_int_distribution<int> uni(0, 100); // guaranteed unbiased
- ArrayList<Paleta*>* docasnyArrayList_;
- //auto random_integer = uni(rng);
- for (size_t i = 0; i < skladFRI->getVozidlaNaCeste()->size();i++) {
- for (size_t j = 0; j < skladFRI->getVozidlaNaCeste()->operator[](i)->getPaletyVoVozidle()->size();j++) {
- if (uni(rng) > 5) {
- skladFRI->getVozidlaNaCeste()->operator[](i)->getPaletyVoVozidle()->pop();
- }
- else {
- docasnyArrayList_ = new ArrayList<Paleta *>();
- docasnyArrayList_->add(skladFRI->getVozidlaNaCeste()->operator[](i)->getPaletyVoVozidle()->pop());
- }
- }
- //while (docasnyArrayList_ > 0) {
- //skladFRI->getVozidlaNaCeste()->operator[](i)->getPaletyVoVozidle()->push(docasnyArrayList_->operator[](docasnyArrayList_->size() - 1));
- //}
- for (Paleta* p : *docasnyArrayList_) {
- skladFRI->getVozidlaNaCeste()->operator[](i)->getPaletyVoVozidle()->push(p);
- }
- }
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement