irafhy
Interval arithmetic based Reachability Analysis Framework for Hybrid Automaton
condition.h
Go to the documentation of this file.
1 #ifndef REPRESENTATION_FORMAL_BASIC_CONDITION_H
2 #define REPRESENTATION_FORMAL_BASIC_CONDITION_H
3 
7 #include <boost/variant.hpp>
8 
9 namespace irafhy
10 {
14  using GeoEntity = boost::variant<IntervalHull, Polytope>;
15 
16  struct geoEntityVisitor : public boost::static_visitor<GeoEntity>
17  {
18  public:
19  GeoEntity operator()(const GeoEntity& geoEntity) const { return geoEntity; }
20  };
21 
22  class Condition
23  {
24  private:
29 
30  public:
37  static Condition Empty(GEOMETRY geometry = GEOMETRY::INTERVAL_HULL, std::size_t dimension = 0);
38 
39  public:
43  Condition();
49  explicit Condition(const std::vector<Point>& points, GEOMETRY geometry);
55  explicit Condition(const std::vector<capd::interval>& constraints, GEOMETRY geometry);
60  explicit Condition(const GeoEntity& geoEntity);
67  Condition(const Point& center, double radius, GEOMETRY geometry);
73  Condition(const capd::C0Rect2Set& set, GEOMETRY geometry);
77  ~Condition() = default;
82  [[nodiscard]] capd::IVector constraints() const;
87  [[nodiscard]] GeoEntity entity() const;
92  [[nodiscard]] bool empty() const;
97  [[nodiscard]] int dimension() const;
104  bool intersect(const Condition& rhs, Condition& result) const;
110  [[nodiscard]] Condition unite(const Condition& rhs) const;
115  [[nodiscard]] Point randInnerPoint() const;
120  Point centroid() const;
126  [[nodiscard]] bool contains(const Condition& rhs) const;
132  [[nodiscard]] bool contains(const Point& point) const;
137  [[nodiscard]] std::vector<Point> vertices() const;
142  [[nodiscard]] capd::C0Rect2Set set() const;
143  };
150  std::ostream& operator<<(std::ostream& out, const Condition& rhs);
151 } // namespace irafhy
152 #endif //REPRESENTATION_FORMAL_BASIC_CONDITION_H
std::ostream & operator<<(std::ostream &out, const Condition &rhs)
output the right hand side condition to the standard out stream
Definition: condition.cpp:246
GEOMETRY
supported geometry object
Definition: enum.h:75
Definition: condition.h:16
Definition: condition.h:22
boost::variant< IntervalHull, Polytope > GeoEntity
geometry entity which used for represent the interval hull or polytope and any other objects shall be...
Definition: condition.h:14
Definition: point.h:10
GeoEntity geoEntity_
entity of the condition
Definition: condition.h:28
Definition: enum.h:77
Definition: condition.cpp:3
GeoEntity operator()(const GeoEntity &geoEntity) const
Definition: condition.h:19