Object-oriented – implementation of elevator design in C ++

I've written C ++ code that fulfills the function of a lift to move people from one floor to another. It's a fun project and I've written to test my C ++ skills. Please review this code and suggest improvements. Also suggest some other features that I should add.

#include 
#include 
#include 
#include 

class Elevator
{
    enum Direction{ UP, DOWN };
    Direction direction;

    std::vector requests = {};
    int min_floor; //Undergroud floor will be shown using negative value
    int max_floor;
    int current_floor = 0; //ground floor
    std::size_t current_capacity = 0;
    std::size_t max_capacity;

 public:
    Elevator() = default;
    Elevator(int min_floor, int max_floor, std::size_t max_capacity) :
            min_floor(min_floor),
            max_floor(max_floor),
            max_capacity(max_capacity)
            {}
    ~Elevator() {};

    void start_elevator();

 private:
    void set_initial_request();
    void set_request();
    bool is_valid_request(int floor) const;
    void set_direction();

    int get_min_floor() const
    {
        return min_floor;
    }

    int get_max_floor() const
    {
        return max_floor;
    }

    int get_current_floor() const
    {
        return current_floor;
    }

    void set_current_floor(int floor)
    {
        current_floor = floor;
    }

    std::size_t get_max_capacity() const
    {
        return max_capacity;
    }

    std::size_t get_current_capacity() const
    {
        return current_capacity;
    }

    void set_current_capacity(std::size_t cap)
    {
        current_capacity = cap;
    }
 }; 

    void Elevator::set_initial_request() 
    {
        std::size_t num_of_reqs;
        int dest_floor;

        std::cout << "nEnter number of requests n";//<< get_current_floor() << "n";
        std::cin >> num_of_reqs;

        std::cout << "nEnter destination floor number.n";
        std::cin >> dest_floor;
        requests.emplace_back(dest_floor);
        set_current_capacity(1 + get_current_capacity());
        set_direction();

        for (std::size_t i = 1; i < num_of_reqs; ++i)
        {
            std::cin >> dest_floor;
            if (is_valid_request(dest_floor))
            {
                requests.emplace_back(dest_floor);
                set_current_capacity(1 + get_current_capacity());
            }

            if (get_current_capacity() == get_max_capacity())
            {
                std::cout << "No more entry. Elevator is full!!n";
                break;
            }
        }
    }

    void Elevator::set_request()
    {
        std::size_t num_of_reqs;
        int dest_floor;

        std::cout << "nEnter number of requests n";
        std::cin >> num_of_reqs;

        std::cout << "nEnter destination floor number.n";
        for (std::size_t i = 0; i < num_of_reqs; ++i)
        {
            std::cin >> dest_floor;
            if (is_valid_request(dest_floor))
            {
                requests.emplace_back(dest_floor);
                set_current_capacity(1 + get_current_capacity());
            }

            if (get_current_capacity() == get_max_capacity())
            {
                std::cout << "No more entry. Elevator is full!!n";
                break;
            }
        }
    }

    bool Elevator::is_valid_request(int floor) const
    {
        if (get_current_capacity() >= get_max_capacity())
        {
            std::cout << "Elevator is Full!!n";
            return false;
        }
        else if (direction == UP && floor < get_current_floor())
        {
            std::cout << "Elevator is going UP.n";
            return false;
        }
        else if (direction == DOWN && floor > get_current_floor())
        {
            std::cout << "Elevator is going DOWN.n";
            return false;
        }
        else if (floor > get_max_floor() || floor < get_min_floor())
        {
            std::cout << "This floor does not existn";
            return false;
        }
        else
        {
            return true;
        }
    }

    void Elevator::set_direction()
    {
        if (requests(0) > get_current_floor())
        {
            direction = UP;
        }
        else if (requests(0) < get_current_floor())
        {
            direction = DOWN;
        }
    }

    void Elevator::start_elevator()
    {
        int curr_floor = get_current_floor();
        std::size_t curr_capacity = get_current_capacity();

        std::cout << "nThe current floor is " << curr_floor << " and number of person in elevator are " << curr_capacity <<"n";

        //Entering requests for first time
        set_initial_request(); 
        std::sort(requests.begin(), requests.end());

        while (!requests.empty())
        {
            if (direction == UP)
            {
                set_current_floor(requests(0));
            }
            else if (direction == DOWN)
            {
                set_current_floor(requests(requests.size() - 1));
            }
            curr_floor = get_current_floor();
            curr_capacity = get_current_capacity();

            auto curr_floor_req = std::find(requests.begin(), requests.end(), get_current_floor());
            while (curr_floor_req != requests.end())
            {
                requests.erase(curr_floor_req); //removing current floor's requests
                curr_capacity--;
                curr_floor_req = std::find(requests.begin(), requests.end(), get_current_floor());
            }

            set_current_capacity(curr_capacity);

            std::string dir;
            if (direction == UP)
            {
                dir = "UP";
            }
            else
            {       
                dir = "DOWN";
            }

            //Entering requests for current floor
            std::cout << "n=======================================================n";
            std::cout << "The current floor is " << curr_floor << " and number of person in elevator are " << curr_capacity <<"n";
            std::cout << "nDirection of elevator is " << dir << " and Total capacity of the elevator is " << get_max_capacity() << "n";
            std::cout << "nMinimum floor number is " << get_min_floor() << " and Maximum floor number is " << get_max_floor() << "n";
            std::cout << "n=======================================================n";

            if (curr_floor == get_max_floor())
            {
                direction = DOWN;
            }
            else if (curr_floor == get_min_floor())
            {
                direction = UP;
            }

            if (current_capacity == 0) //Elevator is empty
            {
                set_initial_request();
                std::sort(requests.begin(), requests.end());
            }
            else
            {
                set_request();
                std::sort(requests.begin(), requests.end());
            }
        }
    }

