From: Jiri Vlasak Date: Tue, 14 Mar 2023 16:54:36 +0000 (+0100) Subject: Add method to set dimensions of more cars X-Git-Url: https://rtime.felk.cvut.cz/gitweb/hubacji1/iamcar2.git/commitdiff_plain/0a3bcbcb501138cca0bb9e01f0b70bf65b39788d?ds=sidebyside Add method to set dimensions of more cars --- diff --git a/bcar/incl/bcar.hh b/bcar/incl/bcar.hh index 658db31..72655a2 100644 --- a/bcar/incl/bcar.hh +++ b/bcar/incl/bcar.hh @@ -330,6 +330,9 @@ public: * \see https://www.ma.rhul.ac.uk/SRBparking */ double perfect_parking_slot_len() const; + + /*! Set parameters to what car. */ + void become(std::string const what); }; /*! Store car motion. */ diff --git a/bcar/src/bcar.cc b/bcar/src/bcar.cc index 350d1af..6c103d6 100644 --- a/bcar/src/bcar.cc +++ b/bcar/src/bcar.cc @@ -611,6 +611,36 @@ CarSize::perfect_parking_slot_len() const return this->len() + sqrt(s) - l - k; } +void +CarSize::become(std::string const what) +{ + if (what == "porsche cayenne") { + this->ctc(11.2531); + this->wwm(2.194); + this->w(1.983); + this->wb(2.895); + this->df(this->wb() + 0.936); + this->len(4.918); + this->ft(1.680); + } else if (what == "chrysler pacifica") { + this->ctc(9.557619159602458); + this->wwm(2.297); + this->w(2.022); + this->wb(3.089); + this->df(4.236); + this->len(5.171); + this->ft(1.748); + } else { // renault zoe + this->ctc(10.802166641822163); + this->wwm(1.945); + this->w(1.771); + this->wb(2.588); + this->df(3.427); + this->len(4.084); + this->ft(1.511); + } +} + double CarMove::sp() const {