#include "AbstractRegion.h" #include //template ////////////////////////////////////// Region::Region(Position3D pos, long capac): position3D(pos), capacity(capac) {} Region::Region(Position3D pos, long capac, const std::vector & curS, const std::vector & restS, const std::vector & maxS, const std::vector & regS): position3D(pos), capacity(capac), currentSubstrates(curS), restorationSubstrates(restS), maxSubstrates(maxS), regulators(regS) { if(currentSubstrates.size() != restorationSubstrates.size()){ std::cerr<<"Warning! currentSubstrates size != restorationSubstrates size\n"; } if(currentSubstrates.size() != maxSubstrates.size()){ std::cerr<<"Warning! currentSubstrates size != maximumSubstrates size\n"; } if(restorationSubstrates.size() != maxSubstrates.size()){ std::cerr<<"Warning! restorationSubstrates size != maximumSubstrates size\n"; } } /** * Восстановление субстратов за период **/ void Region::restoreSubstrate(){ for(unsigned int i = 0; i < this->currentSubstrates.size(); i++){ this->currentSubstrates.at(i) = std::max( this->currentSubstrates.at(i) + this->restorationSubstrates.at(i), this->maxSubstrates.at(i)); } }