int main()
{
    int min_floor_num, max_floor_num;
    std::size_t max_capacity;

    std::cout << "Enter minimum floor number, maximum floor number in the buildingn";
    std::cin >> min_floor_num >> max_floor_num;

    std::cout << "Enter maximum capacity for the elevatorn";
    std::cin >> max_capacity;

    Elevator elevator(min_floor_num, max_floor_num, max_capacity);
    elevator.start_elevator();  
}

When people in a floor enter an elevator, the user should know how many people are entering and how many people are entering num_of_reqs, How do I write code so that we do not need a variable? num_of_reqs,

I'm going to design Google ad banner ads, website partners for $ 20

I design banner ads (Google ads, website partners)

Hi

This gig for the design of a series of Google ads / web banner design.

The images, dimensions, logo and other instructions must be provided by you.

Please contact me if you have any questions

greetings

, (tagsToTranslate) show banner (t) banner (t) banner (t) banner (t) design (t) show google (t) show (t)

Removing / changing the background of up to 2 images – professional work for $ 2

Removing / changing the background of up to 2 pictures – professional work

I'm a graphic designer and I offer you high-quality image processing and background removal. I work to complete customer satisfaction, so you always get a high quality result.

MY SERVICES:

  • Remove background from the image
  • Transparent / White / Custome Photo Background.
  • Change only the background color
  • Product photo editing
  • Change image size.
  • 3 hours super fast delivery
  • 100% satisfaction guarantee

What I need from you:
Feel free to ask questions! Ready to receive the custom quote. I'm there for you 24 hours a day.

* 100% satisfaction guaranteed or money back. *

thanks

Interaction Design – How to best view multiple data points in a single row in a list view?

Enter image description here

Hi!
I design a list that needs to include multiple data points in a single row under a single category, and wonder if there are UI patterns that best fit that requirement.

I have seen lists that contain lines with a long block of text (such as a paragraph), but still represent a discrete block of data – whereas what I design will be many separate data points (eg, Protocol 1, Protocol 2), etc.)

In principle, the user must quickly and efficiently identify which protocols are linked to the corresponding rules. I've been thinking about an expanding line interaction as well as a modal one, but both seem a bit click-intensive.

Any thoughts? Thank you for your look, we look forward to your feedback!

Camera Design – In-Body Neutral Density Filter (ND Filter)?

Just a guess, but I do not think ND filters are as prevalent as you suspect. A very large proportion of the users of a particular camera will never need an ND filter and therefore will not be interested in paying the extra cost of adding the filter to the camera.

An embedded ND filter would also have to be variable, otherwise it can not replace all potentially required densities. ND filters are available in many densities, and fixed density filters are much easier to manufacture than variable density filters. Variable density filters are typically made by combining multiple polarizing filters, are difficult to build (expensive to read), and may have optical disadvantages compared to fixed density filters.

Front-End – Is it possible to design a notebook in terms of code formatting to behave like a text editor like Sublime Text?

Can Mathematica behave natively or otherwise like a traditional text editor such as Sublime Text or Notepad ++ when it comes to formatting code and syntax highlighting?

I've seen some users use Mathematica through a power shell or a terminal – I do not want to do this because it seems to bypass the instant feedback on plotting that you get in a notebook, but formatting code in the more traditional way would be nice.

At the moment I put everything in codeblocks (Alt + 8) which usually does the trick. There are also packages in Sublime Text that allow syntax highlighting and formatting code, but you'll need to copy your text to an MM notebook – awkward!

Domain Driven Design – Get the right class based on an argument – Pattern

I have a little doubt as to whether a class in the base of an object is passed to a function.
In my case, I can use two different types of objects: classA, classB, which have the same interface.
I need to pass one of these objects to a service and get its repository.
I thought something like this:

classA implements MyInterface {
...
}
classB implements MyInterface {
...
}

class MyService () 
{
   private $strategy;

   public function __construct(Strategy $strategy)
   {
      $this->strategy = $strategy;
   }

   public function execute(MyInterface $object)
   {
      $repository = $this->strategy->getRepository($object);
   }
}

class Strategy
{
    private $repoA;
    provate $repoB;

    public function __construct(ClassARepository $repoA, ClassBRepository $repoB)
    {
        $this->repoA = $repoA;
        $this->repoB = $repoB;
    }

    public function getRepository(MyInterface $object)
    {
        if ($object::class === 'classA') {
           return $this->repoA;
        }

        if ($object::class === 'classB') {
           return $this->repoB;
        }

        throw new DomainException('Invalid Class');
    }
}

So I have created a service that decides which repository comes with an if condition. Is that correct? Or is there a cleanest and right code?
Thank you very much