SOLA
Loading...
Searching...
No Matches
task.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_MODEL_TASK_NS3_H_
18#define DAISI_MODEL_TASK_NS3_H_
19
20#include <iostream>
21#include <optional>
22
23#include "cpps/model/order_states.h"
24#include "ns3/simulator.h"
25#include "ns3/vector.h"
26#include "solanet/serializer/serialize.h"
27
28namespace daisi::path_planning {
29
30class Task {
31public:
32 Task() = default;
33 ~Task() = default;
34
35 Task(const ns3::Vector &from, const ns3::Vector &to);
36 Task(std::string uuid, const ns3::Vector &from, const ns3::Vector &to);
37
38 ns3::Vector getPickupLocation() const;
39 ns3::Vector getDeliveryLocation() const;
40
41 cpps::OrderStates getOrderState() const;
42 void setOrderState(const cpps::OrderStates &state);
43
44 ns3::Vector getCurrentPosition() const;
45 void setCurrentPosition(const ns3::Vector &currentPosition);
46
47 std::string getUuid() const;
48
49 void setConnection(const std::string &connection);
50 std::string getConnection() const;
51
52 void setName(const std::string &name);
53 std::string getName() const;
54
55 SERIALIZE(uuid_, from_x_, from_y_, to_x_, to_y_, connection_, name_);
56
57private:
58 std::string uuid_;
59 std::string connection_;
60 std::string name_;
61
62 double from_x_ = 0.0, from_y_ = 0.0;
63 double to_x_ = 0.0, to_y_ = 0.0;
64
65 ns3::Vector current_pos_;
66 cpps::OrderStates order_state_ = cpps::OrderStates::kError;
67};
68} // namespace daisi::path_planning
69
70#endif
Definition task.h:30