irafhy
Interval arithmetic based Reachability Analysis Framework for Hybrid Automaton
hybridautomaton.h
Go to the documentation of this file.
1 #ifndef REPRESENTATION_FORMAL_HYBRID_AUTOMATON_HYBRID_AUTOMATON_H
2 #define REPRESENTATION_FORMAL_HYBRID_AUTOMATON_HYBRID_AUTOMATON_H
3 
4 #include <irafhy/analyser.h>
5 #include <irafhy/verifier.h>
6 #include <irafhy/settings.h>
11 #include <vector>
12 
13 namespace irafhy
14 {
15  template <typename Analyser, typename Verifier>
16  class HybridAutomaton : public Verifier
17  {
18  private:
22  std::string id_;
26  std::vector<std::string> variables_;
38  std::vector<capd::interval> timeSequence_;
42  std::vector<Condition> reachableConditions_;
50  mutable Model<Analyser>* curModelPtr_ = nullptr;
51 
52  private:
56  const Model<Analyser>* startModelPtr(const Settings& settings) const;
60  void constructTransitions();
69  Condition durationSimulate(const Time& duration,
70  const Settings& settings,
71  State<Analyser>& curWork,
72  long int& doneJumps);
78  bool verify(const Settings& settings) const;
79 
80  public:
89  HybridAutomaton(const HybridAutomaton<Analyser, Verifier>& hybridAutomaton) = default;
94  HybridAutomaton(HybridAutomaton<Analyser, Verifier>&& hybridAutomaton) = default;
104  ~HybridAutomaton() = default;
109  void setID(const std::string& id);
114  void setVariables(const std::vector<std::string>& variables);
129  std::string id() const;
134  std::vector<std::string> variables() const;
149  std::vector<capd::interval> timeSequence() const;
154  std::vector<Condition> reachableConditions() const;
159  Time curDuration() const;
164  Model<Analyser>* curModelPtr() const;
168  void initialize();
173  void simulate(const Settings& settings);
174  };
175 
184  template <typename Analyser, typename Verifier>
185  std::ostream& operator<<(std::ostream& out, const HybridAutomaton<Analyser, Verifier>& rhs);
186 } // namespace irafhy
187 #ifndef USE_AS_STATIC
188 #include "../../../../../src/representation/formal/hybridAutomaton/hybridautomaton.tpp"
189 #endif
190 #endif //REPRESENTATION_FORMAL_HYBRID_AUTOMATON_HYBRID_AUTOMATON_H
Locations< Analyser > locations() const
get the locations of the hybrid automaton
void setID(const std::string &id)
set the identifier of the hybrid automaton
struct used to hold the duration information
Definition: metaStructure.h:14
std::vector< capd::interval > timeSequence() const
get the time sequence of the simulation
Definition: model.h:16
Definition: hybridautomaton.h:16
Definition: condition.h:22
const Model< Analyser > * startModelPtr(const Settings &settings) const
std::vector< std::string > variables() const
get the variables of the hybrid automaton
Time curDuration_
current duration which specify the time interval of one iteration
Definition: hybridautomaton.h:46
Definition: state.h:13
Model< Analyser > * curModelPtr() const
get the pointer to the current mode
Definition: settings.h:12
void setVariables(const std::vector< std::string > &variables)
set the variables of the hybrid automaton
Locations< Analyser > locations_
set of discrete states which are also called modes
Definition: hybridautomaton.h:34
std::vector< std::string > variables_
variable of the system
Definition: hybridautomaton.h:26
void setLocations(const Locations< Analyser > &locations)
set the modes of the hybrid automation with given locations
std::vector< Condition > reachableConditions() const
get the reachable conditions of the simulation
void simulate(const Settings &settings)
simulation with given settings
Transitions< Analyser > transitions() const
get the transitions of the hybrid automaton
Definition: condition.cpp:3
void setTransitions(const Transitions< Analyser > &transitions)
set the jumps of the hybrid automaton with given transitions
Definition: verifier.h:8
std::vector< Condition > reachableConditions_
resulting reachable conditions
Definition: hybridautomaton.h:42
~HybridAutomaton()=default
destructor
Definition: transitions.h:11
bool verify(const Settings &settings) const
check if the simulation should be terminated
Condition durationSimulate(const Time &duration, const Settings &settings, State< Analyser > &curWork, long int &doneJumps)
simulation with given duration
Time curDuration() const
get the current duration of the simulation
HybridAutomaton()
default constructor
std::string id_
identifier of the hybrid automation
Definition: hybridautomaton.h:22
Model< Analyser > * curModelPtr_
pointer to the current mode
Definition: hybridautomaton.h:50
Transitions< Analyser > transitions_
transitions which specify the jumps among modes
Definition: hybridautomaton.h:30
Definition: locations.h:9
void constructTransitions()
construct the jumps among modes
std::vector< capd::interval > timeSequence_
time sequence during the computation
Definition: hybridautomaton.h:38
void initialize()
initialize the hybrid automaton
std::string id() const
get the identifier of the hybrid automaton