Commit 02b702d2 authored by fmg005's avatar fmg005

Patient out Base class

parent 7e532155
#include "PatientOut.h"
PatientOut::PatientOut(std::shared_ptr<CLA::LOGGER>& logger, CLA::Environment& \
env, std::map<std::string,CLA::Pump*>& pumps) : m_logger(logger), m_env(env),
m_action(logger, pumps) {
}
void PatientOut::LoadConfig(std::unique_ptr<PhysiologyEngine>& engine) {
/* pulse engine advance time */
advance_time = m_env.pulse_advance_time;
/* run update method at rate of `secs` in realtime*/
secs = m_env.prosim_real_time;
/* convert to duration seconds */
m_next_start_in = duration<double>(secs);
/*intialize action -> prepare for infusions */
m_action.initialize(engine);
}
PatientOut::~PatientOut() {
m_logger->info("End of simulation");
}
#ifndef PatientOut_H
#define PatientOut_H
#include <chrono>
#include <libconfig.h++>
#include "CLA_Logger.h"
#include "Environment.h"
#include "Action.h"
/* Pulse header files */
#include "PulsePhysiologyEngine.h"
using namespace std::chrono;
using namespace libconfig;
class PatientOut {
private:
CLA::Environment m_env;
std::shared_ptr<CLA::LOGGER> m_logger;
public:
CLA::Action m_action;
duration<double> m_next_start_in;
double advance_time;
double secs;
PatientOut(std::shared_ptr<CLA::LOGGER>&, CLA::Environment&, \
std::map<std::string, CLA::Pump*>&);
~PatientOut();
void LoadConfig(std::unique_ptr<PhysiologyEngine>&);
virtual void update(std::unique_ptr<PhysiologyEngine>&) = 0;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment