123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef METEO_HPP
- #define METEO_HPP
- #include <fstream>
- #include <vle/devs/Dynamics.hpp>
- class Meteo : public vle::devs::Dynamics
- {
- public:
- Meteo(const vle::graph::AtomicModel& model,
- const vle::devs::InitEventList& lst);
- virtual ~Meteo();
- virtual vle::devs::Time timeAdvance() const;
- virtual vle::devs::Time init(const vle::devs::Time& time);
- virtual void internalTransition(const vle::devs::Time& time);
- virtual void output(const vle::devs::Time& currentTime,
- vle::devs::ExternalEventList& output) const;
- virtual vle::value::Value* observation(const vle::devs::ObservationEvent& event) const;
- virtual void updateState();
- private:
- enum State { STATE1, STATE2 };
- // Phase du modèle
- State state;
- // Working variables
- std::ifstream file;
- std::string line;
- // Parameters
- std::string file_path;
- //! Variables d'état du modèle
- int year;
- int month;
- int day;
- double Tmin;
- double Tmax;
- double Tmoy;
- double Hmin;
- double Hmax;
- double Hmoy;
- };
- DECLARE_DYNAMICS(Meteo);
- #endif
|