Meteo.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef METEO_HPP
  2. #define METEO_HPP
  3. #include <fstream>
  4. #include <vle/devs/Dynamics.hpp>
  5. class Meteo : public vle::devs::Dynamics
  6. {
  7. public:
  8. Meteo(const vle::graph::AtomicModel& model,
  9. const vle::devs::InitEventList& lst);
  10. virtual ~Meteo();
  11. virtual vle::devs::Time timeAdvance() const;
  12. virtual vle::devs::Time init(const vle::devs::Time& time);
  13. virtual void internalTransition(const vle::devs::Time& time);
  14. virtual void output(const vle::devs::Time& currentTime,
  15. vle::devs::ExternalEventList& output) const;
  16. virtual vle::value::Value* observation(const vle::devs::ObservationEvent& event) const;
  17. virtual void updateState();
  18. private:
  19. enum State { STATE1, STATE2 };
  20. // Phase du modèle
  21. State state;
  22. // Working variables
  23. std::ifstream file;
  24. std::string line;
  25. // Parameters
  26. std::string file_path;
  27. //! Variables d'état du modèle
  28. int year;
  29. int month;
  30. int day;
  31. double Tmin;
  32. double Tmax;
  33. double Tmoy;
  34. double Hmin;
  35. double Hmax;
  36. double Hmoy;
  37. };
  38. DECLARE_DYNAMICS(Meteo);
  39. #endif